Linked Questions

2
votes
7answers
685 views

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

There is a calculator app calculatoria.com. 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 ...
26
votes
7answers
13k views

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 ...
4
votes
4answers
3k views

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 ...
7
votes
4answers
3k views

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 ...
7
votes
1answer
2k views

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 ...
4
votes
3answers
350 views

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 ...
2
votes
2answers
4k views

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 ...
10
votes
2answers
601 views

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 ...
1
vote
1answer
1k views

find_elements_by_xpath issue!

I'm trying to complete the basic python Selenium demo (https://selenium-python.readthedocs.io/getting-started.html) but I'm attempting to do that same procedure on https://www.ncbi.nlm.nih.gov/. ...
1
vote
3answers
571 views

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 ...
1
vote
2answers
461 views

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 ...
1
vote
4answers
330 views

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 ...
0
votes
7answers
104 views

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?
0
votes
1answer
78 views

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