Linked Questions

2 votes
7 answers

Is element unique ID preferable to use as a Selenium locator than element text? [duplicate]

There is a calculator app The task was to create test automation suite for the app. All calculator buttons have unique ids which were used to interact with them. A button element ...
inmydelorean's user avatar
31 votes
7 answers

Is adding IDs to everything standard practice when using Selenium?

My team is using Selenium WebDriver and the QA team is having the developers add IDs to almost everything. Is that normal or is Selenium flexible enough that tests can be written with the markup that ...
ejunker's user avatar
  • 413
5 votes
4 answers

How to generate good locators for elements in Web pages?

This site contains many questions that are about finding the right locator expression (XPath, CSS, etc) for an object in WebPage or about troubleshooting problems related in invalid or dynamic ...
dzieciou's user avatar
  • 10.5k
7 votes
4 answers

same xpath on the page with dynamic ID selenium java

I have a problem with the two same XPath with dynamic ID on the same page. I have tested for selenium in java, when I need to confirm button on delete upload file. Instead of this, test first submits ...
Hana Puklická's user avatar
7 votes
1 answer

POM vs PageFactory

I'm starting my career as a QA Automation Engineer coming from a Jr dev background. I noticed that there are two main design patterns for Selenium, POM and PageFactory. Which is the preferred design ...
chris's user avatar
  • 81
10 votes
2 answers

Detecting complicated CSS selectors

This is a follow-up to What makes a good selenium locator? Motivation I've been thinking about detecting the complexity of CSS selectors statically. The scope I'm working in is both test-automation ...
alecxe's user avatar
  • 11.4k
2 votes
2 answers

How to use OCR in Selenium to identify dynamic objects

I need to implement OCR (tesseract, Abbyy, MODI, Aprise, etc..) to identify dynamically changing web elements in application page at automation runtime. This way the Selenium webdriver automation ...
Amitkkar's user avatar
1 vote
3 answers

Select element by containing text without XPath in Selenium

There is a great discussion on what makes a good Selenium locator here. It seems many testers prefer CSS to XPath for locators, for various reasons. And that goes for me, too. But, it is often ...
Mate Mrše's user avatar
  • 4,119
4 votes
3 answers

How much does WebDriver code depend on source code

On the login page, the user name, password and login button fields all have id/class name in source code. So when writing web driver script, if the code gets changed then does the web driver code ...
Nilam Nikam's user avatar
1 vote
1 answer

find_elements_by_xpath issue!

I'm trying to complete the basic python Selenium demo ( but I'm attempting to do that same procedure on ...
Auraius's user avatar
  • 11
0 votes
7 answers

How to handle changing absolute XPath?

/html/body/div/main/div/div/div[2]/div/div/div/div[1]/div/div***[4]***/div/div[2] The div[4] element keeps changing. If a new item comes into the web, the div number changes. How do I handle this?
orkeddelilah's user avatar
1 vote
4 answers

In Automation how can I automatically update web object identifier values (xpath, id, name, etc) as UI changes sprint by sprint?

In Agile methodologies, UI changes rapidly and its very tough to maintain automated regression suite. Is there any approach, with which we can update it automatically or at least minimize the ...
Jatin khurana's user avatar
1 vote
2 answers

How to reduce Phantom js test execution time for selenium junit test cases

I am using phatnom js driver for my selenium test cases to overcome the headache of chrome driver.I see it is taking lot of time to execute the test cases.I tried html diver prior to phantom.Since ...
Pradeep's user avatar
  • 171
0 votes
1 answer

How to locate any element on browser using location of the element?

I just want to click somewhere on the window. Do we have any method to locate some element or anything on web browser to click on it? public static void main(String[] args) throws ...
Amar Kanchi's user avatar