Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» how to connect DB in selenium webriver
Fri Oct 06, 2017 4:09 pm by anbarasi

» How find any text in browser screen and click on it?
Thu Oct 05, 2017 2:02 pm by sandeepkommineni

» Selenium Webdriver
Tue Oct 03, 2017 1:35 pm by PiyushBiswas

» GRID setup tutorial.
Wed Sep 27, 2017 4:29 pm by johnyapp

» Drag & Drop Between Windows Using Selenium Driver
Wed Sep 27, 2017 2:10 pm by 26rondel

» Check if window is closed / verify input
Sat Sep 23, 2017 10:21 pm by brainstir

» How to work on pages with AJAX in selenium?
Mon Sep 18, 2017 6:08 pm by azharuddin

» pause test until user press a key like F2
Wed Aug 09, 2017 11:10 pm by djnforce

» Selecting the input for auto populating element
Sat Jul 29, 2017 7:53 pm by kdabbara

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


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