how to click second search button

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
bbgaw
Newbie
Posts: 13
Joined: Thu May 08, 2008 7:54 pm

how to click second search button

Post by bbgaw » Mon Jun 02, 2008 2:34 pm

Hi,

I am trying to automate this webpage.

http://www.ec.gc.ca/CEPARegistry/subs_l ... search.cfm

I can input my query item (CAS number) into the right box, but there are two search buttons. I am supposed to click the second one for CAS number. However, using the code generate by WebRecorder, it seems like I click the first search button.

How can I tell scripts to click the second one?

Thanks a lot! Here is part of my code:

IE_Navigate>%IE[0]%,http://www.ec.gc.ca/CEPARegistry/subs_l ... arch.cfm,r
IE_Wait>%IE[0]%,r
Wait>delay

Let>FrameName={""}
Let>FormName={""}
Let>FieldName={"critCAS"}
Let>FieldValue={"71-43-2"}
IE_FormFill>%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0,r

Let>FrameName={""}
Let>FormName={""}
Let>TagValue={""}
IE_ClickTag>%IE[0]%,str:FrameName,str:FormName,INPUT,NAME,str:TagValue,r

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Jun 02, 2008 2:59 pm

Instead of using NAME to identify the input button you could use INDEX to identify it numerically. See the WebRecorder help file topic for ClickTag.

An alternative would be to use FindImagePos to find all occurrences of the button.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

bbgaw
Newbie
Posts: 13
Joined: Thu May 08, 2008 7:54 pm

using index

Post by bbgaw » Mon Jun 02, 2008 7:28 pm

Hi,

I am trying to use index for clicktag. I tried several format of clicktag, but it is not working for me. There is no usage example for this case. Could you please let me know how to use it exactly?

Here is my code and it doesn't click anything yet. Thanks a lot!


IE_Navigate>%IE[0]%,http://www.ec.gc.ca/CEPARegistry/subs_l ... arch.cfm,r
IE_Wait>%IE[0]%,r
Wait>delay

Let>FrameName={""}
Let>FormName={""}
Let>FieldName={"critCAS"}
Let>FieldValue=line
IE_FormFill>%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0,r

Let>FrameName={""}
Let>FormName={""}
Let>TagValue={""}
IE_ClickTag>%IE[0]%,str:FrameName,str:FormName,INPUT,INDEX,1,str:TagValue,r

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts