Questions tagged [selenium-webdriver]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
54 views

Unable to launch Firefox driver using selenium

I'm getting error like Exception in thread main java. NoClassDefFoundError:com/google/common/collect/immutableMap and above are the full screen shots:
0
votes
1answer
27 views

How can my mac be setup to run both appium/selenium with java and python without conflict?

How can my mac be setup to run both Appium/Selenium with java and python without conflict? Are there steps I should take and things I should avoid? What things should I look out for? My mac is setup ...
0
votes
1answer
313 views

Switching to webview fail in Android on Mac OS

I have a problem while switching from native view to webview in Android while testing on MAC OS. But the same scripts works fine in windows. In Mac it gives chrome not reachable as a webdriver ...
15
votes
6answers
24k views

Which locator do you use with Selenium: CSS or XPath?

I have heard that, when using Selenium, the CSS Locator has better performance than the XPath Locator. Which Locator do you use in your tests? Have you seen a great performance improvement when ...
1
vote
2answers
7k views

How to test angularJS search dropdown with Selenium

I am trying to select an option from a drop-down search box as shown below: The HTML of the element is below: <div id="select2-drop-mask" class="select2-drop-mask" style=""></div> &...
0
votes
1answer
51 views

How to keep a single browser window open during multiple search for a website in the code?

I want to search for different items in a website multiple times and add the item to cart after each search and proceed to checkout after last search. Cucumber opens the new browser for every row in ...
0
votes
1answer
61 views

Add XPath parameter dynamically in Selenium

Is it possible in Selenium to add an XPath parameter dynamically? I have following code: @FindBy(how = How.XPATH, using = "//div[@class='boxes']") public List<WebElement> boxes; String ...
1
vote
3answers
2k views

How to resolve NoSuchElementException in Selenium with java?

CODE: driver.findElement(By.name("USER")).sendKeys("XYZ"); driver.findElement(By.name("PASSWORD")).sendKeys("abc"); I have tried various ways not just name but by xpath, css selectors but every time ...
0
votes
2answers
438 views

Need to get the current geolocation value through selenium webdriver

In one of my requirements the current geolocation of the customer will be displayed in a text box by default while loading site. I need to get the geolocation value displayed in the text box, and the ...
0
votes
1answer
66 views

TestScript run time error NullPointerException

I am new to Selenium, when I am working with Page object model in the execution time system displays "java.lang.NullPointerException".Here I am going to provide the sample code TestUtil@class public ...
1
vote
1answer
756 views

Trying to get background color

When I'm trying to get bgcolor using xpath I'm not getting the actual color. HTML Code <div class="__title">Preferred 2:1 </div> Selenium code: String bgColor=New_AEMLocators....
4
votes
1answer
388 views

How to control CEF3 portions of .NET project using Webdriver2?

We have a very large .NET project. This has been E2E/regression tested using QTP for 3 years. Eventually our AUT is moving to the WEB. This process is expected to take a couple of years, it will be ...
1
vote
1answer
70 views

How to add row elements in selenium?

I want to add today's count. I am new to selenium, and am not getting how to add using selenium. Can anyone suggest a solution? This is my code: package testpk; import org.openqa.selenium.By; ...
0
votes
2answers
65 views

Unable to get the correct value from the table using css selector in selenium

I am trying to get the value displayed against the Total using the below code: driver.get("https://www.cricbuzz.com/live-cricket-scorecard/20137/sl-vs-eng-4th-odi-england-tour-of-sri-lanka-2018"); ...
1
vote
1answer
675 views

Switching to Webview context fails

I was trying to automate tests for a hybrid app, while switching, it only shows name native context. WebView Context is shown as webview_undefined. Set<String> contextNames = driver....
1
vote
1answer
2k views

Unable to find element for a button in angular application through selenium webdriver [closed]

<span ng-click="addReqPage()" class=" wrapper-xs text-center cursor-pointer" tooltip-placement="bottom" data-toggle="tooltip" tooltip="Add Specification"> <!-- ngIf: ...
0
votes
1answer
749 views

Exception in thread “main” org.openqa.selenium.NoSuchElementException: Unable to find element with css selector ==

When I am trying to run the below mentioned Selenium web driver code in IE 11 browser , I get below error "Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to find ...
3
votes
2answers
9k views

How to check if a file is downloaded using protractor selenium?

