- senthilm.aynaraActive particpant
- Posts : 19
Join date : 2009-09-15
How can i type content whose id is changed dynamically
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
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
Re: How can i type content whose id is changed dynamically
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
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.aynaraActive particpant
- Posts : 19
Join date : 2009-09-15
Re: How can i type content whose id is changed dynamically
Thu Oct 29, 2009 11:47 am
Thanks for your reply.
Permissions in this forum:
You cannot reply to topics in this forum
|
|