Questions tagged [selenium-webdriver]

10844 questions
1

votes
2

answer
1.1k

Views

Opening several URLs in same tab one by one using Selenium Python

This is my script where a JSON file contains all the URLs to be opened. What this script does is, it opens a URL takes screenshot and closes it; then opens a new one and so on. What if I want to keep using the same browser session for all these URLs. Like Go to site 1, take screen cap. Now go to sit...
Firaun
1

votes
1

answer
766

Views

selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element while trying to click Next button with selenium

So Im trying to I click the next button using selenium, I've tried with the code below, but it ends in error. The element My code driver.find_element_by_name('submitNext').click() But then it outputs these errors Traceback (most recent call last): File 'C:/Users/thomas/PycharmProjects/test/mainapp/m...
Thomas
1

votes
1

answer
163

Views

Capturing JSON data from intermediate events using Selenium

Below I have setup a script which simply executes a search on a website. The goal is to capture JSON data utilizing Selenium from an event that is fired from an intermediate script, namely the POST request to 'https://www.botoxcosmetic.com/sc/api/findclinic/FindSpecialists' as seen in the included i...
ikemblem
0

votes
0

answer
4

Views

Unable to Select from drop down using visible text in RobotFramework

In Robotframework, I am able to select a value the from drop down only by using 'Select From List By Index, Select From List By Label and Select From List By Value'. But my xml doesn't contain any Label or Value. So, is there any keyword to like Select From List By Visible Text to select by visible...
King
1

votes
2

answer
768

Views

navigating through pagination with selenium in python

I'm scraping this website using Python and Selenium. I have the code working but it currently only scrapes the first page, I would like to iterate through all the pages and scrape them all but they handle pagination in a weird way how would I go through the pages and scrape them one by one? Paginati...
Abdul Jamac
1

votes
3

answer
734

Views

How to sleep webdriver in python for milliseconds

I am using the time library in my script: import time time.sleep(1) It can sleep my webdriver for 1 second but I need to sleep it for 250 milliseconds.
Ali Rehman Sarooya
1

votes
2

answer
71

Views

TypeError: 'str' object is not callable using Selenium through Python

When I try to do code shown below I get error : TypeError: 'str' object is not callable email2_elem = driver.find_element_by_xpath('/html/body/div[1]/div[2]/div[1]/div[1]/div[1]/form[1]/div[1]/input[1]').text()
szymond45
1

votes
1

answer
32

Views

What is difference between ExpectedConditions.refresh and ExpectedConditions.stalenessof

Could you please help me to understand the ExpectedConditions.refresh and ExpectedConditions.stalenessOf.
Sai
1

votes
1

answer
40

Views

Selenium xPath text concatenation

I'm trying to find an element by it's text. However I'm facing a problem with concatenating two part of the 'inner' text inside an element: 'Copied' '!' If I'm trying: '//p[contains(text(),'Copied!')]' nothing is being found '//p[contains(text(),'Copied')]; - works correctly '//p[contains(text()...
Ixi11
0

votes
0

answer
2

Views

[email protected] webdriver-start: `webdriver-manager start`

eu estou tentando subir o servidor selenium pelo comando 'npm run webdriver-start' já fiz o comando 'npm run webdriver-update' mas nada adianta Já fiz um npm-i, já deletei o repositório e fiz novamente, nada adiantou esta é a imagem do erro
sr.tiedt
0

votes
0

answer
13

Views

What are some real-time examples of OOPs concepts used in the automation framework using selenium with java?

I have been working as Manual tester for a quite sometime and also worked in few automation projects using Selenium with Java. Recently, I was attending few Automation interviews as I wanted to shift to Automation using Selenium with Java. I faced following question in the interview 'What OOPs conc...
Sri
6

votes
4

answer
1.4k

Views

Invalid or corrupt jar file when trying to start selenium server from intelliJ

I am trying to start my selenium server from intelliJ and it is saying the file is corrupt. I use intelliJ to run my protractor tests, and I start the selenium server from the intelliJ terminal before I run them. For whatever reason it is saying my jar file for selenium-server-standalone is coming b...
P Jones
1

votes
3

answer
6.5k

Views

Best Way to Reset Browser State in TestNG with Selenium and Java

Can someone recommend the best way to 'tearDown' in the @AfterClass with testng? I occasionally get a hung window or popup and can't get back to the homepage to logout gracefully for the next class to start and avoid modal dialog errors. I've tried getting a window handle on the homepage, then one...
M_Tech
1

votes
1

answer
2.6k

Views

Get attribute using PHP Selenium Webdriver?

