Sign in to follow this  
Followers 0
nbala75

Different ways to click a button

7 posts in this topic

Quickeee plz

What are the different ways to click a button appearing on a IE webpage, when there is no name associated with it. I can see only its "value", by using Debugbar

plz help me asap

Share this post


Link to post
Share on other sites



If an element has no name or id, then you can either get a collection of all matching elements (all INPUT tags, for example), and then loop through the collection looking for an attribute you have, like value or innnerText.

Another technique I have used is to get it relative to another element the does have an id or name. You can find parent, child, nextSibling, etc. to get the one you want.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Psalty DS

Thanx for ur reply...

This is what iam referring to....Which function to use here, bcos, _IEFormElementGetObjByName cud not fetch me anything ??

Posted Image

Edited by nbala75

Share this post


Link to post
Share on other sites

Get the collection of all INPUT tags with _IETagNameGetCollection(), then loop through the collection to find the one with .value = "Cancel". There is a demo script in the help file.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Thanx for ur help and will try that function

Btw i have another issue

This sounds weird for me....still better to ask experts. I have been trying to sort this from yday evening but nothing moves on...and i dont want to open a new thread for this...hope u read this and help me out

Look at this simple code and tell me why this is not working out...

MsgBox(0,$tprice&" "&$osl+0.05) ;Msgbox 1

If $tprice=$osl+0.05 then

MsgBox(0,"","iam inside loop") ;Msgbox 2

Endif

Msgbox 1 pops out msg giving out both the values as given below:--

Posted Image

I can see both the values are same and still it is not going inside the If condition loop and the Msgbox 2 never fires....i really dont know what iam missing here.... looks weird for me :);)

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

MsgBox(0,$tprice&" "&$osl+0.05) ;Msgbox 1

If $tprice=$osl+0.05 then

MsgBox(0,"","iam inside loop") ;Msgbox 2

Endif

$tprice = 50.1

$osl = 50.05

MsgBox(0,"Title", $tprice & " " & $osl + 0.05) ;Msgbox 1

If StringCompare($tprice, $osl+0.05) = 0 then

MsgBox(0,"Title","iam inside loop") ;Msgbox 2

Endif

Edited by rogue5099

Share this post


Link to post
Share on other sites

Get the collection of all INPUT tags with _IETagNameGetCollection(), then loop through the collection to find the one with .value = "Cancel". There is a demo script in the help file.

;)

Yup...thanx a lot and i cud get it done :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0