Questions tagged [selenium]

Selenium, a widely adopted open-source tool, holds immense popularity in the automation of web browsers. In addition to using this tag, ensure that you incorporate appropriate tags for the particular components you utilize, such as selenium-webdriver for language bindings, selenium-ide, selenium-grid, and more.

Error encountered: When attempting to use ChromeOptions for headless Google Chrome in Selenium Python, an AttributeError was raised indicating that the 'Options' object does not possess the attribute 'self'

For days, I've been attempting to set up headless chrome without any luck. It's frustrating not knowing what's causing the issue!! I've exhaustively searched through forums and tried every solution mentioned. Currently, I'm using this code snippet (direct ...

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 ...

Tips for creating a visually appealing list when web scraping using Selenium, with or without the use of Pandas

import pandas as pd import geocoder from selenium import webdriver import csv g = geocoder.ip('me') print(g.latlng) driver = webdriver.Chrome(executable_path=r'D:chromedriver.exe') driver.get("https://prisguiden.no/kategorier/mobiltelefon") variant = d ...

What is the best way to create a function that allows us to "wait for ajax" to load before proceeding with the page and then easily reuse that function in other test methods

I have been experimenting with different waiting options, but I am unable to click the button. It seems like the AJAX is taking time to load the page. How can I create a function to wait for AJAX and use it in other methods when needed? for (int row = 1; ...

What is the solution when findElement() in WebDriver on Android using Appium cannot locate the element after sendKeys()?

My Android emulator and Appium test are running smoothly. The app launches the correct Activity and enters text into a specific field without any issues. However, when I attempt to locate the same text field in order to verify its content, I receive an err ...

Java is unable to locate the specified path within the system

While working with Selenium Webdriver and Java, I encountered an error stating "The system cannot find the path specified" Here is the code snippet: package test; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileReader; i ...

Utilizing Selenium to Override SSL Certification in Internet Explorer Using Python

After extensive research on this issue, I have yet to come across any viable solutions. My current project involves writing a script using Selenium to automate logging into a specific website. However, my efforts are being hindered by a certificate warning ...

Python Selenium | Is there a way to easily eliminate repetitive code whenever a new "item" is added?

Currently, I am in the process of developing an Automated Acceptance Test utilizing Python Selenium to populate a web form and verify any errors displayed on the webpage. Following that, I compare these errors with my anticipated outcomes to generate eithe ...

What is the best way to locate a web element in Selenium using Python when it does not have an ID

I'm having trouble selecting an element on the minehut.com webpage that doesn't have an ID. Despite trying CSS Selectors, I haven't had any success. The element I want to select is: <button _ngcontent-c17 color="Primary" mat-raised-button class="mat ...

Guide to managing authentication popups in Chrome using Selenium WebDriver in Java

I'm currently dealing with an authentication pop-up in one of my new Webdriver scripts. While I have a solution that works for Internet Explorer, I'm facing some challenges with Chrome. The approach for IE was straightforward - following the guid ...

Handling alerts in a WhatsApp bot using Selenium

Have you ever experienced a bot sending messages to numbers from a text file, only to run into an alert that needs confirmation when switching to another person? It's quite a predicament because the code doesn't progress beyond waiting for the page to load ...

What could be the reason my XPath query is not yielding any results?

Below is the html code that I am currently working with: <html> <body> <table> <tr> <tr> <tr> <tr> <tr> <td>Color Digest </td> <td>AgArAQI ...

Are DIV elements really impossible to click using selenium Web Driver?

Can DIV elements be clicked using selenium Web Driver? For example, I'm having trouble clicking the delete button in Gmail. https://i.stack.imgur.com/zsyio.png I've been trying to locate the element using the XPATH = //div[@aria-label='Delete'] https:/ ...

Creating a Dockerfile for a Ruby Capybara scraper: Step-by-step guide

I'm in the process of creating a Dockerfile to run a Ruby Capybara scraper within a docker container. The code I've tested works fine on my host OS, but it's throwing an error when executed within the docker container. Dockerfile FROM ruby:2.6.6 RUN apt- ...

What is causing my constant failures in Jenkins / Ant builds?

Trying to understand Jenkins has been a challenge for me. Despite the success of building and running my suite of selenium tests in Eclipse and through the command line with ant, I encounter failures when attempting to use Jenkins. Interestingly, the conso ...

How can we most effectively test XML responses?

When it comes to testing webpages with xml responses, using Selenium IDE can be a challenge. While some opt for Selenium Remote Control or Pearl modules like WWW::Mechanize and Test::XML/Test::XPath, these may not be feasible options for those who prefer J ...

Unable to access the SignOut button by clicking

Looking for some assistance! I'm having trouble clicking on the 'Sign Out' button, here is a screenshot from Firebug: <li class="dropdown open"> <a class="dropdown-toggle" aria-expanded="true" aria-haspopup="true" role="button" data-toggle="dropd ...

Integrating Selenium with Java for seamless collaboration with Team Foundation Server

Currently, I am utilizing Selenium Automation with Java for my test automation requirements. For reporting purposes, TestNG is the tool I have been using so far. Previously, no integration was established with any tool for reporting, therefore I would man ...

Employing a proxy server in conjunction with selenium and ruby

I'm facing an issue with getting selenium to make requests through a proxy server, as it doesn't seem to be working properly. Although this code gets a response, it's not utilizing the proxy settings: Selenium::WebDriver.logger.level = :info proxy = Sele ...

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 ...

Automated Menu Selection using Selenium

I'm currently facing a challenge in writing a Python script using Selenium to interact with a webpage. I am struggling to use the .click() method to select an expandable list on the page. Despite successfully logging in and navigating to the desired page, ...

Tips for arranging a draggable list in Selenium

Here is a link for practicing sorting: I attempted the sorting with the following code: Actions action = new Actions(driver); List<WebElement> elements = driver.findElements(By.xpath("//*[@id="demo-tabpane-list"]/div/div")); fo ...

Angular4 ChromeDriver Selenium Protractor

I am facing an issue while trying to run 'ng e2e'. The error message I encounter is as follows: WebDriverError: unknown error: cannot find Chrome binary I am using Protractor which is pre-installed with Angular CLI. Despite reinstalling ChromeDriver and ...

What is the most efficient method for conducting cross-browser compatibility testing on a web application with Selenium automation?

After dedicating a significant amount of time to research without finding a suitable solution, I turned to StackOverflow for help. I have been using Selenium Webdriver to automate testing on various browsers. However, recently I encountered issues with ol ...

When executing Selenium tests through Jenkins and MSUnit, the browser fails to open, yet the results are still valid

For the purpose of a POC, I have set up a Windows Server 2012R2 machine with Jenkins installed to run Selenium UI tests using msunit. However, during the CI build process (compilation and test execution) on the server where Jenkins is running, I am unable ...

Error: ChromeDriver does not support the current version of Chrome. The driver only works with Chrome version 94, but the browser is currently at version 93.0.4577

Attempting to create a basic selenium script to navigate and interact with links on a specific website. Here is an example of the script: from selenium import webdriver import time chrome_options = webdriver.ChromeOptions() chrome_options.add_argument(&qu ...

Navigating through WebTables with a Horizontal Scroll Bar using Selenium

I am tasked with automating a WebTable that is embedded in the WebPage. The table contains numerous fields, causing it to have its own horizontal scrollbar separate from the rest of the WebPage. As a result, when attempting to interact or click on elements ...

Having trouble locating the XPath for a button within a frame

My attempts to access the following website were unsuccessful: https://www.google.com/recaptcha/api2/demo I tried clicking on this button: https://i.stack.imgur.com/0q229.png Then, I attempted to click on this button: https://i.stack.imgur.com/LvTjG.pn ...

Can you find a method to tally characters on a webpage viewed in a browser app using R?

I have a collection of text files (.txt) that contain saved web pages, specifically public profile pages from a social media platform. I am interested in measuring the amount of content on these profiles, but simply converting the files to .html and viewin ...

iterate over elements with dynamic values in selenium

I am currently facing a challenge where I extract text from a website and then need to use it in a loop to continuously click on elements based on that variable. The code I have written only loops for 5 times, but the desired behavior is to click on elemen ...

During the second test, Selenium was unable to locate the element

Encountering the same issue with every test script I attempt to create using selenium + TestNG. After the first @test method, webdriver fails to identify elements in the following @test methods. Illustratively, consider the scenario: The web driver loads ...

I failed to utilize the search bar feature on Instagram

When I log in to Instagram, I try to search for "tanishq" in the search box but it doesn't work WebDriverWait wait = new WebDriverWait(driver, 10); WebElement search = wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//div[@class='eyXLr wUA ...

When using headless Chrome, the element attributes may differ from those in regular Chrome, causing Selenium to throw a NoSuchElementException

This particular snippet of code functions properly when used in the regular version of Google Chrome: from selenium import webdriver from time import sleep def login(email, password): with webdriver.Chrome('/path/to/chromedriver') as drive ...

Error encountered while running Selenium: "main" thread exception - org.openqa.selenium.remote.UnreachableBrowserException

I'm currently using Selenium with Firefox webdriver and encountering an exception when trying to create my webdriver instance. WebDriver driver; driver = new FirefoxDriver(); The strange thing is that the code was working fine before, but now it&apo ...

Scraping websites efficiently using Selenium for pagination features

Recently, I've been delving into the world of creating web scrapers using Selenium. One particular challenge I'm encountering involves scraping pages with pagination. I put together a script with high hopes of successfully scraping every page. fr ...

Leveraging Python selenium for image upload within a button element

As I attempt to upload a JPG image onto a website using the designated button, here is the HTML code provided: https://i.stack.imgur.com/6o4ly.png I have attempted the following code, but unfortunately, it does not seem to be functioning correctly: PHOTO_ ...

Unable to execute AndroidDriver on virtual android device using Selenium

Attempting to utilize an Android driver within Selenium has presented a perplexing error that leaves me stumped. I have both an operational Appium Server and an active Android Emulator (from Android Studio) identified as "emulator-5554" when queried with " ...

Retrieve information from Java HTTP event stream

Currently I am engaged in test automation utilizing a Selenium-based Automation framework. My current task involves sending HTTP requests to establish an API suite. The next challenge lies in posting a URL that is embedded within a text/event-stream forma ...

Discovering the background color of see-through HTML elements using Selenium

Looking to count the characters with a specific background color. I am currently traversing through all the HTML nodes using this method: Counting inner text letters of HTML element Example HTML Page: <span style="background-color: #ffff00;"> ...

tips for choosing a date from a drop-down calendar with selenium

Looking to leverage a dropdown calendar feature with Selenium automation. Using Python as the scripting Language, and still getting familiar with Selenium. ...

Implementing @BeforeSuite to run after setting up the webdriver instance in Arquillian

I am facing an issue with using @BeforeSuite after the instantiation of WebDriver in Arquillian. Below is an example: @RunAsClient public class GoogleTest extends Arquillian { @Drone private WebDriver driver; @ArquillianResource private ...

Neglecting to log out of Gmail using Selenium WebDriver

Following my successful login code for gmail through webdriver, I attempted to implement the logout functionality using the code below, but unfortunately encountered an error: // To open the account menu where the sign out button is located driver.findEle ...

How to use Selenium WebDriver in Python to upload a file using a hidden input field

Html: <div id="js-cert-file" class="form-group"> <button id="js-ob-browse-n-upload" class="btn btn-ob browse-and-upload-onboarding-ssl-button" style=""> BROWSE & UPLOAD </button> <input id="js-cert-file" class="hidden btn btn-ob" ...

Looking to confirm the contents of a text box?

In need of assistance to assert a value that appears in the text field labeled blNo. Struggling with using a proper assert method, any suggestions would be greatly appreciated. ...

What are the steps to utilize the driver initialization in the setupModule function?

When using unittest in Python3, I attempted the following code: import unittest from selenium import webdriver def setupModule(): driver = webdriver.Firefox driver.maximize_window() driver.get('www.google.com') def teardownModule() ...

Selenium Struggles to Locate an Element

In the process of developing a simple script that selects a random code from your Discord 2FA backup code text file, inserts it into the 2fa box, and submits it during login. The bot can already enter your email and password to log in initially and choose ...

In C#, is there a way to conceal the Selenium Webdriver console application while also specifying a unique path for the drivers to be located?

I need to achieve two specific tasks with Selenium-Webdriver: hiding the console that pops up and specifying a custom path for the driver's location and version. Unfortunately, I couldn't find a constructor that can handle both a string for the directory ...

What is the best way to leave a comment on a user's Instagram post using Senium?

Currently, I am utilizing the Selenium library in Python to execute a code that emulates typical human actions on Instagram. However, this particular action seems to be unattainable, almost as if Instagram has prohibited it altogether. I am attempting to ...

Creating a GlobalVariable dynamically in Katalon during runtime using script mode

I am a beginner with the Katalon Studio tool and trying to dynamically add GlobalVariables by inputting both the variable name and value. I have found a piece of code that should help me achieve this, but I am struggling to understand it as it utilizes met ...

Managing TAB behavior in Selenium

I am attempting to switch between two tabs and came across the following code snippet: ArrayList<String> tabs2 = new ArrayList<String> (page.getWindowHandles()); System.out.println(tabs2.size()); page.switchTo().window(tabs2.get( ...

Java Selenium - accessing hidden input values

Hey there, this is my first post on Stack so please go easy on me if I make a mistake. I've been using selenium and Java for some automated testing. Everything was going smoothly until I encountered an issue with setting the value of a hidden input. ...

The if block's condition is only evaluating the first statement and not the second statement

When attempting to log in, I need to enter a username and password. If the "I Agree" element is not displayed or the "admin header" element is displayed, I want to click on the admin element. However, my code currently only checks if the "I Agree" elemen ...

Using chromedriver-autoinstaller while restricted by a firewall

Can Chromedriver-autoinstaller be utilized behind a firewall? Alternatively, are there more effective solutions for managing ChromeDriver while operating behind a firewall? ...

Selenium's SendKeys function fails to execute when the computer is locked

When filling a date in a text box using Python 3.9.5 and Selenium 4.1.0 with Microsoft Edge 98.0.1108.43 on Windows 10, I utilize the following code: #element is the web element I want to fill element = "element_name" date = driver.find_element(B ...

Error encountered: `java.lang.NoClassDefFoundError` with specific missing class `org/w3c/dom/

I am faced with a challenge in running a Java project that utilizes the page factory and page object model. I have successfully run it on Chrome and IE, but running it on Firefox has proved to be difficult. The browser does not open and I encounter the fol ...

Troubleshooting problem with Firefox and Selenium: Firefox remains unresponsive despite being updated

I encountered an issue while running a functional test that involves opening a Firefox browser with Selenium. Despite trying to troubleshoot by updating Selenium and re-installing Firefox, the error message persists. Here's the detailed error message ...

Finding an element with Python and Selenium by accessing innerHTML

I am currently navigating my way through Selenium and attempting to create my inaugural script using the Python package. My setup includes: Operating System: Windows 10 Python Version: 3.10.5 Selenium Version: 4.3.0 Up until now, I have managed to accom ...

What are the steps for choosing the current date from a dynamic calendar using Selenium?

I am having an issue where the calendar display is showing dates from the current date to the next upcoming date. However, I need to select the current date every time I run the script. This is how the calendar looks like: I attempted to solve this issue ...

Having trouble starting Google Chrome version 61 in CentOS 7 with Selenium WebDriver?

System Information: Operating System: Centos 7 Browser: GOOGLE CHROME V61 Automation Tool: SELENIUM WEBDRIVER 3.5.3 Driver: ChromeDriver 2.30/2.32 Attempted to run Google Chrome manually inside Jenkins slave environment google-chrome --no-sandbox --dis ...

Selenium encountering issues with loading additional content on Meetup tech page

I have been troubleshooting this issue for the past few days with no luck :( Is there anyone who can offer assistance? The problem I'm facing is that when selenium clicks "show more" on a specific city in the meetup website, it loads but nothing displ ...

Attempting to retrieve an image from Tumblr using Java and the Selenium automation tool

I'm facing an issue while attempting to download images from Tumblr using Java Selenium. After extracting the image URL from the source and downloading the images, I noticed that they are in unsupported formats and are smaller than expected. Can someone pr ...

Identify elements within a frame set and specific frames and div tags with the help of Selenium

struggling to pinpoint the exact location of the "item1" div tag within the DOM structure below. Despite trying various methods, I have not been successful in my attempts.

Using Selenium to locate a class name in an Elements collection

Greetings, I am in the process of learning Selenium Webdriver on Eclipse IDE using Java Language. I have come across an element with the following ID: <button role="tab" id="tabs-id_1-link-1" class="c-tabs__link is-active" aria-selected="true" aria-con ...

There appears to be an issue with generating an HTML report using nosetests in Python as the option `--html--

Hi there, I'm having some trouble with my Selenium Python regression test script. My HTMLTestRunner isn't working as expected for generating the test report, so I decided to give the Nose plugin a try instead. I've gone ahead and installed Nose, as well a ...

Apache Airflow: ImportError - Couldn't find the module named 'selenium'

Currently, I am running apache-airflow locally using docker. However, I encountered an issue when trying to import selenium into one of my dags that involves web scraping data on a regular basis. Despite running the pip install command in the console and r ...

Downloading files in headless mode using Python and Selenium is not working

I am encountering an issue while trying to download this file: Residential Product Guide & Rate Sheets Residential Rate Sheet -> Click on the download button next to it When I download without using headless mode, everything works perfectly fine ...

Scrape with Beautiful Soup

I have successfully used selenium to scrape data from tradingview and display it on the screen. However, I am having trouble figuring out how to pass this data to Beautiful Soup for further processing. It seems like printing to a csv file using selenium is ...

Divergent behavior of Selenium xpath when used with python versus ruby

I'm currently facing an unusual problem with selenium. The following ruby code snippet: page.all(:xpath, "//table[3]//tr[last()]//td") Successfully retrieves all the cells of the last row from the third table on a webpage. In contrast, this python code ...

Utilizing Beautifulsoup to extract elements from Selenium

When utilizing BeautifulSoup with Selenium, I usually start by parsing the entire page using soup = BeautifulSoup(driver.page_source). But what if I only want to parse a specific element from Selenium in BeautifulSoup? If you try the following code snipp ...

Python Selenium Webdriver - Interacting with a button using a dynamic selector

I'm currently working on an automation project and facing a challenge with clicking this button using a selector. <button id="ember2570" class="ember-view btn btn-default btn btn-default" type="button"> <i class="fa fa-upload"></i&g ...

transferring files without a user interface

Looking for a solution to upload a file by clicking on an element: <a class="gray_box" href="#">Choose world folder<span>Select the world folder, we'll do the rest</span></a> The issue arises when the file manag ...

Executing the copy and paste function using Selenium in Python

As a new user of Selenium, I am attempting to transfer some content from one page to another. The original page allows for automatic copying by simply clicking on the text once. However, I am encountering an issue where nothing is being copied and I can' ...

When executing concurrent "tests" in a TestNG suite, the data provider values are being duplicated for the same field

Let's consider an example scenario: In my application, there is a username field where the username is passed through a dataProvider. For instance, if I send the username as "[email protected]" During parallel test execution, the data prov ...

What is the best way to extract data from various webpages connected to a single source using selenium?

Lately, I've been working on extracting a large amount of pricing data from a website by starting with one page that contains links to each item's individual page. My goal was to automate the process using a script that would click on a specific ...

Error: Cannot find module 'selenium.webdriver.common'

Recently, I started learning Python. To practice what I have learned so far, I decided to create a new Python project using PyCharm. However, when I tried running my simple program, I encountered the following error. "C:\D drive\Workspace\P ...