Dynamic Input id

Ask general questions here.
skhanpara
Posts: 101
Joined: Wed Apr 23, 2014 3:55 pm

Dynamic Input id

Post by skhanpara » Tue Apr 29, 2014 8:30 pm

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

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7469
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Dynamic Input id

Post by odklizec » Tue Apr 29, 2014 9:02 pm

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
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

mzperix
Posts: 137
Joined: Fri Apr 06, 2012 12:19 pm

Re: Dynamic Input id

Post by mzperix » Wed Apr 30, 2014 9:58 am

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

skhanpara
Posts: 101
Joined: Wed Apr 23, 2014 3:55 pm

Re: Dynamic Input id

Post by skhanpara » Wed Apr 30, 2014 3:34 pm

Thanks everyone for your reply

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

the link really help me out