Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [selenium-webdriver]

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

1
vote
2answers
42 views
1
vote
3answers
257 views

How to accept Alert message in Selenium Java

I tried driver.switchTo().alert().accept(); but still i am unable to accept the alert message. please let me know the code to accept below message. enclosed screenshot of message and XML
2
votes
3answers
970 views

How to get Selenium 3.0.1 to work on a Mac with IntelliJ

I am using a Mac as well as IntelliJ. I am trying to update Selenium from 2.53 as the website I am testing has functions that no longer work with older versions of Firefox (version 46). I am trying to ...
0
votes
2answers
50 views

How to get XPath for the text after the <b> tags

I Need to get XPath for the following, to get the text after the <b> tags <li class="SpacedOut"> <b>Name 6:</b> "ABC" <b>Name 1:</b> "BCD" <b>Name ...
0
votes
1answer
245 views

How to pass data from XML file in Selenium?

How to pass data from XML file into application and I'm using page object model with page factory. Code: public class LoginPage extends BaseClass { @FindBy(id="EmailAddress") WebElement ...
1
vote
1answer
105 views

Scraping through selenium : unable to locate element

After feeding the search bar with "Safety" keyword, I am trying to get to the page associated with this link_text. But error unable to find element is coming. from selenium import webdriver import ...
0
votes
1answer
49 views

How To do update/edit on selenium script got in JAR file format from other location

I have a Runnable JAR file of selenium script forwarded from other location, now I want to use that same script for my project with some minor updates. How to do that? Can we open that in Eclipse and ...
0
votes
1answer
47 views

I am unable to identify element of edit text in table

I am unable to identify element. please find my below code. WebElement editorFrame = dr.findElement(By.id("1536219451331-0-uiGrid-000L-cell"));
3
votes
3answers
14k views

How to automate an autocomplete search text box?

I am working in Selenium. I'm using Java language. I am following page object design pattern. I want to automate an autocomplete search test box. After entering a single character or multiple ...
0
votes
0answers
11 views

Error shown when trying to put dropdown list values onto Excel sheet using Selenium WebDriver & Apache POI

Scenario :- I have an HTML File that contains a drop down list containing some values in it. I need to add the values of dropdown list onto Excel sheet using Selenium Apache POI. I have written ...
0
votes
1answer
44 views

Issue using xpath

I'm having an issue. I'm using Selenium and PyCharm. Website: https://www.expedia.com/ I'm trying to click() on the "Search" button. I used these: driver.find_element(By.ID, "search-button-hp-...
0
votes
1answer
38 views

How I can calculate the sum of items that are stored in main Id and then sub_id in that main Id

Look at the image here you can see the Dom that how its showing one main div with ID and then item are there in that div. I have to calculate all the items on a page that are shown to user. These ...
1
vote
0answers
27 views

Is there an argument for chromedriver to accept notifications?

I am using Nightwatch to run my chromedriver, and I need to accept notifications through the browser. I have found this list of chromedriver arguments, but I haven't been able to find any that ...
-1
votes
1answer
39 views

How can I close alert message by enter action through keyboard?

I'm looking for a different way to close an alert message other than accept() or dismiss() methods. How can I close an alert message by entering action through the keyboard?
-1
votes
2answers
40 views

Either its possible to get and show a value from front end in selenium Java. If so, then how I can do this

I am testing a website and I need to perform some action on the basis of Price. It is showing price in Remaining Budget. I want to check the remaining budget and then on the basis of it want to ...
0
votes
0answers
18 views

Extent Report : [TestNG] Reporter x.x.ExtentReportListener.ExtentReport@afc191 failed java.lang.NullPointerException

Getting nullPointer exception in extent report . Help me on this issue unable to trace the root cause Using extent report 2.41.0 Here is the my log: [TestNG] Reporter com.psiexams.base....
1
vote
3answers
1k views

Python selenium grid parallel execution

How do I run parallel selenium scraper in grid? I wanted to crawl 10 urls , and if I start two Firefox nodes, how do I request the nodes to crawl 5 urls in parallel? I have gone through google, but ...
3
votes
2answers
3k views

Fetch all the links on a page that are within the same class

Quick Links <span class="buttonContainer"><input type="image" class="helpButton" src="/images/buttons/btn_help.gif" alt="View help." title="View help."><input type="image"...
1
vote
2answers
285 views

How to drag an element and drop it in another frame?

Hope you doing well, I'm trying to dragAndDrop an element from FrameOne to FrameTwo but not able to do so.Please help me to understand the concept and what I'm doing wrong here and need to achieve ...
0
votes
1answer
56 views

Selenium WebDriver “Cannot instantiate class ” error is coming

Below is my Base Class: package com.mercury.qa.base; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Properties; import java.util....
10
votes
8answers
30k views

WebDriver Clicking button issue in IE 11

Have a suite of web-drivers tests that run in chrome and IE 10, but will not run in IE 11. The tests fail in IE-11 when clicking a button as the following action (a form popup) does not occur. I ...
0
votes
1answer
28 views

Capture arguments of onclick() javascript call using Selenium Java

I am writing a selenium script in Java to capture the arguments passed in JavaScript onclick() call/method. Attached is the image in which method/function name is highlighted. Now, In this method ...
1
vote
2answers
87 views

Python Selenium unable to login by clicking on Button inside a form

website:https://www.etoro.com/login <button automation-id="login-sts-btn-sign-in" ng-click="loginCtrl.login(loginForm)" class="e-btn-big wide dark pointer">Sign in</button> I am trying ...
0
votes
2answers
269 views

Getting row count of HTML table always returns 1?

I wish to grab an HTML table and extract the number of rows it has. I stumbled upon a solution linked here link. However, the proposed solution always returns row count of 1. I've alswo tried the ...
1
vote
2answers
80 views

