Share
Go down
senthilm.aynara
Active particpant
Active particpant
Posts : 19
Join date : 2009-09-15

How can i type content whose id is changed dynamically

on Mon Oct 26, 2009 3:06 pm
Hi all,

I am using Selenium RC with java client.
In my application, i have a text box (id=text209) and button(id=btn209).
Here id changed dynamically (ie, for text box, text209 - text always same but 209 changes dynamically and same way in button)
But i need to type a text in that text box. How can i find that text box and button?

Thanks in advance,
senthilm
avatar
Advisor
------------------------
------------------------
Posts : 383
Join date : 2009-07-30
Location : India
http://seleniumforum.forumotion.net

Re: How can i type content whose id is changed dynamically

on Wed Oct 28, 2009 6:53 pm
Hi,

Try out these function to solve your problem:

1. Have a look at the xpath contains function e.g.: //input[contains(@id, 'text')] or //input[contains(@id, 'text.*')]
2. Another solution, what you can do is get value of that element time through getAttribute command and after getting that value, passed that value into click/type command.
3. use selenium regular expression feature like
Selenium.click(reg:type[0-9][0-9][0-9]);

So, you can try all of these and may be one of them, work for you. Best of luck.
Bye
senthilm.aynara
Active particpant
Active particpant
Posts : 19
Join date : 2009-09-15

Re: How can i type content whose id is changed dynamically

on Thu Oct 29, 2009 11:47 am
Thanks for your reply.
Sponsored content

Re: How can i type content whose id is changed dynamically

Back to top
Permissions in this forum:
You cannot reply to topics in this forum