Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem finding submit button with htm
#1
I've got a macro that's opening an instance of Internet Explorer. It does a get of an https url with login variables in the URL (get vars). It then goes to another URL once the window returns "not busy". It then searches for URLs, sets focus and shift-tabs back to hit space to select a check-box to the left of each URL I'm looking for. This all works great.

What it fails to do is find and click the submit button.

The part that finds the URLs by their text and hits the check-box immediately before them...
Code:
Copy      Help
for i 0 13
    fname.from(procDate "." extArr[i]);
    fileArr[i] = htm("A" fname);
    fileArr[i].SetFocus;
    key ST V;

The URLs look like this:
Code:
Copy      Help
<A HREF="/PATH/OBSCURED?operation=DOWNLOAD&mailbox_id=OBSCURED&batch_num=1234567&data_format=A&batch_id=061807.PPES"
       >

As said, that's working fine. Nothing fancy on the htm(). It just works.

The part that's not working is:
Code:
Copy      Help
dButton = htm("INPUT" "Download");
dButton.Click;

The button's format in the source is:
Code:
Copy      Help
<INPUT TYPE="SUBMIT" NAME="DOWNLOADALL" VALUE="Download" CHECKED="CHECKED">

Yes, I'm aware "checked" is not a proper item for type="submit". It's not my page, I'm just trying to automate a download process we have to do every morning. Either way, it's returning this error in QM 2.1.8:

Code:
Copy      Help
Error (RT) in Download Macro: object is not initialized

So, I'm a bit confused. It finds all the items for fileArr okay, but can't find the item for dButton? Any hints what I'm doing wrong?

-Todd Hartman
#2
Use flag 0x400, because "Download" is not simple text (<tag ...>Download</tag>) but an attribute (<tag value="Download">). To avoid such situations, use the Find Html Element dialog.


Forum Jump:


Users browsing this thread: 1 Guest(s)