- dainovaActive particpant
- Posts : 19
Join date : 2012-02-23
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
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>
...
- ccoxMaster
- Posts : 205
Join date : 2012-01-06
Age : 39
Location : Denver, CO
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
http://automationtricks.blogspot.com/2010/05/how-to-identify-dynamic-element-in.html
- dainovaActive particpant
- Posts : 19
Join date : 2012-02-23
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
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
- ccoxMaster
- Posts : 205
Join date : 2012-01-06
Age : 39
Location : Denver, CO
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')]
How about this:
//*[starts-with(@id, 'm01submit')]
- dainovaActive particpant
- Posts : 19
Join date : 2012-02-23
Re: Find element with generic name Se, IDE
Tue Apr 09, 2013 3:47 am
Thanks, ccox.
Problem solved!!!
Best
Dai
Problem solved!!!
Best
Dai
Permissions in this forum:
You cannot reply to topics in this forum