Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Geting issues in identifying the elsements in webdriver
Fri Feb 17, 2017 4:41 pm by janbaskt

» WebDriver - why not to use a singlton for it?
Fri Feb 17, 2017 4:40 pm by janbaskt

» WebDriver session when using testng annotation to invoke driver instance
Fri Feb 17, 2017 4:39 pm by janbaskt

» Selenium fails to launch Chrome
Fri Feb 17, 2017 4:39 pm by janbaskt

» why do i get this error
Fri Feb 17, 2017 4:38 pm by janbaskt

» Selenium Tutorial
Thu Feb 16, 2017 5:21 pm by Rahul

» When to use Selenium IDE, RC and WebDriver
Mon Feb 13, 2017 2:35 pm by azharuddin

» How to integrate selenium with ZAPI-Zephyr
Sat Feb 11, 2017 2:25 am by gseera002c

» Selenium Webdriver
Sat Feb 04, 2017 6:47 pm by soumyamishrav@gmail.com

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Find element with generic name Se, IDE

View previous topic View next topic Go down

Find element with generic name Se, IDE

Post by dainova on 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

dainova
Active particpant
Active particpant

Posts : 19
Join date : 2012-02-23

Back to top Go down

Re: Find element with generic name Se, IDE

Post by ccox on 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

ccox
Master
Master

Posts : 205
Join date : 2012-01-06
Age : 31
Location : Denver, CO

Back to top Go down

Re: Find element with generic name Se, IDE

Post by dainova on 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

dainova
Active particpant
Active particpant

Posts : 19
Join date : 2012-02-23

Back to top Go down

Re: Find element with generic name Se, IDE

Post by ccox on Tue Apr 09, 2013 3:27 am

Did you look at the link?

How about this:
//*[starts-with(@id, 'm01submit')]

ccox
Master
Master

Posts : 205
Join date : 2012-01-06
Age : 31
Location : Denver, CO

Back to top Go down

Re: Find element with generic name Se, IDE

Post by dainova on Tue Apr 09, 2013 3:47 am

Thanks, ccox.

Problem solved!!!

Best
Dai

dainova
Active particpant
Active particpant

Posts : 19
Join date : 2012-02-23

Back to top Go down

Re: Find element with generic name Se, IDE

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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