Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» FlexMonkium Download Not available under Gorillalogic site
Thu Dec 08, 2016 5:40 pm by bhanu.praveen

» Selenium Script issue
Tue Dec 06, 2016 9:48 pm by njain213

» Difference between QTP, Selenium and Silk test
Tue Dec 06, 2016 7:58 pm by jessicacyrus1

» Where does selenium script pick browser from
Tue Dec 06, 2016 1:52 pm by janbaskt

» Safari throws an HTTP ERROR: 404
Tue Dec 06, 2016 1:51 pm by janbaskt

» Access Denied Error in Selenium RC
Tue Dec 06, 2016 1:51 pm by janbaskt

» Automating Flex application through selenium webdriver
Fri Dec 02, 2016 2:06 pm by abhinay.krs

» Starting with Selenium, what is Selenium?
Mon Nov 28, 2016 4:00 pm by Foma

» Getting started with Selenium
Mon Nov 28, 2016 3:23 pm by Rebbelx

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Problems finding element due to various IDs/locators

View previous topic View next topic Go down

Problems finding element due to various IDs/locators

Post by sutcha on Thu May 03, 2012 8:37 pm

Hi there,


I try to migrate an older selenium project to WebDriver (hope to get more stable results there...).

About my problems:

1. I use lots of methods like selenium.click(locator). Is there any possibility to map this "feature" to WebDriver?

The locator can be an ID, xPath, name etc., so I don't want to refactor each method call to a specific method call with strategy

2. is there a possibility to wait for the first element of a list to appear?

Background: The application I am testing with selenium isn't designed for tests, so some elemtens (e.g. OK-Button) has normal IDs on one site (actionOK), dynamic IDs (ab_1281) or different IDs on every site (actionOk, ctrl_ok). So I have a list with all known IDs, text etc. for each element. In selenium 1 I poll the page until I found the first occurence => this is my target element.

Do you see any possibility to realise this with the WebDriver?


kind regards

sutcha

Posts : 2
Join date : 2012-05-03

Back to top Go down

Re: Problems finding element due to various IDs/locators

Post by tarun3kumar on Mon May 07, 2012 11:48 am

For your first question, this post of mine might help -

http://www.seleniumtests.com/2012/01/selenium-2-methods-are-no-more-weird.html

For your second question on polling/waiting, This doc might help -

http://seleniumhq.org/docs/04_webdriver_advanced.html#explicit-and-implicit-waits

_________________
Thanks
Tarun K
Free Selenium Training

tarun3kumar
Master
Master

Posts : 186
Join date : 2012-02-14

http://seleniumtests.com

Back to top Go down

Re: Problems finding element due to various IDs/locators

Post by sutcha on Mon May 07, 2012 1:39 pm

Thanks for these links.

To be more precisely on my problems:
I do mySeleniumUtils.click(String[] locators) which will look/wait for element by xpath, id, text at the same time. So the first element found will be the right one, so the one to click.

With the WebDriver I need to findElements(By.xpath), ...(By.ID) etc. and I need to know whether my current locator is an id, xpath etc.

Hope you understand my problem.

sutcha

Posts : 2
Join date : 2012-05-03

Back to top Go down

Re: Problems finding element due to various IDs/locators

Post by Sponsored content Today at 8:11 am


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