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
sutcha
Posts : 2
Join date : 2012-05-03

Problems finding element due to various IDs/locators Empty Problems finding element due to various IDs/locators

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
avatar
tarun3kumar
Master
Master
Posts : 186
Join date : 2012-02-14
http://seleniumtests.com

Problems finding element due to various IDs/locators Empty Re: Problems finding element due to various IDs/locators

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
avatar
sutcha
Posts : 2
Join date : 2012-05-03

Problems finding element due to various IDs/locators Empty Re: Problems finding element due to various IDs/locators

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.
Sponsored content

Problems finding element due to various IDs/locators Empty Re: Problems finding element due to various IDs/locators

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