Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
dainova
Active particpant
Active particpant
Posts : 19
Join date : 2012-02-23

Find element with generic name Se, IDE Empty Find element with generic name Se, IDE

Tue Apr 09, 2013 12:43 am
HI,
I need to automate one page and one link got his id/xpath name is kind of generic name (m01submit_111111, m01submit_222222, m01submit_33333...). Every time number portion is different (and there is no logic I see how it changed). This part of verification process.

Is there any way to figure out this id on the fly, I was thinking to look into source, find "m01submit" and take the whole name?
Or there is any other solution,
maybe IDE can work by location ?

or....
Here is a expert from page source, it's td..




Thanks to all
Dai
Code:

...
...
   <td class="table_data_custom">
      <a href="javascript:verifyAccount(12345678)" style="text-decoration:none" id='m01submit_22319907'><b>Add</b></a>
   </td>
      </tr>
...


Last edited by dainova on Tue Apr 09, 2013 3:25 am; edited 3 times in total
avatar
ccox
Master
Master
Posts : 205
Join date : 2012-01-06
Age : 38
Location : Denver, CO

Find element with generic name Se, IDE Empty Re: Find element with generic name Se, IDE

Tue Apr 09, 2013 3:14 am
Rather than using the id, use it's XPath. Here is a good reference to try

http://automationtricks.blogspot.com/2010/05/how-to-identify-dynamic-element-in.html
avatar
dainova
Active particpant
Active particpant
Posts : 19
Join date : 2012-02-23

Find element with generic name Se, IDE Empty Re: Find element with generic name Se, IDE

Tue Apr 09, 2013 3:24 am
I tried to use xpath, it also features 9999999s in its name.

Actually xPath from Chrome is like this and it works OK, with IDE/FF
ClickAndWait | //*[@id="m01submit_22319907"]/b


And from FF firebug: ** and it doesn't work
/html/body/form/table[5]/tbody/tr[5]/td[3]/a/b

I playing with startwith/contain ..

Thanks
Dai


Last edited by dainova on Tue Apr 09, 2013 3:44 am; edited 1 time in total
avatar
ccox
Master
Master
Posts : 205
Join date : 2012-01-06
Age : 38
Location : Denver, CO

Find element with generic name Se, IDE Empty Re: Find element with generic name Se, IDE

Tue Apr 09, 2013 3:27 am
Did you look at the link?

How about this:
//*[starts-with(@id, 'm01submit')]
avatar
dainova
Active particpant
Active particpant
Posts : 19
Join date : 2012-02-23

Find element with generic name Se, IDE Empty Re: Find element with generic name Se, IDE

Tue Apr 09, 2013 3:47 am
Thanks, ccox.

Problem solved!!!

Best
Dai
Sponsored content

Find element with generic name Se, IDE Empty Re: Find element with generic name Se, IDE

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