Page 1 of 1

Dynamic Input id

Posted: Tue Apr 29, 2014 8:30 pm
by skhanpara
I am testing on a Web form, which has input box and the ID of that input box changes with every login
Even if the user is same, the ID will be different with every login

I am not able to click on the input box.

Please suggest

Thank you

Re: Dynamic Input id

Posted: Tue Apr 29, 2014 9:02 pm
by odklizec
Hi,

It would be helpful if you provide us with the snasphot of your problematic element. It's hard to help you without deeper knowledge of your app/element in question.

Also, I would suggest you to read this blog post...
http://www.ranorex.com/blog/automated-t ... ynamic-ids

Re: Dynamic Input id

Posted: Wed Apr 30, 2014 9:58 am
by mzperix
Hi skhanpara,

As odklizec suggested, you may share us some more information about the xpath Ranorex genrates, and look into the blog post he suggested.

On a further note, if the ID consists of a fix and a dynamic part, like @id="pasword_1222", then you can change the xpath from @id="password_1222" to @id~"^password"

The ~ operator is the "contains" operator, while the ^ sign means "starts with".

So what i did is: find an ID that starts with "password".

Som more reading about Xpath: http://www.ranorex.com/support/user-gui ... xpath.html

Kind regards,
Zoltan

Re: Dynamic Input id

Posted: Wed Apr 30, 2014 3:34 pm
by skhanpara
Thanks everyone for your reply

http://www.ranorex.com/blog/automated-t ... ynamic-ids

the link really help me out