Questions tagged [selenium-webdriver]

10597 questions
1

votes
1

answer
28

Views

Unable to locate an element through Selenium and WebDriver

i am trying to click the save button. but i am not able to click it because before the button it has '::before'. i tried locating using cssSelector and xpath. but i am not able to locate it. can any one help me?
Spartan
1

votes
1

answer
283

Views

Why am I getting this error with selenium chromedriver?

When the code below is executed it opens chrome and the search bar is filled already with this data;,. I haven't mentioned it anywhere in the code still this happens. Moreover, there are few errors that appear each time I try to run the code. var webdriver = require('selenium-webdriver'), By = webdr...
Raj Chandra
1

votes
0

answer
264

Views

Read data from excel spreadsheet in Selenium

I have written code for reading data from excel sheet in Selenium. Login scenarios is working properly, App is taking login's data from excel sheet. Now I have to define that code globally, so I can enter data data in different sheets of excel-sheet for various scenarios. Can you anyone guide me for...
Tester
1

votes
2

answer
279

Views

click on anchor tag having href = '#'

I am using below python code using selenium. click is not working on anchor tag having href = '#' import time import unittest from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import Select from selenium.webdriver.common.key...
user3157061
1

votes
1

answer
118

Views

Any Idea How To Send Selenium WebDriver Logs To Kibana

I never work on Kibana. Can any one help me as per requirement. I need to send Selenium logs to Kibana tool. Currently i am storing all logs in notepad file using printstream. FileOutputStream fos = new FileOutputStream(createLogReport(className)); //-Print on console and write to a file TeeOutputSt...
Tarun Dabbs
1

votes
1

answer
439

Views

How to test drag and drop with Selenium on the react-dnd-treeview library

I'm trying to test a simple drag and drop behavior on a React app. I am using the react-dnd-treeview library and their example website to test my test case. When I run the tests in debug, I don't get any errors and Selenium is able to get the right elements, but nothing is happening, I'm not able to...
Antoine
1

votes
0

answer
38

Views

Selenium does not work correctly with context_click and click

I am writing UI tests for my QT app with selenium + qtwebdriver, and I have one moment in app, which I need to test: user can perform right mouse button click -> some menu showed up and user can click in this menu. I tried this code: #!/usr/bin/env python from selenium import webdriver from selenium...
Dcbnvn
1

votes
0

answer
102

Views

Risks of running selenium chrome driver in head-ded (normal) mode on a remote linux server?

I'm trying to do a particular automation task using python selenium chrome driver. For whatever reason the .click() does not work when I use the web driver in headless mode. So, I dont mind using it in normal mode, but my script needs to run in a remote AWS server. I'm wondering if its safe to do so...
Deepak
1

votes
0

answer
432

Views

Getting “Aw! Snap” issue in Execution of Selenium Automation Suite in Chrome

I am using google chrome driver to automate using selenium. Chrome window always gets crashed in middle of execution when I try to navigate to some other URL. Please note that I get this error only when I try to navigate to same url for the 15th times i.e it works fine till 14th. I am done with upgr...
Raj
1

votes
1

answer
397

Views

How to get rid of the Firefox's “Your connection is not secure” page in “Selenium with JavaScript”

I am trying to automate a https contained url by using Selenium, WebdriverIO and JavaScript, but it started redirecting to Your connection is not secure page. I have tried to set 'security.insecure_field_warning.contextual.enabled': false and some other preferences as well in firefoxProfile, but it...
Pradeep
1

votes
1

answer
76

Views

How to execute Script functions with more params - Selenium