Using Fluent Wait When Finding List WebElements

I have a fluent wait class that works pretty well for locating my page elements, however, when I am locating elements for lists I don't appear to be using the same wait. I currently need to add ...
2
votes
2answers
169 views

How to Select a value from Dropdown using Selenium WebDriver (Java) having input and div but not select tag?

I am trying to select a value from a dropdown. When I inspect that dropdown, I cannot see the select Tag, instead it was designed with combination of input and div tags. Can anyone suggest a way how ...
0
votes
1answer
39 views

How to close this dialog

This is the code for an opening specific page and after that popup appear which I am unable to handle. I have used alert, switchTo, etc.. //Open Browser WebDriver driver = new ChromeDriver(); //...
0
votes
1answer
37 views

How can I turn a list of assertions into a table? C#/Specflow Selenium

I am very new to using C#/Specflow to write tests so thank you for the patience. I have a test that ends like this: Then the Details page should display the rating zip code And the Details page ...
1
vote
1answer
37 views

Selenium | Locate elements via custom attribute

I'm new to test automation with Selenium (Python) and just wondering if it makes sense to locate elements on webpages via a custom attribute? In some places the IDs of the elements are generated and ...
2
votes
3answers
61 views

How to validate that an object (whose locator we don't know since it is not present) is not present in a page

Let's say I want to verify that an upload button is not present in a page. I cannot use any locator here since I don't know the object locator value. So how do I assert in my test that it is never ...
2
votes
2answers
59 views

if/else condition is not working as expected

WebElement radio= driver.findElement(By.xpath("//[@id=\"mydiv\"]/form/div[1]/div[3]/label")); if (radio.isSelected()){ Thread.sleep(2000); driver.findElement(By.xpath("//*[@id=\"mydiv\"]/form/...
0
votes
1answer
35 views

Java Null pointer exception when trying to click on an element that is present in a block and becomes visible when another element is clicked

I am trying to click on an element which is present in a block and the block itself becomes visible when another element "Your Trips" is clicked on. I am able to find the element and click on Your ...
1
vote
1answer
20 views

Selenium WebDriver gives the same window handle across multiple Firefox browser sessions

We use different profiles to test different features of our system. If we open new multiple FF sessions (each with it's own profile), Selenium Webdriver only uses 1 window handle identifier. (pseudo ...
0
votes
2answers
33 views

How can we run only selected testcases from extent.html report in selenium webdriver?

I'am running testng suite and then extent.html report is being generated. Now I want to customize my report like; i should be able to select only failed testcases in my report and then should be able ...
6
votes
4answers
8k views

Selenium Webdriver faster way to fill textboxes than Sendkeys()

So i have multiple textboxes i need to fill and Sendkeys() takes a lot of time, is there a faster way to fill textboxes in selenium?
5
votes
3answers
725 views

How to design automation framework when the app to be tested has 500 web pages?

I have a web application which has around 500 pages. Can we use POM framework and if so, is it a good practice? if not, please suggest some ideas.
5
votes
7answers
10k views

Enable Flash player on Chrome 62 while running selenium test

I noticed that starting Chrome 62, chrome disables Flash player by default. I wrote a simple selenium test to visit : https://helpx.adobe.com/flash-player.html and noticed that it does not enable ...
0
votes
1answer
35 views

What is the best approach to manage Precondition for set of tests

Lets say I have a set of tests which depends on a precondition. Should I automate the precondition or manually perform the precondition data? If I automate the precondition test and execute them ...
0
votes
1answer
30 views

Why can't resolve NaN in Selenium script?

I have recorded some functions using Selenium IDE and exported test into java file. I have used "wait for element visible" condition when performing action in order to assert a notification. ...
2
votes
2answers
20k views

How to use Run Keyword IF" in Robot Framework

I want to run Keyword if Element is visible. E.g I want to check that if a button is visible on the page then run particular Keyword. Below is my code. Create button is Keyword and want to run if ...
0
votes
1answer
243 views

“org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally” issue on jenkins(openshift) chrome node

I've been trying to run selenium codes over Jenkins (server/openshift). There is chrome node in the jenkins machine for Test Automation - Selenium. I'm getting this error: org.openqa.selenium....
2
votes
2answers
29k views

Verifying if an image Is displayed on a webpage

I have read that there is no "sure shot" way of knowing that an image is loaded or displayed on a webpage using Selenium. I want to know the reason behind it, as to why this is completely not possible....
0
votes
2answers
23 views

How to use assertion to compare both different size of the rows?

I want both size of the rows shouldn't be matched. int firstnum = 0; List<WebElement> preRoutlList = driver.findElements(By.xpath("//*[@id='txBottomTable']/table/tbody/tr")); ...
0
votes
2answers
2k views
0
votes
1answer
27 views

How to read data from JSON file , Then Pass these values on web application form with the help of Xpath Locators and Then Write it in Excel file?

Steps : Can you suggest the approach or share some sample script 1.Read data from JSON file - Method to Provide Data (JsonReader.getdata) - Get file location & File Name 2.In @Test(...
0
votes
2answers
6k views

Clicking a cell in a dynamic data table C# WebDriver

The HTML I'm trying working with is below, <div id="enquiry-header-grid-SalesTransactionEnquiry-enquiry-header-grid-wrapper" class="enquiry-kendo-grid-wrapper k-grid k-widget" data-role="grid" ...
0
votes
1answer
19 views

Adding Chrome extension in Selenium / Python / Ubuntu

I am having problems in adding extensions in Chrome before Selenium tests, using Python. On the code side, it's pretty simple: options = Options() options.add_extension(/path/to/extension) webdriver....