i am trying to get an attribute and store it in a variable using PHP Selenium Webdriver (Facebook wrapper) This is my code but it gives me error below: $attr= $driver->findElement(WebDriverBy::cssSelector('.image-e5')->getAttribute('src')); HTML ERROR Fatal error: Call to undefined method WebDriverB...
condo1234
0

votes
0

answer
6

Views

How to fix “missing an NUnit assembly reference?” error when using SpecFlow

I am new to SpecFlow. I had installed the required NuGet packages for SpecFlow and NUnit. When I had clicked on Build, Visual Studio 2017 is throwing the below errors: 'Error CS0234 The type or namespace name 'TestFixtureTearDownAttribute' does not exist in the namespace 'NUnit.Framework' (are yo...
Abhi3106
0

votes
0

answer
4

Views

why the selenium webdriver is throwing str typeError?

I am trying to read a web link from a file. My file handling part is working properly. But I am facing issues when I am trying to read the link in my driver.get() function. Below is the code : file = ('/root/PycharmProjects/rest_project/blaze.txt') with open(file, 'r') as fo: lines = fo.read() urls...
user3521180
1

votes
2

answer
13.9k

Views

How to read the pdf file using selenium

I am working on web page over which there is a link, clicking on which it opens a pdf file on new window. I have to read that pdf file to validate some data against the transactions done. One way is to download that file and then use it. Can any one help me out on this. I have to work on IE 11 Tha...
Bugasur
0

votes
0

answer
13

Views

Selenium won't locate element with any method

I'm having trouble having selenium locate an element on a website (gleam to be exact). Ideally I would like the driver to send keys to an input field, but selenium won't locate it for some reason. I've already tried locating by ID, Xpath and by name. Any suggestions on how to locate this element? He...
ml2017
1

votes
1

answer
1.2k

Views

how to customize TestNG report result with json format

I am working with TestNG and selenium webdriver java. I want to make a output report in json format, can testng make a report with json format?Please suggest me a example for this issue.
beginerdeveloper
1

votes
3

answer
54

Views

Why no elements can be tergeted on this website?

I'm trying to use selenium to type in data in inputboxes. But I cant get any element (NoSuchElementException). Problem is only with this site. I tried searching by name/id but it failed. WebDriver driver = new FirefoxDriver(); driver.get('https://ekrs.ms.gov.pl/web/wyszukiwarka-krs/strona-g...
1

votes
3

answer
79

Views

How to select element from drop-down menu via selenium and python?

i am trying to play with autologin tests via selenium driver and python. I am using this site https://invoiceaccess.pgiconnect.com/ What i did: from selenium import webdriver driver = webdriver.Chrome() driver.get('https://invoiceaccess.pgiconnect.com') driver.find_element_by_id('LoginId').send_keys...
Piduna
1

votes
1

answer
87

Views

isEnabled() method always returns true

