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.

Saving the POM data structure in a database

One thing I'm sure of is that in the Page Object Model, DOM objects are defined in a class file specific to a certain page in the format shown below: @FindBy(xpath = "//*[@id='page_content_inner']/div/a[1]/div") private WebElement setupBtn; ...

Error: The object of type 'WebElement' cannot be accessed with square brackets

I am attempting to use Python to click the Replay button on Spotify's Web Player, but I keep encountering an error. How can I go about clicking buttons in a web player? replay = driver.find_element_by_xpath("""/html/body/div[2]/div/div[4]/di ...

Handling sporadic failures of Selenium tests during automated deployment

Our C#/ASP .Net web application undergoes the build and deployment process by our server, Jenkins. One crucial step in this process is ensuring that all automated tests, including functional tests using Selenium 2 WebDriver and NUnit, pass before deploymen ...

The attribute "parallel" set to "none" must be one of the following values: false, methods, tests, classes, or instances

I have set up a Maven project using Selenium WebDriver and integrated TestNG. However, when I validate my Maven project, an error message is displayed stating "Attribute "parallel" with value "none" must have a value from the list "false methods tests clas ...

When using Selenium webdriver, the function find_elements_by_X sometimes results in an empty list being

My objective is to compile a list of the names of all newly posted items on within a 24-hour period. After some research, I've discovered that Selenium is the ideal tool for this task as the website I am scraping is dynamic and loads more content as the ...

Tips on extracting only the initial 3 elements from a table using Selenium Web Driver

I'm struggling to figure out how to extract only the first 3 <td> elements from each row in a table using Selenium and web driver. For example, I need to get 'Vanessa 17 Sociology', 'Mike 18 Maths' and 'Sam 18 English' <table id= "table3"> ...

Creating a TestNG runner file with the cucumber-jvm-parallel-plugin: A step-by-step guide

I am having trouble generating the TestNG runner file from my POM file. I have double-checked all the configurations and they seem to be correct. Can someone please help me with the correct configuration? <build> <pluginManagement> ...

python The program will not be terminated abruptly when calling selenium driver.quit()

