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.

Fetching text from a link using Selenium in Python

How can I extract the text "Home"? <li class="active"><a href="#">Home</a></li> I attempted to use the following code: element = self.browser.find_element_by_class_name('active') print element.find_element_by_tag_name(& ...

Here is a method to capture the redirected URL (href) of an <a> tag that has "href="javascript: return false"" but leads to a different URL when clicked

I am looking for a way to extract the redirected URL from an anchor tag without actually visiting it. I have tried using `selenium` `get_attribute('href')`, but all I get is "javascript: return false". Is there a method to obtain the redirected URL through ...

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

"Encountering a problem with the SPACE key functionality in the send_keys method while using the chromium

Equipment used: Raspberry Pi 4 Raspbian operating system chromium-driver version 72.0.3626.122-1~deb9u1 selenium version 3.141.0 Encountering an unusual behavior where using ActionChains(driver).send_keys(Keys.SPACE) in Chromium Browser results in the inp ...

Error encountered: The method WebElement.click of <selenium.webdriver.firefox.webelement.FirefoxWebElement has failed to execute

Recently, I created a Python script that automatically logs into my email account and sends messages. It was working fine after testing, but then I decided to make some changes to simplify it - like adding one-liners and reducing the number of local variab ...

Encountering an error in the response body while attempting to send body data from an external file using J

I am facing an issue where I need to send data in the request body from an external file within jmeter, but every time I attempt to do this, I receive an ERR in the response body. Below is my post method request body: ${__FileToString(/Users/public/${__eva ...

Tips for effortlessly moving rows between Grid views using drag and drop functionality

driver.findElement(By.xpath(".//*[@id='tbplayers']/tbody/tr[2]/td[3]")).click(); WebElement dragme = driver.findElement(By.xpath(".//*[@id='tbplayers']/tbody/tr[2]/td[3]")); WebElement drop = driver.findElement(By.xpath(".//*[@id='tbField']/tbody/tr/td" ...

Click on the desired choice by using the right-click feature in Selenium while on the PowerBi

I have written the following Python code to extract data from a PowerBI website: driver = webdriver.Firefox() driver.get("https://app.powerbi.com/view?r=eyJrIjoiZGYxNjYzNmUtOTlmZS00ODAxLWE1YTEtMjA0NjZhMzlmN2JmIiwidCI6IjljOWEzMGRlLWQ4ZDctNGFhNC05NjAwLTRiZT ...

Continuously monitor using Selenium until the desired text is located

I need to locate a specific piece of text on the page, and the only way I can do it is by using the className within the span tag. The problem is that this className is used for multiple other span tags as well. If I attempt to find the text through the cl ...

Is it possible to navigate to an iframe within an iframe after resetting to defaultContent()?

Why does my webdriver throw an exception when I try to switch to a frame(2) inside a frame(1) after using driver.switchTo.defaultContent()? Removing this line allows me to find the frame(2). Can someone clarify why this behavior occurs? driver.switchTo().d ...

ElementNotFoundException, Selenium is having trouble finding the element

My first time using Selenium and I'm struggling to locate my TextField element. I've tried using By.id("originTextField"), as well as the xPath and cssSelector provided by Chrome's dev tools. If anyone could provide an explanation, I would greatly appreci ...

Which environment variables must be set/configured in Eclipse for Selenium WebDriver? Can I proceed without setting/configuring them?

There are some opinions online that suggest one must install Java, set JAVA_HOME, download Maven, set MAVEN_HOME, update PATH variables, etc. before starting to work with Eclipse and Selenium WebDriver. I have a few questions: 1) What happens if I do not ...

Is it possible for a UnreachableBrowserException exception to be triggered by conflicting network configurations?

My setup involves two grids: I have a local grid setup where the hub and nodes run on my local machine, connected to network#1 Additionally, I have a VM grid setup where the hub and nodes are running in a virtual machine, connected to network#2 When ...

My custom Chrome Driver is not being utilized by Selenium and instead, it is defaulting to a different one

Trying to extract the source code of a webpage using Python has become quite challenging. Due to compatibility issues, I had to resort to Google Chrome 114 instead of the latest version 116. Even after creating and downloading my own version that should wo ...

The Selenium code is encountering difficulty retrieving the text from an element

I'm attempting to retrieve the website owner using my local whois with the following code: link = "ebdicorp.com.br" service = service.Service('C:\Selenium\chromedriver.exe') service.start() capabilities = {'chrome.binary' ...

Selenium in c#: Efficiently Waiting for Element to Appear Without Unnecessary Delays or Timeouts

Currently, I am working on a project using selenium and c#. One issue I am facing is that my tool runs very quickly without waiting for the element to be fully ready. Avoiding the use of Thread.Sleep() is recommended in this case. The specified wait time ...

Is it feasible to automate the cropping process with selenium?

Exploring a new challenge: simulating a cropping feature. I understand that replicating human cropping is impossible, but the image I intend to crop remains a fixed size each time I run the test. My goal is to establish the cropping WebElement at a constan ...

Issues encountered with Selenium Python when buttons are unresponsive and not generating any errors

The buttons seem unresponsive agree_button = driver.find_element_by_xpath('//*[@id="rightsDeclaration"]') submit = driver.find_element_by_xpath('//*[@id="submit-work"]') def initiate_upload(): agree_button.click() time.sleep(1) s ...

Steps to obtain browser network logs with Python Selenium

Seeking assistance on retrieving browser network logs through Selenium for troubleshooting request/responses. Any guidance would be greatly appreciated. Currently utilizing Selenium 3.14.0 in conjunction with the most recent version of Chrome browser. ...

The dilemma surrounding implementing the Page Object Model in C# using Selenium is causing uncertainty

I have successfully written code that navigates to a specific URL and changes the country and currency. Now, I am looking to refactor my code for better organization and easier maintenance. Although I haven't used the page object model before, I have been ...

A tool designed to create a function that can fetch information from a JSON file

Currently, I am working on a function that accepts arguments and combines them to form a line for searching data in a JSON file. To accomplish this, I have initialized a variable for the readFileSync and then added the function's arguments to it in order t ...

struggling with setting up a Python script to automate logging into several email accounts

Here is my code where I am attempting to create a function that includes a list to log into each email account one at a time. The issue I am facing is that it is trying to loop through the entire list instead of logging into one email at a time. How can I ...

Selenium tool for delaying the execution until an Element appears

Just started using the selenium framework and created a method to check for the presence of an element. Here is the method I came up with: public class WebUtlities { WebDriver driver; public void waitforElement(WebElement element) { W ...

Attempting to find a specific text element within the contents of a webpage

On a dynamically created page, I have a list of different car types. I am looking for a way to locate specific elements by their text string and then click on the checkbox next to it. Double-clicking on the text should have the same effect. Currently, my ...

What is the best way to confirm that the content on a website is identical when hosted in two separate environments?

I am facing a situation where my website is hosted in two separate environments - internal and public. I need to ensure that the content displayed to the public is identical to what is shown in the internal environment. Are there any tools available for ...

Upon starting Selenium webdriver, Chrome browser displays a blank page

While trying to run a Selenium test script on the Chrome browser, I encountered some problems. When Selenium tries to launch the Chrome browser, it opens up with a blank page and I also received a pop-up message saying that chromedriver.exe has stopped wor ...

A guide on choosing an option from a dropdown list with Selenium

Struggling with choosing options from a list drop down box in Selenium. Here's a snippet of the list box HTML and the Dropbox box: <li class="MuiButtonBase-root MuiListItem-root MuiMenuItem-root Mui-selected MuiMenuItem-gutters MuiListItem-gu ...

Utilizing a Variety of Locators in Selenium WebDriver for Element Identification

Is there a way to find an element on a web page using Selenium WebDriver with multiple locators simultaneously? I have two elements with the same ID but different values, so I need to combine both the ID and value in order to access them. What would be t ...

Having trouble choosing multiple options from autocomplete drop-down with Selenium web-driver in Python

I am currently in the process of automating a webpage built with Angular that features an auto-complete dropdown with numerous elements. My goal is to click on each individual element and verify if it populates all the fields below accordingly. Below is th ...

What is the maximum number of requests allowed on LinkedIn?

My current project involves extracting information from LinkedIn using Selenium in Python. I understand that LinkedIn has strict anti-scraping measures in place to prevent unauthorized data collection, which could result in blocked accounts and IPs. I'm ...

Automated data collection with selenium

Hey there! I'm currently working on scraping a website and initially used Bs4 to extract certain elements like sector and name. However, I'm facing difficulty in retrieving the financial data using it. In the page source below, the "-" should be ...

The "Login" button with the ID "loginbutton" and name "login" cannot be clicked at the coordinates (600, 341). It seems there is an issue with clicking on the login button on Facebook

from selenium import webdriver from selenium.webdriver.common.keys import Keys import time PATH = "/Users/khizarm/Downloads/chromedriver" chrome_options = webdriver.ChromeOptions() chrome_options.add_argument("--incognito") drive ...

Tips for chaining actions in Javascript using ActionSequence, LegacyActionSequence, or a similar method

I encountered an error while attempting to execute this example, despite trying both ActionSequence and LegacyActionSequence. I am in search of the correct method to chain actions. My attempts to find a solution in resources such as https://seleniumhq.git ...

Is there a way to simulate pressing shift + enter key with Python using Selenium Chrome WebDriver?

I recently developed a bulk WhatsApp message sender application that allows for sending multi-line text messages. However, I encountered an issue on WhatsApp web where pressing enter sends the message right away. My goal is to have it press shift + enter ...

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

Issue encountered while using Selenium: Unable to successfully click the Close button on overlay when a second product is added to the cart. However, there is no problem clicking the Close button for the first item added

//Custom TestNG Class for XCart Checkout public class XCartCheckout extends TestBase { public static WebDriver driver; StoreHomePage home; // ArrayList<String> productname = new ArrayList<String>(); @Test(dataProvider = "DataFrom ...

Attempting to use geckodriver to call webdriver.Firefox but encountering the NS_BINDING_ABORTED error message

I am encountering difficulties with the geckodriver. When I run the following code, I receive the error message "SessionNotCreatedException: Message: Error: NS_BINDING_ABORTED". The issue seems to be arising from the line where I call "driver = webdriver.F ...

Steps to execute several selenium scripts consecutively without relying on the 'Beforetest' and 'Aftertest' functionalities

In my work with Selenium web driver, I have crafted a series of codes in Eclipse to test different features of a web application. My aim is to execute them sequentially without combining them into one code using the '@Beforetest' and '@After ...

Utilizing the same WebDriverJS instance repeatedly

As a beginner in Selenium, I successfully launched a website using the following Node.js code snippet: var webdriver = require('selenium-webdriver'); var driver = new webdriver.Builder() .forBrowser('chrome') .build(); console ...

Switching from MSTest to NUnit: Exploring NUnit's alternatives for CurrentTestOutcome and UnitTestOutcome

I need assistance converting the code below from MSTest V2 to NUnit 3. Can someone help me identify the alternatives for CurrentTestOutcome and UnitTestOutcome in NUnit? var status = MyTestContext.CurrentTestOutcome; switch (status) { case UnitTestOu ...

Having trouble persisting my login status in Selenium using Python

Has anyone experienced issues with logging into Instagram using an automate tab? Previously, I didn't have any problems, but now it seems that Instagram is not allowing users to log in through automation. An error message stating the following appears: T ...

Python - Troubleshooting a Timeout Exception Error in Selenium Webdriver

My objective is to extract movie genres from the IMDB website through a different platform. The main page I am working with is: driver.get("https://sfy.ru/scripts") # main website Please note that you may encounter a "certificate is not v ...

Setting a list as a value in a dataframe - a step-by-step guide

My goal is to populate cells in a table with the monthly activity data of GitHub users, organized by years and months (e.g., 2021_01, 2022_10). https://i.stack.imgur.com/BGwfx.jpg The Xpath for this information can be found here: //*[@id="js-contrib ...

Is the webdriver.io waituntil method designed to return a boolean value of true or false

I am working on an automation framework using webdriver.io v5. I need to receive a boolean response from the code snippet below: waitAndCheckForContactToBePresent(contactName) { return browser.waitUntil((value) => { return this.chec ...

E2E tests for Internet Explorer using Selenium and Protractor

Looking to integrate e2e tests into our CI build process, I have successfully added them for Chrome and Firefox. However, I want to include tests for various versions of Internet Explorer as well. How can this be accomplished in the build process on Linux/ ...

Tips for accessing the time in the "2023-04-17" format from the given HTML code with Python Selenium Webdriver

<div class="medium-widget event-widget last"> <div class="shrubbery"> <h2 class="widget-title"> <span aria-hidden="true" class="icon-calendar"></span>Up ...

Locating and selecting a boolean checkbox with Selenium and Java: A step-by-step guide

I'm currently attempting to click a primefaces select boolean checkbox using the ID, but I'm encountering an issue. The exception message states: org.openqa.selenium.NoSuchElementException: Cannot locate an element using By.id: runDARtest1 I&ap ...

Is it possible to extract the CSS path of a web element using Selenium and Python?

I am working with a collection of elements using find_elements_by_css_selector, and my next task is to extract their css locators. I attempted the following approach: foo.get_property('css_selector') However, it seems to be returning None. ...

Steps to retrieve values from a grid and execute a sum operation using PROTRACTOR

Embarking on my Protractor and Javascript journey, I am faced with the challenge of writing a test script to retrieve values of various accounts under the header "Revenue" (as shown in the image below). My task involves extracting all number values listed ...

Avoid locating the element within the website

Unable to locate the specified element The code was created using Python with Visual Studio Code from time import time import time from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By ...

Clearing up confusion around identifying checkbox elements using XPath in Selenium WebDriver with Java, specifically within a

HTML code <div class="modal-footer slds-modal__footer" data-aura-rendered-by="2805:0"> <div class="rssDialogText grantAccessCheckbox packagingSetupUIRssDialogFooter" data-aura-rendered-by="2595:0" data-aura-class="packagingSetupUIRssDialogFooter" ...

Issue encountered with Selenium and Python: TypeError is raised due to multiple values being passed for the 'executable_path' argument in the __init__() function

Error is: TypeError: __init__() got multiple values for argument 'executable_path' I'm having trouble pinpointing the issue. chrome_options = Options() #line 8 chrome_options.add_argument('--headless') #line 9 chrome_options.add_argument('--no-sandbox') ...

My Python script utilizing Selenium is failing to execute

Why is the loop not functioning correctly after opening the initial element based on the xpath? I keep receiving the following exception: raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchElementException: Message: Una ...

What is the method to display checkboxes using Selenium?

Is there a way to display the Visible Text of all checkboxes on a webpage using Selenium with Java? ...

Is it possible to operate a selenium webdriver without displaying the browser window?

I attempted to find a solution on this website because there is a question that closely resembles mine. Unfortunately, the suggested solution did not resolve my issue. Below is the current code I am working with... Is it feasible to initiate the webdriver ...

Adjusting the size of browser windows to half of the screen with the help of Selenium

Is there a method available to resize two windows to half of the screen size with Selenium? If not, any alternative suggestions are welcome. I am currently working with Python and Chromium, but willing to consider other options. ...

Executing a command on a website by utilizing Selenium with Python

I tried searching by class name but had no luck: from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC button_loc ...

Timeout reached during Protractor testing on an Angular webpage

I have developed a basic Angular portal page. The main feature is a search bar where users can enter the name of an NBA team like "Chicago Bulls", "Indiana Pacers", etc. Upon submitting the team name, users are directed to a second page where they can view ...

Obtain the title of a Youtube video with Selenium in C#

Hey there, I'm currently working on using C# Selenium to extract the title of a YouTube video. Unfortunately, the methods I've tried so far haven't been successful. I've already tested getting the text from other elements and it works f ...

What is the best way to activate a click event using Selenium's `onclick` method?

I am trying to activate the function cmd('abcdef:perxform',{'id':'5'},true). html code ---> <div class="abcdef_button_small" onclick="if (!check_health(1,3)) return; if (!check_timers(1,$(this))) return ...

Executing a Selenium script in C# to select the radio button labeled as Yes

Can someone help me write an XPath for the 'Yes' label in green color on the UI image? I am new to automation and would appreciate any assistance. Below is my HTML code and UI snapshot: https://i.stack.imgur.com/affN5.png https://i.stack.imgur. ...

Retrieve the XPath for a RadioButton that is wrapped within an INPUT tag and enclosed in a

I am facing an issue with the following code where I need to select a radio button based on the label of the button next to it: <div class="formclassname"> <input name="radiobutton" type="radio" class="classname& ...

Having trouble executing a flawless loop roll

I have successfully developed a Python script using Selenium to extract phone numbers from a website. The process involves entering city names into a search box and hitting the search button. I tested it with "Miami" as the city name, but encountered an is ...

Avoiding Selenium POM and TestNG NullPointerExceptions

I am currently working on automating my tests using web driver, testng, and the page factory. However, I have encountered a null pointer exception while executing the code provided below. HomePage Page Object Class This is the page factory class. packag ...

What methods are available for me to apply an assertion specifically on the type of currency

Currently, I am hardcoding currency values like USD and CAD to perform assertions on the type of currency I receive from the application response. While using an XML file to store all currency types for comparison is possible, it seems like overkill for ju ...

The element within the iframe is elusive to Selenium

Having trouble locating the element beneath an iframe even after switching to the frame. see screenshot here The HTML code can be found at: http://pastebin.com/AShYrdxQ ...

Determining Visibility in Selenium: isDisplayed() or isVisible()?

Can you explain the distinction between isDisplayed() and isVisible() functions in Selenium? These two methods are commonly employed to determine whether a web element is hidden on a webpage or not. ...

Tips for extracting the text from the initial URL of a soccer games lineup with Selenium and Python

Hello, I am attempting to execute a Python script on an Apache2 server running Ubuntu. Below is the configuration of the server taken from the file 000-default.conf: <Directory /usr/lib/cgi-bin/> Options Indexes FollowSymLinks ExecCGI AddHand ...

Python is a powerful language that can be used to capture and analyze

I am using a WebDriver through Selenium to automate opening a browser, directing it to an IP address, performing various tasks, and then closing it. My goal is to track all URLs accessed during this process. This includes any ads that are displayed, CSS c ...

Selenium: The code fails to execute a specific function

I am facing an issue with my script. The code between the specified problem-comments is not executing as expected. This script is designed to log into the Yandex-mail page (), locate the search-field for mails using XPath, click on it, and input the text " ...

Can Selenium in Python be used to access Chrome's inspect element feature?

Trying to access the inspect element feature in a Chrome browser for a project, but encountering difficulties. Attempting to use F12 or Control+Shift+i does not yield any results: action = ActionChains(driver) action.send_keys(Keys.F12) action.perform() A ...

Activate Python button on click::Preceding

I have been trying to make this code work recently but I am facing some difficulties. It seems like my code is not functioning properly. Here is the code snippet that I have experimented with for Button::before... The send button should only appear when I ...

Protractor unexpectedly giving back a promise instead of the expected attribute value

I'm facing a challenge where I am attempting to extract the value of an HTML attribute and store it in a variable named url_extension. However, instead of getting the desired value, I keep receiving a Promise object. Below is my code snippet: (Please ...

Prevent the opening of tabs in selenium using Node.js

Currently, I am using the selenium webdriver for node.js and loading an extension. The loading of the extension goes smoothly; however, when I run my project, it directs to the desired page but immediately the extension opens a new tab with a message (Than ...