Questions tagged [selenium]

26164 questions
0

votes
0

answer
3

Views

What is the best practice for using Firefox's geckodriver in a Selenium Automation Framework?

I've started trying out Selenium with Firefox and I've gotten it to work by downloading the gecko driver and referencing the file path in my code (I'm using C#): FirefoxDriverService service = FirefoxDriverService.CreateDefaultService(@'C:\mypath\'); IWebDriver driver = new FirefoxDriver(service);...
Wookovski
1

votes
2

answer
674

Views

Selenium find element_by_id not working with radio buttons

So I've been working with Selenium in Python. I finished my code (which worked at the time) but suddenly it chose not to work anymore. To be specific: If I try: driver.find_element_by_id('leasingtrue').click() It returns me the error: selenium.common.exceptions.ElementNotInteractableException: Mes...
user9349795
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
128

Views

Selenium - Obtain app version from .apk files

I am running Android tests using Selenium and Appium. Would like to know how to programmatically obtain the Android app version given then .apk file. OR, if this info could be obtained through Appium that would work as well?
Wes
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
597

Views

How to run Angular6 E2E tests on Alpine Linux

While trying to run E2E tests using Alpine Linux we have the following mysterious error: E/launcher - spawn (...)/selenium/chromedriver_2.40 ENOENT How to reproduce docker run -it --name my-alpine --rm alpine:latest /bin/ash apk add --update nodejs nodejs-npm chromium \ && export CHROME_BIN=/usr/bin...
hamilton.lima
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
1

answer
59

Views

Geb, Spock, Gradle and maxParallelForks

I am having some trouble understanding an issue we are having with our Geb/Spock tests. We are using gradle and we are trying to run our tests in parallel. As I understand it, the maxParallelForks property in gradle will run test classes in separate JVMs. The issue I am running into is when I ha...
jcattau
1

votes
2

answer
217

Views

org.apache.commons.exec.ExecuteException: Process exited with an error with ChromeDriver Chrome Selenium and TestNG Suite

I am observing below error when I am executing TestNG suite through TestNG XML. SEVERE: org.apache.commons.exec.ExecuteException: Process exited with an error: -1073741502 (Exit value: -1073741502) FAILED CONFIGURATION: @BeforeMethod initializetest org.openqa.selenium.WebDriverException: Timed out...
Kovid Mehta
1

votes
2

answer
85

Views

How to get all children of element in Katalon Studio

I would like to find all elements within a root div element. This is what I am doing: @Keyword public boolean verifySlotsOrder(int numOfSlots){ WebDriver driver = DriverFactory.getWebDriver() WebElement slotsGrid = driver.findElement(By.id('js-' + numOfSlots + '-grid')) List children = slotsGrid.fi...
Zymeriath
1

votes
1

answer
36

Views

How to integrate log4j with TestNG?

I am trying to run my selenium-testng program using log4j.properites. i would like to know how to integrate my testng class with log4j.properties. I have create a sample google logintest using testNG I have created log4j.properties under src/main/resources I have written logger piece for code Logger...
Chaitanya Maligi
1

votes
2

answer
52

Views

How to access to 'rect' type element through Selenium-Python

There is a rect object in the dom: I am trying to search it with following code: WebDriverWait(driver, 1).until(ec.presence_of_element_located(('xpath', '//rect[@id='id123']'))).click() This does not work. But the following does: WebDriverWait(driver, 1).until(ec.presence_of_element_located(('xpath'...
barry_allen
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
2

answer
94

Views

How can i get only name and contact number from div?

I'm trying to get name and contact number from div and div has three span, but the problem is that sometime div has only one span, some time two and sometime three span. First span has name. Second span has other data. Third span has contact number Here is HTML beth budinich See listing website (2...
Zubair Farooq
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
3

answer
27

Views

How to select from drop-down list through Selenium?

I'm trying to select a value from a drop-down list that indicates the number of posts that are displayed from the website. Show items: 15 30 60 90 120 150 I want to change this so that the last option is selected. Through other answers I've tried to the following solution: from selenium.webdriver.s...
ThomasWear
1

votes
1

answer
39

Views

Actual result and Expected result show

enter code here`I have run my code for selenium webdriver IO and also install chrome driver in npm i want to test title of google site.but when i run this code it will display this message 2019-04-09T06:56:33.109Z INFO webdriver: [POST] http://0.0.0.0:4444/wd/hub/session 2019-04-09T06:56:33.113Z INF...
nilam
1

votes
1

answer
44

Views

How to fix “Clone.Bitmap” system out of memory in C# [duplicate]

This question already has an answer here: C# Bitmap/Graphics Out of Memory 1 answer c# Out of Memory Exception with System.Drawing.Image 3 answers C# Image.Clone Out of Memory Exception 6 answers On VS Code, I would like to set up UI tests on the app's visual by taking the app's screenshot elemen...
GioOps
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
1

votes
1

answer
52

Views

$x() always returns ƒ (){} in Chrome Developer Tools console on gmail page

$x('//div') always returns ƒ (){} in Chrome Developer Tools console on gmail page. For that matter it returns empty function for any locator. Whereas same locator $x('//div') on a jira page correctly returns array of all divs. Chrome 73.0.3683.103 MacOS 10.14.3 Mojave Any clues? BTW, this locator i...
Sameer Naik
1

votes
3

answer
57

Views

Input into hidden textbox and hit enter (Selenium, Python)

I'm trying to input the text string 'L62T18H029-P3215' into the search input box on this website https://lamerfashion.com and press Enter. I have tried to execute some javascript to change the value of the hidden element however I am unable to make Selenium send the ENTER key to submit. driver = web...
Anh Quoc Vo
1

votes
2

answer
58

Views

Is there any way to give limit time for Selenium to find element/s?

I am trying to automate Google Maps using Python Selenium Chrome driver, my code is stable to get what I need, but not the performance time. I use iterative code to get merchants data over Google Maps, the time rate of getting 1 merchant data is below 1 second using Selenium, but when the code caug...
1

votes
2

answer
23

Views

'Connection aborted.', ConnectionResetError(104, 'Connection reset by peer') using Selenium with ChromeDriver and Chrome through Python

The code below is executed in a loop, where 10-15 local .html files are opened and an image of each is saved as a .png. Ubuntu Server 16.04 ChromeDriver 2.41.578700 Google Chrome 74.0.3729.108 selenium 3.141.0 Python 3.6 The first two files are opened and the image is saved, however the rest re...
DreX
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
5

Views

Failed to load extension from . manifest file is missing or unreadable - no extension name

I am trying to run automated tests using Selenium Webdriver and webdrivermanager (bonigarcia). I am using Ubuntu + IntelliJ Idea. For Firefox, driver is starting without any issues. For Chrome I get the information: selenium webdriver failed to load extension from . manifest file is missing or unrea...
dudziakm
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
0

votes
0

answer
4

Views

How to fix DesiredCapabilities in Selenium 4.0

I have a piece of code which sets browser name for the grid. However, DesiredCapabilities is deprecated in Selenium 4.0. How can I fix this code so that it works as the same in 4.0? DesiredCapabilities capabilities = new DesiredCapabilities(); if (prop.getBrowser().equalsIgnoreCase('chrome')){ capab...
batuarslan
0

votes
0

answer
4

Views

How to select all class that are above certain tag using css selector in selenium python?

here i want to get all the class = 'result-row' which are above the 'h4' tag, not the ones which are below 'h4' tag. my current code selects all of them: section = driver.find_element_by_css_selector('[class='rows']') result_rows = section.find_elements_by_css_selector('li.result-row') so how can i...
zero
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
2

answer
6.4k

Views

How to get the URL of page from WebDriver instance that opens in new window

I am doing automation using selenium. In a scenario when i click on the link from Page ABC, then it opens up the page DEF in a new window. Now, when i use the method driver.getCurrentUrl() then it gives me the URL of page ABC. But i need to check the URL of page DEF. Please help me what should i do.
vipin8169
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
1

votes
4

answer
9.2k

Views

TestNG configuration failure

I am trying to run a simple TestNG test from the command line, it errors with a configuration failure. The same TestNG test will run from Eclipse IDE correctly. From command line it does not work. This is a severe limitation of this TestNG framework making it not very useable in a Continuous integra...
fbc
1

votes
2

answer
2.5k

Views

TestNG try/catch not working properly

I am working on a test automation framework that someone previously built. The framework reads test data from an excel file and uses Selenium webdriver to control the browser and perform tests. I am adding functionality to this framework by adding a TestNG class that reads data from a CSV file. Som...
Student
1

votes
3

answer
1.3k

Views

play DRM content in chrome driver

I'm writing some selenium tests for a HTML5 player playing DRM content, the player works fine in Chrome when I test it manually, but nothing is loaded or played in the latest chrome driver if I run my test cases. Is it because of the drm content isn't authorized to play in chrome driver or something...
nieschumi
-1

votes
2

answer
15

Views

How to simulate specific code part as if previous ones were executed

I'm writing automation code by using selenium web driver in eclipse. as per my assumption, whole case execution time probably will take about five minutes but once my code got error, i have to run it from the beginning after changing the code to see whether changing part is working fine or not. Is t...
santino87

View additional questions