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.

Tips for confirming the sorting in a collapsed group using Selenium WebDriver in Java

Is it possible to test sorting within a collapse group? Please provide guidance on how to achieve this. The image below shows two groups: 1) Branch: Clifton and 2) Branch: Holsopple (columns are sorted by clicking on column headings such as Contact, Type, ...

Guide to importing various files with AutoIt

I've been working with the following code snippet: ControlFocus("File Upload","","File1") ControlSetText("File Upload","","File1",'"C:UsersDesktopimage1.png" "C:UsersDesktopimage1.png" "C:UsersDesktopimage2.png" "C:UsersDesktopimage3.png" "C: ...

What is the process for importing a .sql file into Selenium in order to run various scripts simultaneously in the Selenium environment?

Is there a way to run multiple commands in selenium, such as inserting, updating, and selecting * from employee? How can I accomplish this task? ...

Getting started with Codeception may not always be straightforward: [PHPUnitFrameworkException] Error encountered - Element index not defined

After following the Codeception Quick Start instructions diligently, I proceeded to run the initial example test using PhpBrowser... # Codeception Test Suite Configuration # # [further comments omitted] # actor: AcceptanceTester modules: enabled: ...

When using selenium webdriver, the actual text may appear as "Indian," but when trying to fetch the text using element.getText(), it may display

Here is the source code snippet for the element: <div id="q1"> <p>Are you an "Indian" by birth?</p> </div> The expected text is: Are you an "Indian" by birth? The actual text using Selenium WebDriver ...

Having difficulty in clicking the "load more" button using Selenium

I am in the process of developing a web scraper that will utilize both Selenium and BeautifulSoup. I am encountering difficulties with clicking the load more button using Selenium. While I have been able to detect the button, scroll to it, etc., I am stru ...

Find every link that starts with

My goal is to extract all the links from a webpage that start with something like: http://www.teste.com/test1 Specifically, I am looking to retrieve all links that contain at least http:www.teste.com est I attempted this using the following code: Lis ...

Can Selenium accurately find elements using partially matched classes?

As I begin my journey with Selenium, I am faced with the task of locating the Next button on the CNN website. If it is not the last page, I need to click on it; otherwise, I must end the program. The HTML code for an enabled button looks like this: <di ...

Lambda Expressions in WebdriverWait Strategy

I'm seeking a detailed explanation of the Boolean generic type used in ExpectedCondition. Can someone clarify this for me? new WebDriverWait(driver, 60).until((ExpectedCondition<Boolean>) wd->((JavascriptExecutor) wd).executeScript("return d ...

The method org.openqa.selenium.firefox.GeckoDriverService.access$000(GeckoDriverService.java:42) allows access to a specific

I encountered a problem while attempting to execute a simple code in eclipse. System Specifications: Firefox version - 61.0b4 (64-bit), Jdk - jdk1.8.0_121, Eclipse oxygen import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDri ...

Extracting specific information from HTML using Selenium in Python

Trying to extract a specific piece of text from an HTML page using Selenium webdriver and the class name. Below is the snippet of the HTML code: <tr> <th> <td class="max-captured">174.26 kp/s</td> <td class="max-captur ...

I'm having trouble getting any output from find_elements_by_css_selector. How should I handle this situation?

When attempting to retrieve values from a list, I may encounter a scenario where no value is present. In this case, I still want the code to continue running without failing. How can I handle situations where the list is empty? WebDriverWait(self.driver, ...

Error Encountered: Codeception WebCurlException

Currently, I am using Codeception in conjunction with Selenium Webdriver and encountering a WebCurlException Error once I execute codecept.phar. Here are the steps I've taken: 1. I initiated the selenium stand alone server jar file via the command prompt ...

Developing a Page Object Model to automate testing across a variety of web

I currently have a Test automation tool and we are looking to implement the page object model for automating testing on our web applications. From what I understand, the page object model is ideal when you have only one application to test. However, we h ...

The chromedriver.exe application encountered an error while attempting to open the URL "http://www.example.com/" using the driver.Navigate().GoToUrl method

When using navigate.GoToUrl("http://www.example.com/"), the ChromeDriver.exe stops working, but functions properly when the FirefoxDriver is used: using (IWebDriver driver = new ChromeDriver(DRIVER_PATH)) { // driver.Manage().Timeouts().ImplicitlyWait ...

Issue encountered while utilizing WebDriverWait with the ExpectedCondition function presenceOfElementLocated()

I encountered an error while compiling: public static WebDriverWait wait = null; wait = new WebDriverWait(driver, 120); wait.until(ExpectedConditions.presenceOfElementLocated(By.id(HomeScreen.tabHome_ID))); I am currently working with IntelliJ IDE. Err ...

Strange and unpredictable shaking phenomenon observed in webdriver with IE9

Experiencing a strange issue while running my script on IE9. On the main page, there are icons/links that redirect to different applications. However, upon opening the main page, I notice that the mouse cursor quickly "shakes" between these links for abo ...

What could be causing the freezing of a Selenium Python script on an EC2 instance

Whenever I attempt to execute a script, the process freezes. Below is the code snippet: def get_source_content(url): driver_path = f"{settings.BASE_DIR}/geckodriver" options = FirefoxOptions() options.add_argument("--headless") ...

Assist with testing browser compatibility by utilizing Selenium Webdriver

-Once you have completed the cross-browser check using Selenium WebDriver, how can you ensure that the operation is being carried out correctly on each browser? -Furthermore, how can you verify if a web application is supported in all browsers or determin ...

What is preventing selenium from locating the chrome driver?

As I was following a tutorial on creating a web scraper for Twitter using Selenium and Python, I encountered an issue. File "C:Python34libsite-packagesseleniumwebdriverchromewebdriver.py", line 62, in __init__ self.service.start() Fi ...

What is the process for adding text into a dynamic textbox using Selenium WebDriver?

I'm currently working on automating the submission of resumes page. It features intelligent textboxes that offer suggestions as you type in a few characters. You must choose one of the suggestions provided and input it into the textbox. The code snipp ...

Guide on utilizing the latest version of Chrome with Selenium using Python

Every time I try to use my local Chrome with Selenium, a new instance opens up without any cookies saved. from selenium import webdriver from selenium.webdriver.chrome.options import Options option = webdriver.ChromeOptions() option.add_argument(r'-- ...

BeautifulSoup does not recognize circular HTML pages

Encountered an issue where the page parsing code consistently checks the same page every time, despite using it alongside selenium. Selenium has no problem opening new links, but the parsing only occurs on the initial page. The frustrating part is that si ...

Choose a specific date on a Jquery date picker by utilizing selenium webdriver

Visit the Jquery official website to learn more about their datepicker component: https://jqueryui.com/datepicker/ Having trouble clicking on an input text with the unique id="datepicker" on the official jQuery website? You're not alone! Even though ...

Looking for advice on dealing with the gmail compose button. I've been attempting to locate the element using xpath, cssSelector, and other methods but haven't had any success

After logging into my Gmail account, I am facing an issue with clicking on the compose button. I have tried locating the element using various methods like XPath (Static, dynamic, and customized), cssSelector but it fails to find the element. Can anyone pr ...

Executing a recorded Appium test

Recently, I decided to delve into the world of Appium. After installing the Appium app and adding the simulator app file, I launched the simulator using the "launch" command, following the steps outlined here. I successfully recorded a test on my app and ...

I must retrieve the URL associated with the element labeled as "name" in Selenium using C#

After multiple attempts private string GetId(int index) { var xPath = "xpath"; var name = driver.FindElements(By.XPath(xPath)).GetAttribute("href"); return name[0].Text; } An issue ...

Encountering a LoadError with rspec when using selenium-webdriver

After scouring through all the other forum posts related to my issue without finding a solution, I'm beginning to think that my case might be unique. My problem arises when attempting to utilize Selenium WebDriver with RSpec for creating automated tes ...

Avoiding Special Characters in cssSelector Webdriver

How do I avoid the special character so that I can utilize the ID on the div to access the form? Below is my CSS selector: #form > div:nth-child(4)>div:nth-child(2) > div:nth-of-type(2) > div:nth-of-type(2) Here is the corresponding HTML cod ...

Tips for ensuring the success of a cucumber scenario

I have successfully integrated my framework with JIRA. Each time I run scripts, the framework checks the status of the test case in JIRA before executing it. If the test case has already passed, I currently handle it by using: throw new SkipException(""S ...

Element Not Found Error

Can someone help me find the Xpath for the element below? - <ion-button class="ta-btn btn-red ios button button-block button-round button-outline ion-activatable ion-focusable hydrated"expand="block"fill="outline"mode=" ...

Is there a way for me to navigate back to the active driver window once my script has finished running?

Utilizing Selenium WebDriver alongside Chrome WebDriver, my script1 captures a URL from the driver.get(" ...") method and performs various tasks like web scraping (such as clicking buttons, extracting information, and logging into a website). Af ...

Using Java to rotate an iOS device with Selenium

I am currently facing a challenge that I cannot seem to overcome. My objective is to develop an automated testing tool in Java using JUnit/Selenium along with Appium for testing a website on the iOS simulator (Mobile Safari). The main functionality I aim ...

A guide on executing a double click action on an element in Selenium Webdriver with JavaScript specifically for Safari users

Having trouble double clicking an element in Safari using Java / Webdriver 2.48. All tests work fine on IE, Chrome, and Firefox but Safari does not support Actions. Currently attempting: executor.executeScript("arguments[0].dblclick();", element); or ...

Issue with dropdown selection in IE 11 when using Selenium 3.0.0

While using the IE driver, I have noticed that it often selects the wrong item in the dropdown box. This issue seems to occur specifically with the items located towards the end of the dropdown list. For instance, when attempting to choose item 9 from the ...

Utilizing the `contains` CSS Selector in Selenium WebDriver to Retrieve Elements

When attempting to utilize CSS Selector with contains() in Selenium WebDriver, I encountered a NullPointerException. Could anyone provide assistance with this issue? private static final String testcode = "p:contains('Notes')"; public String getTextCode ...

I'm currently experimenting with JAVA and Selenium to automate testing for a WebApplication

Is it possible for someone to choose an item from the drop-down list called "Furniture Type"? I have managed to click on the furniture type using the following code: driver.findElement(By.xpath("(//select)[1]")).click(); However, I am struggling to actua ...

The ChromeDriver detects when the Chrome browser is launched

When attempting to use selenium chromedriver in Python for the website www.mouser.co.uk, it is immediately flagged as a bot. Does anyone have an explanation for this? Below is the code I am utilizing: https://i.stack.imgur.com/g3uLP.png options = Options ...

Creating a dynamic XPath expression with a variable in Python for Selenium using %s

I have been attempting to utilize selenium in order to find and choose a specific element based on a variable that is passed into the function when it is called. Initially, I thought this task would be straightforward using the following code: show = brow ...

Selenium encountering difficulty detecting the newly opened window in the Internet Explorer browser

I'm having trouble identifying a newly opened window in my application. When I use driver.get("my app url") and try to click on an object, I keep getting the org.openqa.selenium.NoSuchWindowException: Unable to find element on closed window error. I even ...

Check whether an element is currently in focus with Selenium WebDriver

It's surprising that there doesn't seem to be much information available online about testing for element focus using Selenium Webdriver. I'm interested in verifying that when a form is submitted without filling in a mandatory field, the focus shifts to t ...

Refreshing all tabs in Selenium after a specific amount of time

I have a rotating dashboard set up using selenium webdriver, and I've noticed that the pages need to be refreshed every few hours. How can I incorporate this into my existing code? There are 8 tabs open, cycling through each tab every 10 seconds. I'm look ...

Excellent Methods for Implementing a Double Click Functionality in JavaScript for Mouse

Is there a way to make the mouse double click by itself using JavaScript? I need this functionality for a Selenium project that requires testing, but unfortunately Selenium does not provide an option for double clicking. Can anyone suggest how I can achiev ...

How can Python, Selenium, and Parsel be used to extract text from a DIV element, even if it contains a varying number of

Currently in my Python and Selenium project, I am utilizing an xpath class selector to locate a specific div that contains text I need to extract. The challenge arises when this div may either be empty (which I have handled) or contain anywhere from 1-3 s ...

The Selenium script for running Chrome in headless mode is not functioning as expected

Version 106.0.5249.62 of Chrome the situation is...blah, blah, blah In a desperate attempt to create a script using selenium to snatch those certain files that would rock my world, I have taken the bold step of running chrome in headless mode. The gods lo ...

Encountering the SessionNotCreatedException error: Unable to initiate a new session. Response code 500 within the Azure pipeline

After setting up a pipeline in Azure-Devops and configuring a self-hosted agent for the same, I encountered an issue where it opens the browser but fails with a sessionNotCreatedException. Interestingly, when running the same code using STS or eclipse too ...

Steps for displaying custom element name from Page Object Model in test report log

To accurately track user interactions, I require the WebElement name (User-defined) for reporting purposes. When performing a Click operation on AddMainConcernLink, I need to report whether the element was successfully clicked or not as "AddMainConcernLink ...

Retrieve the inner text value from the third child element of an HTML using Selenium in Java

Here is the HTML code snippet: <h2 id="xyz" class="test"> <button class="restore 1" value="test2" title="hello"> Line1 </button> <button class="restore 2" value="test3" title="click"> Line2 </button> I need this text &l ...

Retrieving the innerHTML or innerText of a structural DOM element generated by *ngFor in Selenium

Having trouble accessing the innerHTML/innerText of a structural DOM element, only getting a commented element instead of the child elements. <div class="snap-box"> <label class="snap-heading">Recommendations</label> <div class="r ...

Adding DesiredCapabilities to GeckoDriver in Selenium-Java 3.11: A Step-by-Step Guide

Currently, I am attempting to utilize GeckoDriver with Firefox in selenium-java 3.11. The version of Firefox I am using is 59. So far, everything is running smoothly and I am able to initiate the Firefox driver. However, my main obstacle lies in the need t ...

What sets DesiredCapabilities and RequiredCapabilities apart from each other?

Could anyone provide some insight into the contrast between DesiredCapabilities and RequiredCapabilities when used in the RemoteWebDriver constructor? If you need more information on the constructor, you can refer to this link: ...

Python Selenium: Variable encoding gets altered by XPath

I am facing an issue with my code that uses XPath to search through text. The problem arises when the text being searched contains special Latin characters like ñ or í. After encoding the text, it displays correctly when printed. However, the issue occu ...

The class Actions is not functioning properly in the ChromeDriver

Having trouble with the import of the Actions class in ChromeDriver. My setup includes chromedriver 2.29 + selenium webdriver 3.4.0 + Chrome 58.0.3029.96 + Eclipse Neon.3 Release (4.6.3). When I attempt to use the shortcut Ctrl + Shift + O for auto importi ...

Attaching a text to the root URL using Protractor with Selenium

In my Config file, I have set a baseURL. I currently have 5 different specs running simultaneously, each with a unique GUID added to the baseURL. Each of my spec contains the following code: //The below one navigates to the Home Page for my credentials. ...

Choose an autocomplete form option

I am struggling to automate the selection of an item from an autocomplete list using Python and Selenium. Unfortunately, I am facing issues while trying to select the specific item (MTG - MORTGAGE) that appears in the autocomplete dropdown. Additionally, ...

Locating an element with the help of specflow and selenium

Having trouble locating the Google login button on this URL: Encountering a NoSuchElementException while using Specflow to simply open the browser, navigate to the URL, and click the button. Below is a snippet of the code being used: _driver = new EdgeDr ...

What is the best way to extract data from multiple pages with varying xpaths in Selenium?

Seeking assistance with scraping a sequence of pages similar to the following: . The structure of the URLs is straightforward -- increment the number after "precinctreport" to navigate to subsequent pages. Specifically, I am interested in extracting only ...

Executing Python Selenium Tests in Headless Mode

I'm facing some challenges when trying to run Webdriver on a specific hub in headless mode using Pyvirtualdisplay. The generic code below works without any issues: class TestHub4444TestClass01(unittest.TestCase): def setUp(self): self.display ...

Having trouble continuously clicking the 'more' button to access all the complete reviews

I have developed a Python script using Selenium to extract all the reviews from a specific page on Google Maps. This page contains numerous reviews that are only visible when scrolling down. My script successfully retrieves all of them. However, I am curr ...

Selenium: Issue with pageLoadTimeout not being effective on websites with continuous redirects

I utilize Selenium to navigate through various websites and save their HTML markup. To increase efficiency, I've implemented a pageLoadTimeout to trigger an exception for sites that take too long to load: driver.manage().timeouts().pageLoadTimeout(20, Ti ...

Exploring FreeBSD with pyvirtualdisplay and Python 2.7 for Selenium Web Driver operations

Here is the code I wrote for FreeBSD. Prior to this code, I executed pkg install xorg-vfbserver However, I am unsure of which environment variable to set after this. In Ubuntu, you must follow these steps before using this program: apt-get install xvfb ...

Navigating through frames in Selenium can be a bit tricky,

I am having trouble logging into this website. Upon loading the page, a frame appears. I have attempted to switch to the frame without success. public void logon(String Username,String Password,String trns) { Configuration.driver.get(Configuration.U ...

What's the best way to retrieve text from a text input using Selenium WebDriver?

I currently have an HTML element with the following code: <input id="input-id" type="text" value="initial">. Once the page has loaded, I am able to retrieve the text from this element using the command: driver.find_element_by_id("input-id").get_att ...

The order in which the test cases are executed by TestNG has been altered with the latest update to version 6.14

After updating the TestNG version to 6.14.2, I started encountering issues with running sequences that were not present when using version 6.8.8. Despite trying various solutions such as changing priorities, the tests did not run as expected. For more deta ...

Using the MoveToElement and click functions in Protractor with Node.js for automated browser

Trying to click on a checkbox in our application. I have successfully implemented it in Selenium Java using the code below, but struggling to do the same in Protractor Node.js. Any assistance would be appreciated. Selenium- Java : Actions actions ...

Issue encountered while executing test case with batch file in Selenium IDE

My testing process began with using the Selenium IDE Firefox plugin to record a test case, followed by executing it with the help of a '.bat' command line code. The command used for automation testing is as follows: java -jar C:\Selenium&bs ...

Executing numerous test scenarios using a single instance of the Selenium web driver

As a beginner in programming, I kindly ask for your patience as I seek assistance. I am working on creating test cases with Selenium Web Driver to check the functionality of a webpage. The process involves logging in first using a password and later enter ...

When you click on the bottom of the list, you access the element at the top of the list

Currently, for my test using Java and Selenium, I need to click on an element at the bottom of a list within the application. The code snippet I am using is as follows: wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//span[text()='4']" ...

The command window does not close after running tests in IE with Selenium

We have encountered an issue with our Maven-based Selenium project for GUI testing. Following test execution, Internet Explorer is unable to close the Selenium command window. Despite using selenium.stop(); in the @After method, the command window remains ...

Choosing a value from a dropdown menu with Selenium and Python: Step-by-step guide

Currently, I am using Selenium with Python and I am looking to automate the process of selecting an option from a drop-down menu. Specifically, I need to select the option labeled (00:00-06:00). <div class="prepopulated-select__SelectContainer-sc-xyh ...

Seeking assistance with adding information to a list that currently has no data stored

I have recently started coding and decided to scrape the Indeed website for job listings. Using selenium's find_element function, I successfully scraped job titles, company names, and locations. Now, I'm seeking guidance on how to store these ind ...

The website's reaction to the request for URLs was not what was anticipated

I'm trying to load a website and scrape all of the links, which is usually simple but I encountered an unusual response today: links = WebDriverWait(web, 20).until(EC.presence_of_all_elements_located((By.XPATH,'//a[@href]'))) print("This is what is sh ...

Having difficulty accessing hyperlink during execution of Selenium WebDriver script

I have been attempting to click on a hyperlink that is supposed to open a popup on the screen. However, I am encountering an issue as it is not working. Currently, the HTML code for the hyperlink looks like this: <a href="javascript:void(0)" class="ope ...

Selenium WebDriver encountering TimeoutException when calling getScreenshotAs()方法

This is the code I am working on. public static void executeTest() throws IOException { System.setProperty("webdriver.chrome.driver", "data/chromedriver.exe"); driver = new ChromeDriver(); driver.manage().timeouts().pageLoadTimeout(30, TimeUni ...

What is the best method for extracting [object Text] using XPath?

I'm currently working with Selenium and attempting to extract text from a node that contains the keyword "approved," but I'm unsure of how to retrieve and validate this specific text. Here is the node structure - <div class="Notification-body"> ...