Selenium 2, wildcard for finding elements by name

2,931 views
Skip to first unread message

E Supp

unread,
Jul 7, 2010, 6:11:22 AM7/7/10
to Selenium Users
hi,

i have the problem that the elements on my page have dynamic names and
so i can't find dem with an hole string like "cb105textfield". cb105
can change but textfield would be always the same.

Identify my Element:
(InternetExplorerWebElement)driver.FindElement(By.Name("cb105textfield"));

Is there any possibility to use an wildcard? I just tried *textfield
or %textfield but with both i was not able to "find" the element on
the page.

bw,
ebsupp

E Supp

unread,
Jul 9, 2010, 8:19:25 AM7/9/10
to Selenium Users
A workaround is to work with xpath and contains(...)

Niraj Kumar

unread,
Jul 12, 2010, 1:16:18 PM7/12/10
to seleniu...@googlegroups.com
go through this blog you will come to use

http://automationtricks.blogspot.com/2010/05/how-to-identify-dynamic-element-in.html


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.




--
Thanks & Regard,
Niraj Kumar

Reply all
Reply to author
Forward
0 new messages