The code snippet above is intended to terminate the program when an exception occurs by calling driver.quit(). However, despite this, the program continues to run. What did I miss here? try: driver.refresh() wait.until(ec.visibility_of_element_lo ...

Pause until an email is received in Selenium

I am working on a code snippet to check for emails after a form submission. Sometimes, there is a delay in receiving the email. I have implemented a thread.sleep for 20 seconds before calling the email method, but it seems insufficient. Is there any way ...

Element cannot be located using Selenium WebDriver

I've been searching for a solution but haven't had any luck. It seems that Webdriver is having trouble locating a specific element. Here's the HTML code: <div id=​"cboxOverlay" style="opacity: 1; cursor: auto; display: none;">​</div>​ ...

I am looking to create a Python bot using Selenium that can monitor a Telegram channel and notify me when a new message is received. Can you guide

As a newcomer to Python and Selenium, my understanding of both is limited at this point. My Goal: I want to continuously monitor a Telegram channel for new messages without having to log in each time by using custom flags on the web version. Firstly, I i ...

Converting HTML Javascript to JAVA with the help of Selenium

Can someone help me extract the value of h1 as a string using selenium? Check out the HTML javascript snippet below- <script type="text/javascript"> $(window).load(function() { var $windowHeight = $(window).height() -12; $(" ...

Tips for navigating through a webpage by scrolling

My goal is to automatically scroll down to the bottom of the page and then perform a specific action. With the help of uiautomator, I was able to retrieve the following information: index=2, resource-id=com.manoramaonline.arogyam:id/pager,class=android.sup ...

Tips on how to efficiently wait in Selenium with Java until all images on webpages are fully loaded

I have been attempting to capture a screenshot of a webpage only once all images are completely loaded on it. Even though I searched for a solution on stack overflow, none of the suggestions have worked for me so far. The closest one I found is mentioned ...

A guide to pasting copied text from the clipboard using Selenium and Java on a Mac operating system

Having trouble pasting text into a textbox on MACOS? Trying to use the code snippet below, but Control + v and Command + v shortcuts are not working. It seems like this is a known issue, but unsure if it has been resolved yet. https://github.com/seleniumhq ...

Is there a way for me to retrieve all the choices from the select dropdown menu?

I need to retrieve all the available options from a dropdown menu HTML Code: <select class="custom-select ng-pristine ng-untouched ng-valid ng-not-empty" ng-model="Air.Class" aria-invalid="false"> <option value="0">All</option> ...

Continuing in a loop until the error ceases or until 15 seconds have elapsed

My goal is to create a loop that attempts to click on an element until it is found. If this process exceeds a 15-second limit, a warning message will be displayed. The current issue is that the loop does not respect the 15-second limit and gets stuck in a ...

Having trouble with clicking the button on the user login page of the rediff.com website

Having trouble clicking on a button after entering the email address. driver = new ChromeDriver(); driver.get("http://in.rediff.com/"); driver.findElement(By.xpath(".//*[@id='homewrapper']/div[5]/a[3]/div/u")).click(); dr ...

Is there a method to automatically switch proxies every 5 minutes using a browser extension?

Looking to implement a proxy switcher in Selenium using Python. Currently, I have code that adds a proxy through an extension but now I need to modify it to switch proxies multiple times. The goal is to create a "Proxy Switcher" extension. manifest_json ...

The default maxSession in Selenium Grid2 appears to be malfunctioning when executing a testng suite with the attribute parallel="classes"

Issue Encountered - Upon observation, I noticed that the tests are executing sequentially within a single session of FireFox browser on one node. Desired Outcome - In the specific scenario of the class "IntegrationTest" containing 20 test methods(@Test), ...

The challenge of maintaining focus in Internet Explorer while running Selenium webdriver scripts

Initially, I need to hover over the element to trigger a dropdown and then click on a specific link. This functionality works smoothly in Firefox and Chrome but encounters an issue in Internet Explorer. Below is the snippet of code being used: WebElement ...

Troubleshooting issue with setting browser version using Selenium Add Additional Capability in .NET Framework not resolving

I am currently working on testing my program across various browser versions. To begin, I opted to use ChromeDriver by implementing the following code: using OpenQA.Selenium.Chrome; ChromeOptions Options = new ChromeOptions(); Options.PlatformName = " ...

Can Selenium in JavaScript be used to retrieve child elements from a webpage?

I've been struggling to adapt my JavaScript script for use with Selenium (also in JavaScript). Despite numerous attempts, I haven't been able to find a solution. I've attached an image to better explain my question await chromeDriver.findElement(By.id(&quo ...

Select the parent element by clicking on it using two specific conditions within the child elements in Selenium WebDriver

In my current project, I am working with Selenium 4.8 in .NET 6 and I have encountered a specific html structure that needs to be parsed. <ul class="search-results"> <li> <a href=//to somewhere> <span class=" ...

Utilizing an Android application to control and modify online content

In the past, I was familiar with Selenium and WebDriver, which allowed for manipulating webpage elements like Textfields and Buttons through code. However, I'm uncertain if these tools are still available or relevant today. For instance, imagine I ha ...

Verifying attribute with Selenium's php-webdriver post click action

<a class="lnk" href="http://www.google.com">Go Google</a> Whenever this link is clicked, the 'loading' CSS class will be added. How can we verify this before actually going to google.com? $element = $driver->findElement(WebDriverBy::classN ...

Finding the right XPath for a specific code in WebDriverSampler

In my current project, I am dealing with a page that contains several fields that need to be edited using WebSamplerDriver. The challenge I face is that the id values of these fields are not consistent and tend to change periodically. This makes it difficu ...

Streamline your Salesforce application by automating drop down selections with XPath using Selenium WebDriver

https://i.stack.imgur.com/Eg9jc.pngAn application has been developed in Salesforce with a dropdown box containing items built using the <li> tag. However, I am unsure how to select a specific item from this design. <div id="Department__cformContr ...

Unable to load the file or assembly 'SeleniumExtras.WaitHelpers' was unsuccessful

I am attempting to utilize wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementIsVisible(By.Id("logonIdentifier"))); However, I am encountering an error stating 'Could not load file or assembly 'SeleniumExtras.WaitHelpers'. My projec ...

Unable to physically tap on the checkbox input, though able to perceive the value it holds

When running my protractor test, I encountered an issue with the following statement: await element(by.model('publishCtrl.isPublishedInAllRegions')).click(); The test failed and returned an error message stating "ElementNotVisibleError: element not visib ...

Tips for choosing a dropdown option and clicking on specific values in a dropdown menu using Selenium WebDriver with Java programming

Below is a snippet of HTML code. In this code, with the help of Java Selenium, I am trying to automate clicking on the logout option to end the session. The process involves clicking on a dropdown button which reveals the logout option, and then clicking o ...

Use geb to upload the file

Hello, I am trying to upload a file during my test using Geb. The instructions in the Geb-book (http://www.gebish.org/manual/0.9.0-RC-1/navigator.html#file_upload) are not working for me. My HTML code includes a file input field: <input id="bla-bl-bla ...

I am attempting to retrieve an OTP from a MySQL database and send it as a password. The challenge now is figuring out how to use Java Selenium WebDriver to send

enter code here: public static void main(String[] args) throws ClassNotFoundException, SQLException, InterruptedException { System.setProperty("webdriver.chrome.driver", "C:\\Users\\admin\\Documents\\selenium ...

When it comes to web scraping, what is the preferred choice: using selenium alone or combining it with beautifulsoup?

For my current project working with Python 3.6.3, bs4, and Selenium 3.8 on Win10, I am faced with the task of scraping pages that contain dynamic content. Specifically, I need to extract numbers and text from websites like . It seems using requests+beautif ...

Uploading a file with Selenium but encountering an error "Invalid file path -

After creating some phpunit selenium code for file upload, I noticed it functions properly on my local setup. The file path specified is: $filePath = getcwd(). "/Images/test_Image1.png" However, when running the same code on Jenkins (using SauceLabs), ...

Exploring the functionalities of double dots with Selenium

While utilizing Selenium to access a DOM element, I encountered some confusion with double dots in xpath. To clarify: .. (double dots) - this will select the parent of the current node. I also came across an article that elaborates on "Using doubl ...

When parameters are included, @Test is disregarded by TestNG

Trying to run a simple test where both Firefox browser and Chrome browser open simultaneously and navigate to the same URL, but encountering an issue where my @Test method is being ignored. However, the @BeforeClass works as expected. Appreciate any help o ...

How to use Ruby selenium-webdriver to save an entire webpage

Is there a way to capture the entire web page, including images and CSS files, using Ruby selenium-webdriver? I attempted the code below but it only retrieves the HTML file. driver = Selenium::WebDriver.for(:firefox) driver.get(URL_of_page_to_save) file ...

How to programmatically interact with a dropdown menu without a select element in Python using Selenium

Hey there, I'm currently practicing my skills with Selenium on a practice forum. If you're interested in checking it out, here's the link: click here When you visit the page and inspect the dropdown menu for state and city, you'll notice that it only cons ...

Error encountered in Selenium with Python when trying to locate Chrome binary for outdated versions of the browser: WebDriverException - Chrome binary not found

Due to compatibility reasons, I have opted to use Chrome version 55.0.2883.75 with Chromedriver v. 2.26. To download the older version of Chrome, I visited , and for Chromedriver 2.26, I got it from https://chromedriver.storage.googleapis.com/index.html?pa ...

To successfully extract the transaction name, request name, iteration number, and user names utilizing the Selenium WebDriver sampler within JMeter, is a key priority

I am trying to retrieve the names of requests and transactions from my results. My goal is to display the transaction name, request name, iteration count, and the user number passed in my code using the Selenium Webdriver Sampler. Can you please share some ...

Discovering text within HTML tags without any separators using PHP and Selenium

Here is the HTML code that I am working with: <div id="infos"> NAME COMANY <br> 35 South , Wimbledon <br>SA51 8RR London <br>***United Kingdom Phone: +##-##-####.#### Fax: +##-##-###.####*** <br> & ...

I've recently begun my journey with Python and am currently working through a tutorial. I've noticed that even though I'm implementing the tutorial's code exactly as instructed, it's

from selenium import webdriver PATH = "C:\Program Files\Driver\chromedriver-win32\chromedriver-win32" driver = webdriver.Chrome(PATH) driver.get("https://example.com") however, there is an occurrence of error " ...

Creating a function that writes to a file by utilizing the data input from

After running the provided code snippet, it successfully works in a standalone project. However, I am interested in making modifications to replace the variable "sample_text" with an output that is displayed in the terminal instead of being hardcoded int ...

Switch to the browser launched by clicking on a button using WebDriver

As I work with Selenium Webdriver in JAVA, I am attempting to automate a task that involves opening a new tab to execute some operations and then returning to the previous tab (Father). However, this process results in losing the session and encountering ...

Encountering problem "Class not found in classpath" while using selenium

Currently, I am studying Selenium and while attempting to run the program below, I encountered an error stating "Cannot find class in classpath:practiseAutomation". The code is as follows: public class practiseAutomation { public WebDriver driver; String ...

What sets ExpectedConditions.refresh apart from ExpectedConditions.stalenessof in terms of functionality and usage?

I would greatly appreciate your assistance in clarifying the concepts of ExpectedConditions.refresh and ExpectedConditions.stalenessOf. ...

Issue arises when attempting to access parameter value from testng.xml while running test class as 'TestNG Test'

My approach to retrieving the browser type (on which I want to run Selenium tests) from testng.xml involves the following code: public class TestClass { @BeforeClass public void beforeClass(ITestContext context) { String browser = con ...

What is the best way to add a "descendant" clause alongside an xpath variable?

Here's a snippet of the code I'm working on: public void someTest() { String x = "/html/body/div/div["; String y = "]/a"; for (int i = 1; i < 5; i++){ String links = x + i + y; driver.findElement(By.xpat ...

Retrieving Base64 Images in Python Selenium: Step-by-Step Guide

Trying to fetch base64 captcha images using Python Selenium has been a challenge. The issue I'm encountering is that I can only access the HTML right before the images are loaded. Here are the steps I've taken: # importing necessary packages f ...

Selenium htmlUnit with dynamic content failing to render properly

My current project involves creating Selenium tests for a particular website. Essentially, when a user navigates to the site, a CMS injects some dynamic elements (HTML + JS) onto the page. Everything works fine when running tests on the Firefox driver. H ...

What is the best way to monitor an attribute until it changes?

When there is no loading symbol displayed on the screen <div id="divWait" style="cursor: wait; position: absolute; left: 0%; top: 0%; background: transparent; padding: 3px; width: 100%; height: 100%; display: none;"> However, when the loading proce ...

Clicking on the arrow in an ExtJS split button

I'm having trouble clicking on the arrow of an ExtJS split button using Selenium WebDriver. I've attempted it multiple times without success. Below is a link where you can find the split button. I just need Selenium to click on the arrow so that the menu i ...

Obtaining locator information from a WebElement and implementing it with the PageFactory

When designing my web application, I adhere to the Page object model by utilizing a Base class that contains all common and reusable methods, as well as separate pages for each page of the application. Currently, I am faced with the task of creating a met ...

The issue with the selenium WebDriverWait arises when the expected condition fails to return the element

While I have experience using selenium, I have not had the opportunity to utilize WebDriverWait until now. I am currently facing a situation where I need to click on a Back button, which appears to be available immediately but may not be accessible for a b ...

standard_duration for Junior Selenium experiments

Is there an equivalent to Capybara's (RoR) default_wait_time for the Intern? setPageLoadTimeout and setFindTimeout don't seem to accomplish anything. this.timeout = 60000 seems to give an entire test 60 seconds, but I want all steps to have a default wai ...

Posting several pictures with Protractor

In my test suite, I have a specific scenario that requires the following steps: Click on a button. Upload an image from a specified directory. Wait for 15 seconds Repeat Steps 1-3 for all images in the specified directory. I need to figure out how to up ...

Running Selenium tests through Jenkins on Ubuntu server 16.04 in headless mode, completely bypassing the need for a graphical user interface

I am currently engaged in Selenium Automation Testing with Jenkins. After successfully setting up Jenkins on my computer, I have been able to run tests as a Maven project without any issues. The Jenkins setup is on a Ubuntu server that operates without a ...

Can you provide the correct xpath syntax for utilizing the contains text function?

Can you review my xpath code below? By.xpath(".//div[contains(@class, 'foo123') and contains(text(), 'foo bar')]") I am attempting to locate the specified HTML element: <div class="foo123">foo bar</div> Do you see any er ...

Unable to locate and interact with a concealed item in a dropdown menu using Selenium WebDriver

Snippet: <select class="select2 ddl visible select2-hidden-accessible" data-allow-clear="true" id="Step1Model_CampaignAdditionalDataTypeId" multiple="" name="Step1Model.CampaignAdditionalDataTypeId" tabindex="-1" aria-hidden="true"> <option value ...

Verify if the application is installed on the device through programmatic means

Some may argue that this question is duplicated, but I believe it's not. I have installed an app on the emulator and am currently running the following code to check if the app is available. If the app is indeed available, it returns true. See the co ...

Setting a personalized user data folder in Firefox with Watir-Webdriver/Selenium

Using Chrome Driver, I am able to initialize a new browser session with a specific user data directory. This ensures that all cookies, bookmarks, and cache are stored in a separate profile folder. If the folder does not exist, it will create one; if it doe ...

Is there a way to delay script execution in Selenium web driver until the screen has been resized?

Encountering an issue with a specific part of my code: webDriver.manage().window().setSize(new Dimension(width,height)); TimeUnit.MILLISECONDS.sleep(100); webDriver.executeScript("window.scrollTo(0,document.body.scrollHeight);"); The challenge lies in en ...

Having a tough time getting Selenium to successfully complete the automated checkout process

After experimenting with Selenium and attempting to automate the checkout process, I've encountered a stumbling block in the final part of my code. Despite numerous configurations of 'sleeps' and 'implicit_waits', I keep receiving ...

Unable to interact with Hebrew text using Selenium WebDriver with Python

Exploring Selenium Web Driver using Python with Chrome driver has been an interesting journey for me. I discovered that while I was able to make it click a button with English text, it failed to do so when the text was in Hebrew. To illustrate this issue, ...

What are some methods to execute a line of code in the event that the button is not present within my IF statement

After receiving assistance from a member on this platform, I managed to get this code to function correctly: boolean clickMore = true; while(clickMore == true) { List<WebElement> button1 = driver.findElements(By ...

I keep encountering the error message "The method timeouts() isn't recognized within the WebDriver.Options type"

I have implemented my implicit wait as shown in the code snippet below: //import import org.openqa.selenium.WebDriver; //driver declaration public static WebDriver driver = null; //implicit wait driver.manage().timeouts().implicitlyWait(30, TimeUnit.SE ...

Having trouble getting the XPath selector to function properly with the Robocorp Selenium library

For my web automation project, I am utilizing Robocorp along with the Selenium library. Everything runs smoothly until I reach a particular page where I need to click on an icon labeled SQL. I specifically require the <a> element with the @href att ...

Navigating to an iframe window within a single window on a Windows application

Initially, I attempted to use driver.switchTo().frame("framename"); but unfortunately it did not successfully switch to the desired frame. driver.switchTo().frame("xxx");/// Throws an {"status":7,"value":{"error ...

Is there a way for me to utilize driver.find_element_by_id without having to utilize driver = webdriver.Chrome()?

Is there a way to utilize driver.find_element_by_id method in Selenium with Python without explicitly defining the Chrome WebDriver? import time from selenium.webdriver.common.keys import Keys from selenium import webdriver from selenium import selenium ...

Tips on how to automatically scroll to the newest item added to a growing list

I am facing a challenge with Selenium where I need to scroll to the last element on a list within a modal window. Despite trying various methods, such as: // 1. driver.findElement(By.cssSelector("body")).sendKeys(Keys.CONTROL, Keys.END); // 2. j ...

Using Python Selenium, I am attempting to upload an image to Instagram

Once I've dealt with the notification, my goal is to click on the create button, select an image, and then click the next button. Can someone assist me in uploading photos to Instagram? Here's my code: `def upload_images(username, password, image_folder): ...

Issue resolved: Unable to select element with <div>linktext</div> despite trying all possible solutions

Here is a div with a popup overlay: <div class="tutorial-button tutorial-button-ok tt-close">Later</div> Check out the source code for this element: <a class="match-button match-button-close" href="javascript:void(0);" onclick="matchingLa ...

Enhancing web forms with Python and Selenium WebDriver: Implementing new input fields

Currently, I am utilizing the python3 unittest library in conjunction with selenium webdriver for my project. Despite having an existing question within my application, I am encountering a problem when attempting to add a new question. Rather than insertin ...

Unable to transfer data to /html/body/p within the iframe for the rich text editor

When inputting content in this editor, everything is placed within the <p> tag. However, the system does not recognize /html/body/p, so I have tried using /html/body or switching to the active element, but neither approach seems to work. driver.sw ...