I try execute Script with functions who have more params and every try returns Error: Exception in thread 'main' org.openqa.selenium.JavascriptException: ReferenceError: coords is not defined my script : enter code here if (driver instanceof JavascriptExecutor) { ((JavascriptExecutor) driver) .execu...
Podolanka
1

votes
0

answer
247

Views

Selenium PHP Web Driver (Facebook) issue

I have a problem with web driver startup for selenium on Ubuntu 14.04. I've already installed Oracle JDK and Selenium Standalone Server, also have no issue with running Selenium Standalone Server on Ubuntu 14.04 (I use cloud9 VDS). But when I try to run this example an error occurs (Unable to create...
mr.boris
1

votes
0

answer
214

Views

Initialising PageFactory just once in a separate java class

I am trying to reduce the verbosity in my script, following the Don't Repeat Yourself (DRY) coding practice. I stumbled on a challenge. I have implemented a basic test using selenium and cucumber with pagefactory. I have my page objects in one separate BasePage class and initialised pagefactory in a...
The man
1

votes
1

answer
85

Views

Can't use WebElement Nodejs

On using WebElement img = driver.findElement(By.id('abc')); I get following error - WebElement img = driver.findElement(webdriver.By.id('captchaimg')); ^^^ SyntaxError: Unexpected identifier at createScript (vm.js:80:10) at Object.runInThisContext (vm.js:139:10) at Module._compile (module.js:616:28...
monster
0

votes
0

answer
4

Views

How to access list of text of child node of li element using selenium in c#

Having issues accessing the child node of a li element. Looking to print out all text within a list (which acts as a dropdown on the webpage). But all of the text is within an li element under an a> (the third a> tag) tag. Here is an example of the DOM structure that I am trying to work with. This w...
Brian M.
1

votes
1

answer
931

Views

Python Selenium: OSError: [WinError 193] %1 is not a valid Win32 application

from selenium import webdriver from selenium.webdriver.common.keys import Keys Game_Pin = input('Enter your PIN: ') NickNAME = input('Enter your nickname: ') def Enter_Press(): selenium.find_element_by_name('Enter').click() def Kahoot_Spammer(Game_Pin, NickNAME): chromedriver = ('C:\\Users\\ovvip\\D...
1

votes
1

answer
33

Views

Selenium selecting value from dropdown

How to select an option from this dropdown like this with Selenium CSS picture My problem is about to select one of the options, basically I cannot do it by className because all options have the same className... the only different between them is data_value and span value
Vannia Alfaro
1

votes
0

answer
124

Views

Performance testing with Selenium WebDriver

I am trying to build a test which will fail upon slow / sluggish / jankiness performance of a web page or the elements within it. By 'slow' or 'sluggish' i mean mostly the following: Very delayed response when scrolling down the page Delayed response when clicking an element This sluggishness on par...
Ilan Z
1

votes
1

answer
238

Views

How to create a same instance for multiple classes in selenium webDriver

I had a Base WebDriver class where I had made an interface where I made all implementations, if I create a constructor in the class public class Base { public InterfaceClass driver; public void setDriver(InterfaceClass driver){ this.driver = driver; } } public class Seleniumclass implements Interf...
Jack
1

votes
1

answer
43

Views

Using Selenium Webdriver, grabbing data not showing up in innerhtml

I am trying to use selenium to grab text data from a page. Printing the html attributes: element = driver.find_element_by_id('divresults') Results: print(element.get_attribute('innerHTML')) Results: print(element.get_attribute('outerHTML')) Tried grabbing this element Results: driver.find_element_b...
user9794893
1

votes
0

answer
224

Views

Jenkins hangs when using Chrome but is OK with Firefox

I have a selenium-cucumber project that runs just fine at the command line with 'mvn clean intall' or 'mvn test'. It runs fine with Firefox and Chrome on my machine. BUT, when I installed Jenkins locally on my machine, and run my project with Chrome, it hangs through Jenkins. With Firefox it runs j...
snikt
1

votes
0

answer
37

Views

Error while executing javascript code in python3 while using selenium

I was trying to remove the ad and other pop-up using selenium after opening the webpage. The pop-up is getting removed but the ad is not getting removed. There is some error in executing javascript code(using it remove ad). For which there is no reason given. Also, for the ad, when I open the webpag...
A Q
1

votes
1

answer
81

Views

Using Ruby Selenium to input data from csv file to complete actions until list is complete

I am fairly new to selenium ruby/rspec scripting and I have come across a use case that requires data to be pulled from a csv or xlsx file in the test. Any help or suggestions on how to approach this would be greatly appreciated. The test would pull from the csv file and input data from each row to...
QAguy
1

votes
1

answer
176

Views

Click on a button using Selenium and scrapy spider

I just started and I've been on this for a week or two. Just using the internet to help but now I reached the point where I cant understand or my problem cannot be found anywhere else. In case you didnt understand my program I want to scrape data then click on a button then scrape data until I scrap...
TheZelucho
1

votes
3

answer
74

Views

Rename a file without changing file extension

I have downloaded a csv file(ABC) using python and selenium and need to change the name of the file. Input= ABC.csv #downloaded file with name ABC Output= DEF.csv #New file with name DEF. Any help is appreciated.
1

votes
2

answer
48

Views

How do I locate an element on a web page whose display text is dynamic

How do I locate an element whose content is dynamic. The elements is a cell in a table which gets its value dynamically. Please refer to the below sample code: Above is one among three s in a . The other s have s with the same ids. In other words, The three cells in a row will have three ids. But t...
Gaurav Thantry
1

votes
1

answer
72

Views

Download and rename a number of files simultaneously using Python

I have written a script in python3 that opens a website, logs into it, enter numbers by running through a list list = [1,2,3,4,5,6,7,8,9,10,11] for j in list: enternum = driver.find_element_by_xpath('xxxx') enternum.click() enternum.send_keys(j) and downloads a file after entering each number....
coder_guy
1

votes
1

answer
41

Views

How to use selenium to save files found in links?

In Python 3 I have this code with the use of selenium to automate a search on a site: from selenium import webdriver from selenium.webdriver.firefox.firefox_binary import FirefoxBinary binary = FirefoxBinary('/usr/lib/firefox/firefox') ff = webdriver.Firefox(firefox_binary=binary) ff.get('http://www...
1

votes
1

answer
34

Views

Selenium : Check an Element present at any point of time

I'm looking for some cucumber tag like @During where it checks for an element at any point of time.For example,this code will run at all line of my test and incase the alert is present i want to do some action on that point. public boolean isAlertPresent() { boolean presentFlag = false; try { // Ch...
Helmi Firdaus
1

votes
1

answer
82

Views

Webdriver - Cannot locate Xpath/CSS getting NoSuchElementException [duplicate]

This question already has an answer here: NoSuchElementExeption, selenium unable to locate element 2 answers I am new to selenium and trying to find the correct xpath or CSS for the html code below and after spending so much time and after numerous trials I was not able to click on these elements a...
AmKu
1

votes
1

answer
36

Views

Python with Selenium Assertion Raises or Exception has never worked

I have an issue with Selenium and Python. I don't know why either exceptions or Assertions that I include in my code are not taken. This mean that default exception/assertion behavior is follow instead of taking the behavior that I 've defined. For instance, in the following case I want that when so...
1

votes
3

answer
908

Views

Unable to locate element inside a frame in selenium [duplicate]

This question already has an answer here: Unable to locate an element using xpath error in selenium-java 4 answers This is the code I have written. public WebDriver createPart() { try { driver.findElement(By.id('username')).sendKeys('502409373'); driver.findElement(By.id('password')).sendKeys('Magi...
kiran kumar
1

votes
2

answer
125

Views

Selenium Scroll ScrollTable to target element

I am using Selenium WebDriver with Java with ChromeDriver. I want to click on a cell in the table shown below, but because the table overflows and has a scrollbar, there is no guarantee the cell is actually in the view. I get the cell by its XPath based on some parameters relevant to my project. I t...
Special K
1

votes
0

answer
190

Views

getting “GDK_BACKEND does not match available displays” even though Xvfb display is present

I'm running selenium tests on headless firefox inside docker. For that I have installed firefox and Xvfb inside docker and export display using Xvfb command when I run the container. The issue is, when I run the docker container locally, selenium is able to find the display but when I run the docke...
Girish
1

votes
1

answer
414

Views

Using JUnit @BeforeClass with Cucumber…does it work?

Currently my driver is set at the @Before method - @Before('@setup') public void setUp() { driver = utilities.DriverFactory.createDriver(browserType); driver.manage().deleteAllCookies(); driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); driver.manage().timeouts().pageLoadTimeout(30, T...
snikt
1

votes
4

answer
702

Views

IF ELSE condition with Selenium (C#) when an element is not present

I am using Selenium with C# on NUNit framework and I am trying to put an Conditional statement looking for an element (banner to be specific). I already have a piece of code to click that banner and go forward in my test flow. Now, I am after a condition that IF that banner is not present THEN user...
SymboCoder
1

votes
3

answer
365

Views

Unable to open browser in selenium, throws a “null” message

I have a framework that uses POM model and I have used a Utils folder structure which has DriverFactory,Constant and ReadConfigFile java files that configures and opens the browser. (code below) Now before I did this (introducing the Utils package) the code was running fine and after introducing the...
moh17
1

votes
0

answer
237

Views

Managing Chrome policies via Selenium Webdriver

Is there a way to modify policy settings for Chrome instances in a way that remote ChromeDriver on Selenium Grid would understand? Modifying the registry on a Selenium Node would probably work, but could I pass the required settings through Selenium server somehow? https://www.chromium.org/administr...
JockX
1

votes
1

answer
68

Views

Error in selenium driver select

I have a code that enters a portal with 4 different credentials, the first fails and then the others do everything right. On the portal page I have the name with the name 'cboLocales': Seleccione Locales Seleccione Formato de local Por grupo de Productos Por grupo de categoría Seleccione y So...
Onlikes
1

votes
0

answer
141

Views

How to get AJAX URL with Selenium (Python)?

Is there a way to get the outgoing AJAX request URL using Selenium? For example, when I click a button, it generates a AJAX request to get some data. How can I use Python to determine that GET request URL?
Sam McC

View additional questions