I want to get the list of Strings for which the check boxes are enabled. But when i use isEnabled(), it always return true even for the disabled check boxes. And in output i get the list of all Strings present in that field. Below is the code which i have written for it:- @FindBy(css = '[class *= 'C...
shashank sinha
1

votes
2

answer
49

Views

Trouble getting the second link when the first link contains certain keyword right next to it

I've created a script in python in association with selenium to get the first link (populated by duckduckgo.com) of any search item unless the keyword Ad is right next to that link like the image below. If the first link contains the very keyword then the script will get the second link and quits. M...
robots.txt
1

votes
3

answer
75

Views

How many Selenium driven automated browser can be initiated on a single computer at the same time [closed]

Can anyone help me to calculate how many Selenium driven automated browser can be initiated on a single computer at the same time? Note: If it matters, I am using ChromeDriver and Chrome for this purpose through C# Selenium bindings.
Riza
1

votes
3

answer
152

Views

Can't click a button with javascript using execute_script Selenium

I'm trying to get rid of cookies popup by accepting cookies and clicking confirm. I don't have any problem with clicking an input 'zgadzam się na', but clicking a button 'potwierdź'seems to be impossible. My code: from selenium import webdriver from selenium.webdriver.common.by import By from sele...
Vickers213
1

votes
0

answer
37

Views

How to run a timer on multiple selenium windows? (Selenium Java)

The goal of my program is it to open two firefoxdriver windows and have them both click a button at a certain time (11am for example) How can I achieve this? This is what I have so far, but it doesnt work and I'm not sure how to fix it. public class Timetest { public static void main(String[] args)...
hypecode
1

votes
2

answer
409

Views

click on a <a> tag with selenium c#

I am trying to click on a tag but when I am trying to access it by ID i got an error that says Unable to locate element. I am using selenium c# in unit test project. the code to make the click is the followining: IWebdriver.FindElement(By.Id('BUTTON_OPEN_SAVE_btn0_acButton')).Click(); and tag cod...
user6336440
1

votes
0

answer
136

Views

localStorage access from firefox extension scope

I have a Selenium program running Chrome/Firefox web drivers with my extension on each browser. The extension is generic and each time the program runs it loads different config to the extension using localStorage. The flow is: Start the web driver with the extension installed. Navigate to a web pag...
Adi Ohana
1

votes
1

answer
265

Views

can't download .XLS file from url using selenium python. Always end up with Firefox download popup

I have tried various methods but I'm unable to download excel file. I always end up with the firefox popup staring at me. any Idea how to get this working import time from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By fr...
Rahul Mishra
1

votes
1

answer
183

Views

How to solve StaleElementReferenceException error

I am doing the automated testing using visual studio. While getting the inner element value it's showing this error. It's not showing this error all the time but sometimes it's successfully tested. OpenQA.Selenium.StaleElementReferenceException occurred HResult=0x80131500 Message=stale element refer...
Mutu Arron
1

votes
2

answer
125

Views

How to write Selenium Java Application code in IDE through main() and TestNG

I m facing the below issue searched in Google couldn't find the clear answer how to resolve this. Error : org.apache.bcel.verifier.exc.AssertionViolatedException.main(AssertionViolatedException.java:102) Code import org.openqa.selenium.chrome.ChromeDriver; public class Newtours { public static C...
Fouziya Hanif
1

votes
0

answer
238

Views

Geckodriver error when script runs from cronjob

I have python script which run absolutly fine when we execute it manually. However when we schedule it to run from cronjob it fails with driver = webdriver.Firefox(firefox_profile=profile) File '/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py', line 148, in __init__ s...
Jaydeep Chaudhari
1

votes
2

answer
403

Views

How to find and click on HTML image element

I'm new with Selenium and struggle with this one for few hours. I have an HTML page that contains icon and stream view (both images), the browser view is on 100% and I would like to modify it and make it smaller, it can be done by changing browser zoom, modifying CSS property or clicking on the ima...
Tzahi Kadosh
1

votes
2

answer
197

Views

How to handle back to back alerts on selenium webdriver automation

Scenario: On Perform Click -> Alert1 is displayed On Accept Alert1 -> Alert2 is displayed I am able to accept alert1 but when I write code to handle alert2 also then None of alerts are accepted. Tried different from Google but nothing works Different combination with thread.sleep and wait etc but no...
pratap88bhanu
1

votes
1

answer
87

Views

Failing to automate ng2-dnd using selenium and java

Could you please help me in automating the drag and drop using selenium and java. http://akserg.github.io/ng2-webpack-demo/#/dnd The similar example we are using in our project but we drag and drop is not happening and we have tried in different ways to find the solution but no use. If anyone of you...
Saikumar Jalda
1

votes
1

answer
196

Views

How to test our chrome extention with selenium tool?

I built a Chrome-extension, and I would like to make an automatic Selenium test, in order to test it. This is the code I wrote in java: public static void main(String[] args) throws InterruptedException { WebDriver Driver = null; System.setProperty('webdriver.chrome.driver','chromedriver.exe'); Driv...
Sivan Mednyk
1

votes
2

answer
566

Views

login to Yahoo using Python Selenium

My question actually is the same as this one login to yahoo email account using Python Selenium webdrive But since Yahoo has changed its login form UI, the answer provided in the above link doesn't work to me. Instead I tried the below code. from selenium import webdriver from selenium.webdriver.com...
XiaoShu
1

votes
1

answer
1.2k

Views

Error after starting Selenium with chromedriver on debian 8

I'm trying to use Selenium with Google Chrome. It works perfektly on my computer but it won't run on my Debian 8 64 bit server. But on the server I get get with the following code this error. [email protected]:/opt/SupportBot# java -jar /opt/web/googletest.jar Starting ChromeDriver 2.34.522913 (36222509aa6e8...
Mathias
1

votes
0

answer
84

Views

Selenium reuse brower from 2 different application

I'm trying to open 2 different tabs in the same browser session from 2 different application. I'm using Firefox v57.0, Geckodriver v0.19.1, Selenium v3.8.0.0 The 2 apps are playing in the same time. I'm just trying to open a new tab from app 2 X seconds after App 1 open the first tab. App 1: Firefo...
John Daves
1

votes
2

answer
79

Views

How to read the file name in a directory and print as output using timestamp [closed]

I have a particular folder(Test) in my D drive. Every week a new folder gets created inside test like 1234,4231,etc. I want to write a python script which can print the folder name recently created. I was able to do upto this. import os for file in os.listdir('D:\Test1'): if file.endswith('.txt'):...
Sidharth Gokul

View additional questions