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
96 views

Headless Chrome browser won't switch to next window (Selenium + Python)

So I have a test case: When clicking a button a new window is opened. To switch to that new window I use: window_after = self.driver.window_handles[1] self.driver.switch_to.window(window_after) When ...
1
vote
1answer
58 views

Not able to verify the downloaded file with Chrome WebDriver running headless

We are trying to verify the downloaded file in headless mode with C#, the file is downloading but not saving in the download path, so my test script is failing. Any idea for this? The code is below ...
0
votes
1answer
15 views

how to disable inbuild adfilter using ChromeOptions [closed]

I need to perform various tests with Selenium where need to validate some elements, but the inbuild adFilter in Chrome chrome://settings/content/ads is interfering so I need an advice how to set is to ...
0
votes
1answer
107 views

How can I set the language of Safari and launch using Selenium?

I need to launch the Safari browser for automation with a specific language(Korean) for automation purpose. I am using selenium with python for automation. How can I do that ?
0
votes
1answer
172 views

Waiting for a scroll to be over

I have this function who scroll an element into view and then click on it: private void iClickOnElement(WebElement element){ WebDriverWait wait = new WebDriverWait(driver, 10); ...
0
votes
1answer
82 views

Why doesn't my XPath find my element on the page?

I am trying to retrieve the content of the header and each chapter which is a repetitive structure as you can see below. For this am using Selenium and C#. My attempt, using xpath, is this: string ...
2
votes
1answer
996 views

How to change the Selenium IDE file extension (.side file into java file) while saving the project

Currently, am I using the Selenium IDE in the Chrome. My projects are saving in the form of .side extension. Is there is any way to change this file as java file for selenium web driver.
2
votes
3answers
11k views

Using multiple instances of webDriver

I have defined an object of Web driver in one class as Static WebDriver driver; and want to use that instance in another class to automate the browser. Is it possible? Or will I have to define ...
0
votes
4answers
48 views

Not able to find the unique xpath for an element in expedia.com using Selenium

I am trying to find the unique xpath for elements in the "travelers" pop option in the home page of expedia.com When I give the following xpath "//div[contains(@class,'gcw-menu')]/div/div1/div2/div[4]...
0
votes
0answers
24 views

How do I click buttons on App which is installed on machine but not a Windows application. It opens a chrome instance (not default Chrome browser)

How do I navigate and click buttons on an already open Chrome instance/window. So the scenario is, that an application named "ApplicationNAME" is installed on my Windows machine, but its not a Windows ...
0
votes
1answer
40 views

How to read Text in a Tradingview Alert with Python and Selenium

After a very useful help here to login on trading view, i cannot figure out how to access to the text of this following alert and close it selecting OK here is the html code corresponding to that pop ...
0
votes
1answer
30 views

How to find path to filtervalue

Can you help me how to find a path to desired "filtervalue", such as value "Search in active documents"? As you can see in the picture, the class filtervalue is there multiple times. Thank you in ...
1
vote
1answer
34 views

how to get the window title name when its open in new window with document file

Scenario: after click on PDF buttton > new window open with document. Issue: when i used getTitle , its returned the previous page title Question : is it because the PDF page opens its not normal ...
0
votes
1answer
23 views

Automating a desktop app based on Chromium Embedded Framework using Selenium

Background: At work we are passing the --remote-debugging-port=9555 parameter to a CEF based desktop app and launching it using Runtime.getRuntime.exec("path to app"). Then, using selenium, we open an ...
-1
votes
0answers
18 views

Dynamic Calendar_Selenuim_Guru99_demo_Site

Please help me out with jave code used in selenium for testing of dynamic calendar (date picker is a JS widget). I have tried date picker and many more functions, but still I am unable to test the ...
0
votes
0answers
5 views

Protractor console logs when run with directConnect:True

When the config file is executed with directConnect:True flag , i am getting console logs that shows more errors about my angular application. When directconnect flag is removed , there is no warning ...
-2
votes
2answers
39 views

Login to TradingView using Python and Selenium

I am new in Selenium and i don't understand how how to find the way to add my email and password to trading view. I have tried the example shown to connect to facebook and worked fine, but in ...
1
vote
1answer
277 views

click getting to lower item(under dropdown) instead of dropdown in selenium

I m trying to click on the dropdown menu item and i am able to select the dropdown and the menu item but instead of clicking on item the click is going to the element right under it. Before the ...
0
votes
1answer
50 views

Odd behavior noticed during UI tests with Selenium

I want to ask you about the odd behavior I noticed when running multiple tests, using Visual studio, Selenium web-driver and Chrome browser. I have all the tests written as follows: sign in to the ...
1
vote
2answers
5k views

Selenium Testng, getting error Null Pointer exception

I'm using below code using Testng, getting error Null Pointer exception: public class Login_SF { public static WebDriver driver; String text; @BeforeTest public void Login() { System....
3
votes
1answer
260 views

Unable to open an .xlsx file with script in Selenium WebDriver- Getting InvalidFormatException

I have a script that requires an excel spreadsheet to be downloaded from a website and opened- ending in an assertion that a certain value exists or not on the spreadsheet. Getting the following ...
0
votes
1answer
187 views

Writing selenium tests againgst bootstrap Checkboxes

I have currently a big Problem to click on a Checkbox in a bootstrap designed GUI. In Html it appres like this: Does someone know how to press the Button of this checkbox? Because the controls are ...
0
votes
3answers
425 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
33 views

Webdriver setup error in Eclipse, Mac OS X Catalina

After upgrading Mac OS X to Catalina, I have been trying to execute a very basic script written in Java for Firefox in Eclipse IDE 2018. I've installed Gecko driver already through terminal and it's ...
0
votes
0answers
15 views

Unable to locate element using string Actualtext xpath [duplicate]

package Practice_KingAllProg; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class ...
0
votes
1answer
69 views

POM + PF on project with web and responsive mobile web

I am using Selenium POM (page object model) with PF (page factory) for various desktop web browser tests. I just started quest - testing responsive mobile web on real mobile devices. I already have ...
1
vote
2answers
62 views

CSS vs XPATH vs ID

Selecting an element with unique ID say "sign", which is the preferred method: By.id("sign"); By.xpath("//[@id="sign"]"); By.css('[id="sign"]'); Lets filter out xpath because By.id uses document....
0
votes
4answers
44 views

Save variable from java test class 1 and use variable in java test class 2

I have written the Selenium scripts (page object model) to navigate a website, fill in form data, and submit the form. I next need to verify that the form data was indeed saved in the database. My ...
0
votes
0answers
37 views

Unable to find the xpath [duplicate]

I am unable to find xpath for the below success message: WebElement successOverlayMsg = findElement(By.xpath("//*[text()='A new app overlay \"APAutomation_Merchant_M32XphDFc\" has been created ...
0
votes
0answers
27 views

How to apply a 'Loop' to map the row element where XPath changes whenever page get's loaded [duplicate]

How to map on to a particular row element say " NCC "where the number of the row containing that element changes whenever page get's loaded. Reference website-guru99 for(int i=0;i<19;i++) ...
4
votes
6answers
8k views

How to run same test case of testng on 100 different URL/Domain?

I have one difficult scenario for automation testing. I want to run one test cases for 100 different URLs/Domain. Precondition : Script is generalize and running individuality properly. Use of ...
0
votes
0answers
33 views

Get list of all hover menus and and their all nested hover menus using selenium

@Test public void MedicineList() throws InterruptedException { driver.get(sitedata.getProperty("Medication_url")); WebElement mainmenu = isElementPresentt("dog_xpath"); ...
7
votes
3answers
1k views

What to look for in code reviews / pull requests?

Are there any standard set of things that one should look for during Code Reviews / Pull Requests ? Are there also particular ones for automation vs application code and/or for UI automation (using ...
2
votes
1answer
102 views

Selenium's execution time increases if a web element is absent on a web page

I have a table on my web page I am trying to automation that contains x number of rows (tr)s and under each (tr), there are a varying number of (td)s. In my flow, I have to check for the existence of ...
8
votes
11answers
81k views

Selenium test case fails due to page load time

I run nearly 30-40 test cases twice a day. And everytime some test case fails due to page load time. Infact i have explicitly mentioned Thread.sleep("2000"); wherever i feel it takes more time to load....
0
votes
2answers
20 views

detect new element in html using selenium, python

is it possible to detect in selenium, that new dynamic element added in html msg_box = driver.find_element_by_class_name('_3u328') msg_box.send_keys('---') button = driver....
0
votes
7answers
98 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
4answers
68 views

Locate Element using selenium

I am trying to locate an element to click in order to Sign In , not able to succeed. I tried the below steps, Click Element class=mat-raised-button mat-accent Click Element class=mat-focus-...
0
votes
3answers
78 views

Unable to click on 'sign out' link

I am trying to click on sign out link, but not able to succeed: I tried the below ways, Click Element class=mat-icon.notranslate.mat-primary.material-icons Click Button name=Sign Out Click ...
1
vote
3answers
57 views

What is the use of Maven in Selenium WebDriver Automation Project?

Do we use Maven only to create dependencies in pom.xml file? Isn't there any other use of Maven in selenium project?
1
vote
2answers
64 views

How can I get this 'Version: 0.1.0 - 94" value from the <div> tag in selenium webdriver?

How can I get this Version: 0.1.0 - 94 value from the <div> tag in selenium webdriver? and here is my code: <div _ngcontent-qbk-c3="" style="text-align: center;">Version: 0.1.0 - 94</...
-3
votes
3answers
47 views

what is the difference between //span and //*?

I am learning selenium Xpath. what are the different ways of Xpath ? what is the difference between //span and//*?
0
votes
1answer
46 views

Selenium: Capture DOM Elements Image

I have an API to capture the image of a particular element in DOM and return them. For that, I have a list of WebElements which needs to be captured into a single webpage. For that same, I have found ...
4
votes
3answers
12k views

Order of execution for Tests in TestNg, If Priority set only for few Test Methods

I have three methods as mentioned below, two with priority ( 0 , 1 ) and third method(Test) with no priority attribute. What is the order of execution. Code snippet given below.. @Test(priority = 1) ...
0
votes
1answer
46 views

Issue in displaying webpage in IE11 in selenium webdriver

I am able to input the username, the password, and then click on the login button, but after clicking on the login button it displays nothing on webpage in IE11 but works fine with Chrome and Firefox. ...
1
vote
1answer
57 views

Keyboard ArrowDown in listbox using Selenium with C#

I'm working in selenium c# automation, I'm trying to traverse down in list box values. <ul> and <li>. I have tried many options in trial and error. The kind of code I'm trying to use is ...
0
votes
1answer
80 views

How to run my selenium runnable jar in a different machine without driver files

I am trying to export my project as a runnable jar and run it without driver.exe files being present. I tried incorporating them with below code to make it independent but still unable to run the jar ...
0
votes
3answers
97 views

Exception in thread “main” java.lang.IllegalStateException: The driver executable does not exist: C:\Selenium\chromedriver_win32.exe

package com.selenium; import org.openqa.selenium.*; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class MySelenium { public static void main(String[...
22
votes
8answers
391k views

How to find element using contains in xpath

Can anyone please help me how to use contains in my xpath? My xpath changes all the time when users are added, so I can't find element using xpath. This is my xpath: .//*[@id='contentText']/table/...