Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 5574

Used for questions about using Selenium WebDriver, a browser automation framework frequently used to automate testing in a browser.

1 vote

find_elements_by_xpath issue!

First of all, regarding your question about the return types of the "find" commands, it's quite straightforward: find_element_by_*() methods return a WebElement instance - or, in other words, a sing …
alecxe's user avatar
  • 11.4k
3 votes
Accepted

How to find radio button value and ID with xpath

It is difficult to suggest things without being able to test or check them, but, according to the information we have and taking into account that there could be multiple rhr-radio-button elements on …
alecxe's user avatar
  • 11.4k
1 vote
Accepted

Same element locators under different parents

I think I've just got that rubber-duck debugging effect and figured out one way to make it beautiful. We just need to move the menu into its own page object and re-use: var MenuPage = function (loca …
alecxe's user avatar
  • 11.4k
2 votes
Accepted

Selenium Python queston: How to extract the dynamic id generated?

I think you could use the contains() xpath function or the *=, ^=, $= family of CSS selectors to look up the desired element with the partial match on the id attribute and then extract the id attribut …
alecxe's user avatar
  • 11.4k
4 votes

Element should have been "select" but was "div" error

The problem is that your XPath expression matches a div element while Select class constructor expects a select element. This can be explained by the use of a wildcard * in your XPath expression. Or …
alecxe's user avatar
  • 11.4k
7 votes
Accepted

Selenium: unable to select drop down option one after another

I am getting below exception: Exception in thread "main" org.openqa.selenium.StaleElementReferenceException: stale element reference: element is not attached to the page document Okay, this one …
alecxe's user avatar
  • 11.4k
2 votes

Why we are not using .click(); for select class

The Select class just provides a convenient abstraction layer over the select and option elements. Internally, though, the selectBy* methods still do the proper clicking (source code reference): priv …
alecxe's user avatar
  • 11.4k
1 vote
Accepted

Python/Selenium automation email question

Just use the generated value instead of a hardcoded string. Extracting the email generation code into a function would also be a good idea: import string import random def generate_email(prefix='hu …
alecxe's user avatar
  • 11.4k
2 votes

Find anchor (has other html elements) with specific text

Using normalize-space() was a good idea but it would not handle   by definition. You can do two things: translate a non-breaking space entity into a regular space compare the full string value …
alecxe's user avatar
  • 11.4k
1 vote

Use selenium webdriver with customized web tags made with web components

There is no need to resolve the results of findElement() command - you can chain the findElement commands one by one: var customtag1 = driver.findElement(webdriver.By.css("customtag1")); var customta …
alecxe's user avatar
  • 11.4k
1 vote

how to wait until margin size changes

You can always create a custom Expected Condition to track the element location change. Something along these lines: WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10)); IWebEl …
alecxe's user avatar
  • 11.4k
4 votes

E2E test - Why does selenium shut down automatically after running the test?

When you are specifying seleniumServerJar and seleniumPort you are instructing protractor to take care of controlling a selenium server. Protractor would then start it as a child process before execut …
alecxe's user avatar
  • 11.4k
5 votes
Accepted

Selenium for angular - How to install and run Selenium for Angular E2E testing?

Let's first wrap our heads around the definitions: a lot of different languages have selenium bindings. And JavaScript is no exception - WebDriverJS are javascript selenium bindings - a selenium cli …
alecxe's user avatar
  • 11.4k
1 vote
Accepted

Element should have been 'select' but was 'li'

Judging by the error it looks like you are passing an li element instance to the Select() class constructor which expects select elements only. Since both the li and select have the same id value, yo …
alecxe's user avatar
  • 11.4k
4 votes

Matching multiple classes with an XPath expression

It's just that the case of the XPath operators matters. Change OR to or: //nobr/span[@class='green' or @class='red'][1] Note that it would probably a bit more reliable to look for this element in t …
alecxe's user avatar
  • 11.4k

15 30 50 per page