This is the path capabilities: { 'browserName': 'chrome', 'chromeOptions': { prefs: { download: { 'prompt_for_download': false, ...
1
vote
1answer
24 views

How to implement seleniums LoadableComponent with a fluent API?

How do we implement LoadableComponent when we have a fluent api, lets create a basic set of classes, shown below: public class LoginPage { // @FindBy locators public DashboardPage login(...
0
votes
1answer
837 views

Selenium script on Pega Platform application behaves weird

I have identified web elements uniquely using customized xpath //table[@pl_prop_class='SOM-FW-PayMaineFW-Data-ProductGroup']/tbody/tr/th[1]/div/div/div[1] But, when I run the test script and ...
3
votes
3answers
9k views

How to handle windows authentication pop up with Protractor?

Use case: When URL loads, it request for Windows authentication (Enter Username and Password). How it goes is: loads the url on clicking Post button in the page. Windows Authentication pops up ...
1
vote
3answers
55 views

Selenium WebDriver Java: not able to select a value from a drop-down list

I'm trying to select an option from a drop-down list, and I'm not able using the common methods of the Select class. I also tried the selectByVisibleName and selectByValue and same result. Select ...
1
vote
0answers
31 views

Issue with parallel testing in pytest

So I have two test cases in a map. From command prompt I type "pytest -n 2" then hit Enter. Instead of opening two browsers and execute them in parallel, pytest is opening 4 browsers, but only two of ...
0
votes
2answers
4k views

Firefox browser opens but URL is not launched

I am working on selenium. I am using linux os. I am using firefox driver for automated testing my app. My firefox version is 53.0.3 (64 bit). When I run the code the Firefox browser open and don't ...
0
votes
2answers
97 views

Does One single script can automate entire matches?

I am automating my windows application. My applications are sports related reporter software. In baseball reporter application i will do testing by the following way : I do enter the commentary from ...
0
votes
2answers
213 views

Selenium can't locate element by xpath

I am using Selenium and attempting to locate an element (table cell in a web app) by xpath. However, I am getting a NoSuchElementException when running my test cases. I am positive that the xpath ...
0
votes
6answers
27k views

How to store copied text to a string in selenium webdriver

driver.findElement(By.xpath("//*[@id='printshapesEdit-main']/div/div[2]/div/div[2]/input")).sendKeys(Keys.chord(Keys.CONTROL, "v")); For the above code, I would like to retrieve the copied text to a ...
-1
votes
1answer
30 views

Can I use this library for Junit?

I put this library: import org.apache.commons.io.FileUtils; but it sends an error The import org.apache.commons.io cannot be resolved what library is equivalent exist for Junit?
1
vote
3answers
575 views

While clicking control should go to the new window

When clicked on a button, a new window opened but I am unable to perform any operation on this window. How do I get selenium to use the new window? code: System.setProperty("webdriver.gecko....
0
votes
2answers
50 views

How do I click on an element available in a specific row where dynamic row is added?

In the below pic, I need to click on the icon in a row which is newly added and column1 value is stored as global variables. Have used the below code, unable to find a solution. WebElement ...
1
vote
1answer
328 views

CLEAR Method skipped while running the tests

I'm writing automation script for a page in which there is a text box. The scenario is as follows: I click on the text box and enter value which will throw error I clear the text box and add valid ...
4
votes
2answers
2k views

Getting Unknown error While Using latest Verison of Selenium With Microsoft Edge Browser

My Code to launch Browser: System.setProperty("webdriver.edge.driver", "C:\\selenium-drivers\\MicrosoftWebDriver.exe"); DesiredCapabilities capabilities = new DesiredCapabilities("MicrosoftEdge", "", ...
0
votes
2answers
352 views

Selenium cannot load reply button on craigslist ad. It seems to be recaptcha problem

When I try to click on the reply button using selenium in craigslist.org It doesn't open anything, it just gives an error like "Error please try again later". If i'm opening the same craigslist's ad ...
0
votes
3answers
607 views

Unable to switch into third window - Selenium

I'm using below code to switch into windows : Set<String> handle=driver.getWindowHandles(); System.out.println(handle); Iterator<String> it=handle.iterator(); String ...
0
votes
2answers
912 views

Use Selenium to select an option from an Input element with multi-select drop-down

I am getting this error message when trying to select a drop-down value: UnexpectedTagNameException with message 'Element should have been "select" but was "input" error' The Error is descriptive ...
0
votes
1answer
207 views

Why is there different behavior of a Web Application with Automation and with Manual?

I am automating a website, there's web page containing few text fields, dropdowns. There is a mandatory field check for a dropdown, if I select the default option (which is 'Select') I get an error ...
3
votes
2answers
1k views

Headless Selenium Failing for Ajax Calls

How do you troubleshoot an Ajax call that never seems to complete in Selenium running in a headless environment? I'm running Selenium 3.0.1 from a Django unittest to confirm content gets dynamically ...
2
votes
2answers
5k views

java.lang.NullPointerException when running a testcase via Selenium webDriver in Chrome (Page factory model)

I'm getting a java.lang.NullPointerException when running a test case via Selenium webDriver in Chrome (Page factory model) Testcase: package Google; import org.openqa.selenium.WebDriver; import ...
4
votes
1answer
20k views

how to handle if xpath is same for multiple drop down

I have a situation where i had to handle drop down and click the drop down to select some values. There are two drop down in same page and both has same xpath. The Xpath is giving below. //div[@name=...
1
vote
2answers
8k views

Check Box check and Uncheck using selenium web driver

I am not able to list out the check boxes which are checked and unchecked.the checkboxes are placed in the div tags. And only class name is generated dynamically when the check box is clicked. ...
3
votes
1answer
4k views

How to get coordinates of element inside iframe?

If driver switched to iframe, selenium would take screenshot of iframe content only (EDIT: this is because of bug in gecko driver). I need to mask an element from screenshot, but if I find area by ...
0
votes
1answer
1k views

Selenium Webdriver Java: Setting date on date-picker. Year is not populating in date-picker

I am automating a signup form for web application and there is a date of birth field which has date-picker on it. I am sending values in it by using sendKeys and the problem is that Year is not ...
0
votes
1answer
444 views

How to inspect a element in a drop down menu in chrome and firefox?

The problem here is when we hover the mouse over the particular menu item, drop down items going to visible. When trying to click the inspect element the drop down items are not going to be visible. ...
3
votes
1answer
171 views

Page Object Model: need help with tests that uses more than 1 page object - Appium-Java-TestNG

I have a framework based on POM model. I am able to write test that only uses elements from 1 page but when I need to access elements from another page tests fail because I think it uses the wrong ...
2
votes
1answer
121 views

How can I verify text exist within a table with db using Selenium WebDriver?

Using selenium Webdriver+Java- I am looking for a way to identify and or verify a value in a table. There are more columns in the table, but I am only concerned with the Country column, Also the ...
0
votes
2answers
3k views

Can't find any element using CSS selector with Selenium on Python

I'm running a script on vodafone.co.uk but I can't find any element using the CSS Selector. browser.get("http://freesim.vodafone.co.uk/") browser.find_element_by_css_selector("#frmNew > div:nth-...