Questions tagged [selenium-webdriver]

Selenium WebDriver offers a versatile WebDriver API that allows developers to manipulate web browsers using various programming languages. Make sure to include a tag for the specific programming language you are utilizing.

Currently, I am utilizing Selenium-webdriver and require the capability to choose an element based on its textual content

Having an issue with finding an element using the current xpath and need a dynamic solution. public void selectCheckBox(WebElement wrapper, String value) { scrollTo(wrapper); String xpath = ".//label[span/text()='" + value + "& ...

In order to locate the xpath for the language dropdown menu on the Google sign-in page

Dropdown button on Signin page When the dropdown button is clicked, a list of languages is displayed. I am trying to store these languages in a list and then iterate through them using a for loop to select one. I have attempted various methods to create ...

Guide to verifying input text using Selenium WebDriver in Python

Recently, I've delved into the world of automated testing and am a bit stuck on how to assert input text using Selenium WebDriver in Python. Can anyone provide guidance? I've included my code below, but it seems to be malfunctioning: def assert_ ...

The Pylance tool reported that the import statement for "selenium" could not be resolved in the code

While editing a file in VS code, I encountered an error message stating: Import "selenium" could not be resolved Pylance (reportMissingImports). Below is the code snippet from metachar: # Coded and based by METACHAR/Edited and modified for Micro ...

I am looking to implement webdriverwait for an element that is not currently visible in the DOM

After successfully adding an appointment in my script, a tooltip appears at the top of the screen with the message "Saved Successfully." I have attempted to assert this text using Thread.sleep(3000);, but my script only succeeds sometimes and not consist ...

What is the best way to delay until text is visible within an element?

Could I potentially delay action until the appearance of an element, as indicated by the text within the STRONG section below? The content in question consistently changes based on specific triggers. <div class="alert message alert-success alert-da ...

Issue encountered when running Python scripts using Selenium

I have set up python, pip, and selenium on my computer and I am currently running a sample code on some basic websites. Code: from selenium import webdriver import time driver = webdriver.Chrome("C:\\Users\\skandregula\\Py ...

Is it possible to target a specific element within one of two classes that share the same name using CSS or XPath in Webdriver.IO?

Currently, I am using Webdriver.io and facing a challenge in selecting an element within the "text-fields-container" class. This particular element happens to be a password field, and both classes share the same name. Can someone guide me on how to go abou ...

Encountering a java.lang.StackOverflowError when executing a class as a TestNG Test in Selenium

This project serves as a demonstration, utilizing the Page Object Pattern and Data-driven framework for implementation. Within this project, concepts of inheritance and constructors are applied. The configuration file config.prpoerties contains details s ...

What is the correct way to implement a variable in xpath with Selenium WebDriver using Java?

How can I incorporate variables into XPath while using Selenium WebDriver with Java? Below is the snippet of my code: for(int row =1; row<=20; row++) { driver.findElement(By.xpath(“//*[text()=’PickRequest’]/table/tbody/tr[+row+]/td[2] ...

The RemoteWebDriver is currently unable to upload the file

Having trouble uploading a file on a demo site using RemoteWebDriver? You’ve successfully done it with the regular WebDriver driver, but now facing issues with RemoteWebDriver. The exception thrown is :"org.openqa.selenium.WebDriverException: Settin ...

Trouble with clicking the button in Selenium Webdriver? Element located but unable to be clicked

Can anyone assist me in finding a solution to my current problem? I have dedicated a significant portion of today trying various solutions both on this platform and through Google. To get straight to the point, I am facing an issue with Selenium automatio ...

Tips for integrating the Brave browser with Selenium on Catalina

I came across this example for using the brave browser on Windows. I'm wondering if it would also work on Catalina just by updating the driver_path and brave_path? Additionally, as Chromedriver is specifically for Chrome, how can one determine the appropr ...

Using JAVA to leverage the power of Selenium WebDriver

**I keep encountering the error message Exception in thread "main" java.lang.NullPointerException when running this code. Can someone assist me with resolving it? package Solutions; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; i ...

Discovering parent elements with Selenium C# WebDriver: A straightforward guide

Is there a way to retrieve the parent elements of a By class object after calling the FindElements method? ...

Is it possible to reuse a WebDriverWait instance?

When working with a page object that interacts with various elements on the DOM, is it better to create a single instance of WebDriverWait on initialization and use it for all waits? Or should separate instances be created for each element being waited on? ...

Experiencing a NullPointerException error while attempting to utilize FindElements for scanning and accessing all elements in

I am new to using selenium-cucumber and facing an issue with a Null pointer exception when trying to automate a web application. I have created page objects and used findelements to retrieve elements, which is causing the error. Any insights on this probl ...

What is your perspective on utilizing the Chrome Webdriver in conjunction with Selenium?

After following the steps to set up Chrome requirements for selenium.webdriver.Chrome, I implemented the code provided in this Stack Overflow post on Running webdriver chrome with Selenium: import os from selenium import webdriver from pyvirtualdisplay im ...

Capturing screenshots of error pages using Selenium WebDriver

I am currently facing an issue where I encounter the same error page upon clicking various buttons on my website. To track this issue, I want to capture screenshots of this error page each time it appears, along with identifying which specific link trigger ...

What is the best way to locate an element using xpath?

I've been on the hunt for a "button" to click, but unfortunately it doesn't have an id attached to it. No matter what I try - Xpath or cssSelector - nothing seems to work. Here are the elements of this elusive button: div style="cursor: grabbing ...

Encountering a NoSuchDriverException while attempting to utilize Selenium with Microsoft Edge

I've been attempting to extract data using Selenium on Microsoft Edge, but I keep encountering this error message. PS C:\Users\Queensley\Desktop\hustle> python Python 3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD6 ...

"Instantiate" a class based on a given string name and retrieve the field values by using the string name

I have managed to retrieve the values of a List field from another class using reflection. However, I am facing an issue when trying to use it if the field is of type List. Below is my current code snippet: class PageModel { @FindAll({ @FindBy(xpath ...

Where is the close window button located in Selenium for automation purposes?

I am currently facing an issue with automating messages on LinkedIn. Specifically, I am struggling to close the chat window using Selenium. Can someone guide me through fixing this problem? This is my first attempt at using Selenium and any help would be g ...

Optimizing Google e2e testing using Protractor

Improving login efficiency is necessary to enhance the speed of executing e2e tests. At present, after every test, the Chrome browser shuts down, requiring a new login session for each subsequent test. What changes can be made to address this issue? Any ...

What is the solution for the "WebDriverException: Message: Failed to decode response from Marionette" error when using Selenium?

I encountered an issue while attempting to create a basic selenium script, despite using geckodriver 0.34, firefox 122.0.1, python 3.8.10, and Selenium 4.17.2. Here's my code: from selenium import webdriver from selenium.webdriver import FirefoxOptions ...

Can Selenium provide me with a numerical value?

I recently started using Selenium and I've encountered a problem. The solution is probably simple, but I haven't been able to find it anywhere. When I attempt to locate an element with the code below: options = Options() options.binary_location="C:P ...

Exploring the Differences Between Selenium-Webdriver with Java and TestNG versus Ruby

Currently, I have an automation suite using selenium-webdriver in Ruby with TestUnit. However, I have noticed that Java offers TestNg, which comes with many additional features. I am considering switching all my suites to Java and TestNg, but I also wond ...

Engaging with website components that modify HTML content values

I'm using Selenium to automate the process of clicking through parking garage markers on the website http://seattle.bestparking.com/. The goal is to open the pop-up info window for each marker and then extract information from the "rate" page in the pop-up ...

Guide on utilizing "selenium-webdriver-xpath" for extracting the text content from <td> tags?

Locate the following snippet of HTML code: <table id="supplier_list_data" cellspacing="1" cellpadding="0" class="data"> <tr class="rowLight"> <td class="extraWidthSmall"> <a href="/aems/do.list"> Cdata </a> ...

Navigating through the information stored in a spreadsheet using Selenium/data

I am currently in the process of automating a web page where data is being entered from a spreadsheet, including information like name and date of birth. I have successfully implemented the automation for a single record in the spreadsheet. However, I am f ...

Guide to randomizing a collection of URLs and implementing it with the Webdriver

Looking to extract Href links from a website and shuffle them, then iterate through each line in the list to scrape each webpage using Selenium in Python. I have come across information on how to do this with a notepad file, but I am looking for guidance o ...

The element cannot be located by Selenium using either the ID or xpath

As I dive into the world of web automation using Selenium with Python, I encounter some challenges when trying to log in to a specific website for the first time. Despite practicing with simple examples and going through the Selenium documentation, things ...

Python3 Selenium - Issue encountered while retrieving the text value from an element on an HTML webpage (web scraping)

On a website, I am working with the HTML code below to extract the number of jobs from a table: <span class="k-pager-info k-label">1 - 10 of 16 items</span> Although I can locate the element successfully through different methods, wh ...

Unable to retrieve the value from an "input" element

Currently, I am utilizing Selenium with Java to create a test. My task involves retrieving the text from inside an input element: <table class="boundaryFormAdd"> <tbody> <tr> <td> <input id="id ...

Locate element using value in Selenium with Python

Currently, I am utilizing Selenium in conjunction with Python to autonomously extract data from various power plants. One challenge I am facing is the need to click on an element within each plant's unique interface. The difficulty lies in the fact th ...

I need to know how to output a list of URLs from a webpage using Selenium chrome driver in C# to the console. Can you help

I am trying to achieve the task of printing all URLs in a specific location on a website to the console. While I have managed to extract the text of all the links, I am struggling with obtaining the actual URLs. Since I am new to coding, any assistance w ...

Issues with Firefox Protractor testing functionality

Trying to test a protractor on an angularjs application using Firefox 47 has been unsuccessful. Attempted downgrading to version 46.0.1 after researching on Stack Overflow, but still facing issues. Has anyone discovered a working solution for this? It seem ...

Firepath is able to provide the absolute path, however, we require the relative path instead

Having trouble with the xpath while using firepath. When I try to select a web element using fire path, it generates xpath like html/body/div[1]/div/div[2]/div/form/fieldset/p/input which does not properly select the element. Previously, the xpath generat ...

Tips for Verifying Success and Error Messages from a Login Form with Selenium Automation Testing

The code snippet provided below demonstrates how to perform a G-mail login using Selenium WebDriver. package gmail_Login; import java.util.concurrent.TimeUnit; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.openqa.selen ...

I'm currently attempting to loop through rows in an HTML table using Selenium with Python, but I'm encountering an "Index out of range

I am currently working on a webpage that contains an HTML table with various columns and rows. Users have the ability to select a specific row and then use the delete button to remove it from the table. For example, if there is a value "Testa" in the Name ...

Steps to effortlessly retrieve a CSV file using Selenium without dealing with the bothersome file dialog

I've been attempting to access a URL with a CSV file for download in a specific directory by using the Selenium Webdriver for Firefox (geckodriver) in a NodeJS environment on Linux-Mint. Here's the code I'm working with: const {Builder} = r ...

Jenkins is unable to open an actual browser in Ubuntu 16.04

My selenium script successfully launches the chrome browser, navigates to a website, and performs basic checks. However, when attempting to run the same script locally through Jenkins, an error occurred: selenium.common.exceptions.WebDriverException: Mes ...

Do I need to have Java installed to initiate webdriver-manager?

Every time I try to run webdriver-manager start, I get an error message that says "Selenium Standalone server encountered an error: Error: spawn java ENOENT." Do I need to install Java? If so, how can I do this on a Chromebook running Crostini? I would gr ...

Is it possible to create two separate 'cookie' sessions with the same browser using WebDriver?

Is it possible to have two separate 'Cookie' sessions with the same browser in WebDriver? I made changes in my TestNG file to run two test classes simultaneously using two different threads. The problem arises when both scripts try to log into an acc ...

Tips for selecting a button on Yahoo Finance with Selenium

My goal was to automatically extract "quarterly" data from financial reports on Yahoo Finance, but I couldn't figure out how to do it. I initially tried clicking on "the quarterly button" on the financial page (), however, the code below didn't w ...

Activate and choose options in a Drop-down menu based on the specific choice made in a different Drop-down menu

Upon selecting a value from the First Drop-down on the page, the Second Drop-down becomes enabled and loads corresponding values. In manual testing, after choosing a value in the First Drop-down, the page refreshes and the Second Drop-down becomes active ...

Selenium has encountered an issue and is no longer functional following the FindElements method

At times, when I utilize the Selenium FindElements(By) function, it throws an exception and causes my driver to stop working. The issue could potentially lie within the "BY" parameter: when I attempt to search for the same elements using a different method ...

Can the creation of an Allure report be done within Python's unittest framework?

Is there a way to generate an allure report in python-unittest, similar to how it's done in Pytest? ...

Using Selenium with Python: Overcoming StaleElementReferenceException when selecting by class

Attempting to create a basic Python script using Selenium, I encountered a StaleElementReferenceException after the loop runs once. Check out the code snippet being executed: from selenium import webdriver browser = webdriver.Firefox() type(browser) bro ...

I am in search of understanding the criteria for determining when an ISearchContext can be considered

I've been scouring different sources for information on this particular topic, and while I did find a similar answer here, I'm looking for a bit more detail. Here's my code: var element = myWebDriver.FindElement("User_Login"); var finalele ...

I encountered a selenium chrome webdriver error: An exception was thrown in the main thread, displaying the message "org.openqa.selenium.SessionNotCreatedException: Unable to initiate a new remote session

I encountered an error while trying to run Selenium on Chrome, it said: Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. Any advice on how to resolve this issue? The full error message is provi ...

Selenium failing to refresh the current window

It seems like Selenium is retrieving data from an old page instead of the new one. I am attempting to automate a search process where I have to select an option from a dropdown menu and enter a value into a text box. from selenium import webdriver from se ...

Is there a way to choose an item from a dropdown menu in Selenium using Python if the option's element is not clickable?

I am encountering an issue while trying to select an item from the dropdown menu. The options that I need to choose from are not selectable and display an alert message stating, "Alert: This element is not interactable through selenium(automation) as it is ...

Having trouble installing Webdriver Driver Manager 2.7.0 through Nuget on .Net framework 4.5

When attempting to install the WebDriverManager reference from the Nuget Package Manager in my code, an error occurs. I have attempted to update and degrade the .Net framework but without success. Is it possible to use WebDriverManager 2.7.0 with .Net fram ...

I am encountering issues with Selenium not functioning properly on Windows 10 when using the syntax driver.findElement(By.cssSelector

I'm encountering problems with the CSS selector while using Selenium on Windows 10. It appears that the tag is incorrect. How can I resolve this issue? import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.By ...

Error encountered during execution of For-Each loop using VBA and Selenium?

I encountered an issue with the error message "Object doesn't support this property or method." Here is the code snippet that triggered the error: Dim webs, web As Object Set webs = driverg.findElementByCssSelector("*[class^='title-link id-trac ...

The automation script fails to launch on both Chrome and Firefox using Selenium and C# but interestingly, it works perfectly on Internet Explorer

Currently, I am testing a script in Visual Studio as a part of a project. The issue I am facing is that both Chrome and Firefox browsers are not running the script and eventually timeout. Surprisingly, Internet Explorer runs the script successfully without ...

Encountering the GDK_BACKEND error that does not correspond to the displays available on Debian

While attempting to execute a headless browser on a remote Debian server using Selenium, I encountered an issue. The server has Firefox 46.0.1 installed and I am using version 2.53.1 of Selenium. Every time I try to run a specific test, the following erro ...

Finding a specific element within a table using xpath in selenium proved to be a challenge

I am trying to click on a specific button inside a table where each row has an update button. Here is what my table looks like: <table _ngcontent-vhp-c82="" datatable="" id="dtOptionsComments" class="display table tabl ...

Selecting the optimal automation tool combination that works well with SeleniumDiscovering the

Having used Selenium webdriver, Maven, and Java for automation frameworks in the past, I am now considering exploring other tools such as WebdriverJS, WebdriverIO, and NodeJS. I have heard that using WebdriverJS/WebdriverIO/NodeJS can result in faster exe ...

What is the best way to set up jest to generate coverage reports for Selenium tests?

I recently made the switch to using jest for testing my JavaScript project after encountering coverage issues with mocha and chai. While my unit tests are providing coverage data, my Selenium tests are not. I've tried various solutions found in outdat ...

Storing list values into variables in Selenium Webdriver: A step-by-step guide

https://i.stack.imgur.com/DJXfO.pngI am just starting out with selenium webdriver and I'm trying to figure out how to extract the value from a specific Ul class and then store it in a variable. Unfortunately, I haven't been successful so far. This is what ...

When the button is clicked, automatically sync data from a website to update a Google Sheets spreadsheet

I am a frequent Betfair user and I meticulously track my bets in a Google Sheets spreadsheet. The manual entry of bet information is time-consuming. I am exploring the idea of automatically extracting bet details from the Betfair website when clicking on ...

unable to choose an option from a dropdown menu using the select method in WebDriver

Here is a drop down code with different options to choose from: <select class="col-10 customDropdown focusOutVal xh-highlight" id="SourceOfIncome" name="PrimaryIncome.SourceOfIncome" sb="59436885" style="display: none;"><option value="" class="" ...

Implementing parallel execution with POM (Page Factory) for updating records

Looking for some help as I couldn't find a solution to my issue. I'm having trouble running tests in parallel using POM with page factory. *\ Testbase class */ public WebDriver driver; @BeforeClass @Parameters("Browsername&qu ...

Encountering a connection error while running a Node.js Selenium test case on Chrome. The specific error message received is: "Error: ECONNREFUSED - Connection refused to 127.0

When attempting to run a test case on a Selenium Node.js server, an error was encountered: Error: ECONNREFUSED connect ECONNREFUSED. The test case script is as follows: var assert = require('assert'), test = require('selenium-webdriver/testing'), ...

An issue occurred while executing PhantomJS using Selenium's RemoteWebDriver

Launching a selenium grid hub using the default startup command: java -jar selenium-server-standalone-2.33.0.jar -role hub Also, initiating PhantomJS in its webdriver mode on the same machine with the following command: phantomjs --webdriver=8080 --web ...

Encountering a NullPointer Exception while attempting to locate a WebElement in the code

My current challenge involves locating a particular webelement with the code snippet below: private WebElement loc_Start; public void clickButton() { loc_Start.findElement(By.xpath("//button[contains(text(), 'Start')]")).click(); } Upon inspection, ...

Can Selenium be used to upload files via an anchor tag?

I am attempting to upload a file using an <a> tag that appears like this: <a href="javascript:void('');"></a> When trying to upload the file utilizing the sendKeys() method, I encounter errors stating "cannot focus on element." Is there ...

How can I choose the third option on this webpage using PHP webdriver?

Looking for a way to select the third option labeled Off (optional) from the following HTML using Selenium PHP-webdriver. Can anyone help me with this? In this particular HTML snippet, all ids are dynamically generated, making it impossible to use ids to ...

Having trouble breaking out of a loop once the browser hits the end of a webpage

In my latest project, I have crafted a Python script utilizing Selenium to extract all the names of coffee shops displayed on a webpage. The webpage features a lazyloading mechanism that reveals 40 names with each scroll. By scrolling twice, the number of ...

Encountering a ClassCast Exception for Actions.movetoElement with Selenium version 3.14.0+ post selenium upgrade

After updating selenium to the newest version 3.14.0, I encountered a class cast exception with the following method: new Actions(driver).moveToElement(element).click().build().perform(); The error message reads: java.lang.ClassCastException: com.prahs.u ...

The issue of stable diffusion web automation in Selenium Python is currently not functioning as expected

Having some trouble automating stablediffusionweb with python selenium, encountering an error: selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"input.scroll-hide.sve ...

Encountering difficulties in uploading a file with Selenium in Java

I am facing an issue while trying to upload a picture on this platform. Below is the code snippet that I used: public static void main(String[] args) throws InterruptedException { System.setProperty("webdriver.chrome.driver", "I:\\Selenium ...

I am attempting to select a checkbox with Selenium WebDriver in Python, but encountering an error message: "MoveTargetOutOfBoundsException: move target out of bounds"

As I was attempting to interact with a checkbox on this particular webpage , I encountered some challenges. Initially, I tried using the ActionChains library to click on the checkbox by locating its input tag via xpath or css selector and then using the ...