Questions tagged [selenium-webdriver]

1

votes
3

answer
4.4k

Views

How to hide Chromedriver console window?

I have a simple Python script which uses selenium and webdriver to open up Facebook in a Chrome window and log in automatically. When I run it, the Chromedriver console window opens up and stays open even after the entire program has finished execution, until I close it myself. Is there a way to h...
Akshay Damle
1

votes
1

answer
3k

Views

Test an application behind a proxy server using Robot Framework and Selenium2Library

I'm testing a web application behind a proxy server using both Robot Framework and Selenium2Library. In fact when the proxy is enabled in browser connexion setting , the keywords "Open browser" failed when I disabled the Proxy server option , the browser windows is getting opened but i am not able t...
Imen CHOK
1

votes
6

answer
19.6k

Views

How to locate an element using selenium webdriver which doesn't have unique identifier like Name, Id, title etc?

I am new to Selenium. Not sure how to handle this scenario. I am working on a website which has several buttons with following code, Book Ticket Book Ticket I tried to click on it using following commands, ele = driver.FindElement(By.ClassName("Some big class name")); but it fails with following m...
Amit
1

votes
1

answer
7.3k

Views

nknown error: Runtime.evaluate threw exception: SyntaxError: Unexpected token var

I have this code: JavascriptExecutor javascriptExecutor = (JavascriptExecutor) driver; // javascriptExecutor.executeScript("W.setOffer({offer: {kind: \"coupon\", title: \"Hello\", availability: " + // "\"available\"}},{})"); String script = "var aLocation = {}" + "var aOffer =...
Elad Benda
1

votes
2

answer
879

Views

Selecting element in WebdriverIO based on tag value

Consider the following HTML sample: Select... Mr Mrs Second Lieutenant Able Seaman Abbot How can I select the value as MR, or Second Lieutenant using WebdriverIO? I have tried using .selectByValue([ng-model="form.fields[\'ReportingParty.Contact.Title.Text\'].value "], "MR" ), but it didn't work.
Preethi
1

votes
1

answer
1.4k

Views

Custom useragent in nightwatch

Is there a way to set a custom useragent for just one test in nightwatch? I want to test a page using both mobile and non-mobile useragents to ensure the proper experience is shown. I tried setting it as a cookie but it didn't work: browser .setCookie({ name : "User_Agent", value : "iphone",...
Razor Storm
1

votes
3

answer
4.8k

Views

How to find the count of multiple buttons on a webpage using Selenium Webdriver

I have 4 Upload buttons on a webpage. Each of the upload button has the common functionality of uploading a file. I am unable to get the count of these buttons using Selenium webdriver. The id of the buttons are: buttonUpload_1 buttonUpload_2 buttonUpload_3 buttonUpload_4. The common entity for th...
B Ashwin
1

votes
2

answer
313

Views

Python + Selenium WebDriver - Get div value if sibling contains string

I am trying to get a value from a div in a web page using Python/Selenium where class names are repeated but contain unique strings, such as the structure below.. 1 5.00 2 2.00 How do I get the value of 'Col_Val' from only the div that contains "col_Num = 1"? (the value 5.00 should be returned a...
user1763328
1

votes
2

answer
7.8k

Views

Getting error :name 'webdriver' is not defined for appium

I was recording a sample script through appium Inspector and while I was running, I am getting an error like this. My Script is in python language. File "second.py", line 14, in wd = webdriver.Remote('http://0.0.0.0:4723/wd/hub', desired_caps) NameError: name 'webdriver' is not defined Below is my...
hari madhav
1

votes
1

answer
1.1k

Views

How to click on a link which contains a variable into “href” attribute?

I am writing acceptance tests using Selenium + WebdriverIO. And I have some problems with that - I can't click on this link client.click('a[href=#admin/'+ transactionId + ']') transactionId - it is a variable which contains ID of transaction. My HTML code: ... Today 10:23 N/A Artem Artem Arsenowitch...
Arsenowitch
1

votes
2

answer
21

Views

ImportError: No module named 'selenium' in PyCharm

I have installed all the file and packages like python, pip, selenium and i am running a python code in PyCharm, but it is still showing me this error whenever i run my code. Error showing while running python file. Traceback (most recent call last): File "C:/Users/aman.k/PycharmProjects/SeleniumScr...
Aman Kumar
-1

votes
1

answer
14

Views

Is there any function that will find all the anchor elements from a webpage and get all the css selectors of that elements in selenium

Is there any way to click all the anchor tags which are present on the page Page Title SUCCESS SUCCESS SUCCESS SUCCESS SUCCESS
Pushpak
1

votes
2

answer
3k

Views

Not able to inspect elements on alert box/pop ups using firebug

I am trying to learn selenium and uses firebug to inspect elements on the page. However, whenever there is any pop up or alert message, I am not able to inspect it as it does not allow me to click on inspect element without clicking OK on the popup. I need to automate this clicking of OK button but...
user2557912
1

votes
3

answer
8.5k

Views

How to compare two images using Selenium

I like to compare two images. imagemagic tool does this for me using cmd prompt. it compares two images (for e.g. a button's position is different) and output the result image in new gif image which highlights the difference. However i want some tool which generate the new image like this however on...
Pawan
5

votes
3

answer
268

Views

Can't store downloaded files in their concerning folders

I've written a script in python in combination with selenium to download few document files (ending with .doc) from a webpage. The reason I do not wish to use requests or urllib module to download the files is because the website I'm currently palying with do not have any true url connected to each...
robots.txt
1

votes
2

answer
24

Views

chromedriver using selenium for scraping

I m simply trying to load chrome web driver using selenium in command but getting an error 1)I have updated my chrome browser and webdriver to the latest version 2)checked by using the same version of chrome browser and driver from selenium import webdriver driver=webdriver.Chrome('C:/Users/prasun....
Prasun Jain
1

votes
2

answer
456

Views

How to click an element which is loaded through Ajax through webdriver within Chrome

Browser : Chrome V65 ChromeDriver: chromedriver.exe 2.37 Error occurs while webdriver trying to click an element. The below is my click(): def click(self): try: self.wait_for().visible() self._selenium_context().click() except Exception as e: raise NoSuchElementException def visible(self): ''' C...
cindy
1

votes
2

answer
122

Views

In Selenium how does ChromeDriver executable finds Chrome browser?

For Selenium, we define the chrome executable path in System.setProperty. When a URL is passed in driver.get and Chrome invokes: 1 - How does chrome executable know where Chrome browser is actually installed? 2 - What would happen if I do not have Chrome browser? Responses appreciated!!
user10336830
1

votes
2

answer
37

Views

SyntaxError: invalid syntax while using find_element_by_xpath using Selenium in Python

Code Trials: from selenium import webdriver driver = webdriver.Firefox() driver.get("http://www.niftyindices.com/reports/historical-data") driver.maximize_window() driver.find_element_by_xpath("//*[@id="ddlHistorical"]").send_keys("NIFTY 100") I am getting an error: File "", line 5 driver.find_eleme...
Shahnawaz Khan
0

votes
0

answer
8

Views

C# Windows Service use Selenium to open Chrome browser to grab data

I can't get windows service to open a Chrome browser. I am running the service as my main account which has admin credentials. It just hangs when it gets to IWebDriver browser = new ChromeDriver("Drivers", chrOptions); All the Selenium Code below. ChrDir = @"--user-data-dir=C:\Users\Me\AppData\Local...
bigdonk
0

votes
0

answer
4

Views

I have to click and hold at (x,y) position and drag and drop to another (x,y) position while automating webpage

“I have to click and hold at (x,y) position and drag and drop to another (x,y) position while automating webpage. Is there any way i can do that? tried doing actions class but that is not working as it asks for source web element. Can i do it in anyway by using js or something else?”
krishna chaitanya
0

votes
0

answer
4

Views

Why the element cannot be located in method function in selenium?

I already create a method to get the transaction ID but the element cannot be located. I cant retrieve the ID in the web table because it shows an error that unable to locate the element. Besides, it will open another blank window. This is the method to get the ID public String getTransactionID(Stri...
Fatin Shafiqah
1

votes
2

answer
1.8k

Views

Selenium not waiting for page to load

I'm doing some tests with Selenium, and the tests have to login to a system. This login takes 17 seconds to fully happen. The system has to wait for it to finish, otherwise the whole test fails. I've tried many ways to do that, but all of them fail. First code I've tried was this: driver.manage().ti...
Alexander Rumanovsk
1

votes
1

answer
102

Views

How to differentiate between web elements that contain the same class

I want to make a list of elements that contain all the elements from these web elements: and I use the syntax: list = driver.find_elements_by_class_name("league-item-block") The problem is that also have the web elements: The list that is created contains these elements, and I do not know how to av...
Mihai Moldovan
1

votes
1

answer
1.3k

Views

How to enable an “allow-insecure-localhost” flag in Chrome from selenium?

I want to enable "allow-insecure-localhost" flag from selenium. How I can do it? selenium: 3.12.0, Python:3.6.5 Chrome driver creation code: def create_driver(): options = Options() if sys.platform == "darwin": options.binary_location = '/Applications/Google Chrome Canary.app/Contents/MacOS/Google...
KiYugadgeter
0

votes
0

answer
21

Views

Upload Images through Url in selenium Webdriver using Python

driver.find_element(By.XPATH, "//*[@id='upl-zone']/input").send_keys("https://ercess.com//images//events//-Blockchain-2019-36613-banner.png") Is there any way to make that work ? [ERROR] selenium.common.exceptions.InvalidArgumentException: Message: File not found: https://ercess.com//images//events/...
Nitish
1

votes
1

answer
1.3k

Views

Rails: Selenium::WebDriver::Error::WebDriverError: not executable: 'chromedriver-helper'

I've setup Rails environment two days ago and I thought things were going fine but then when I ran rake test command it got aborted due to this load error: Bundler::GemRequireError: There was an error while trying to load the gem 'chromedriver-helper'` `Caused by: Selenium::WebDriver::Error::WebDriv...
Hajar
1

votes
1

answer
127

Views

Failed to load resource: net::ERR_UNKNOWN_URL_SCHEME when rendering jstree with with capybara and headless chrome

Recently I switched to headless chrome in my rspec tests. After the move all my tests which interact with jstree element started to fail. Below is the smallest code which allow to reproduce the bug: There are dependencies in the Gemfile: # Gemfile gem 'capybara', '2.18.0' gem 'selenium-webdriver', '...
Hirurg103
1

votes
3

answer
45

Views

How to configure Selenium WebDriver with Spring Boot for UI testing?

Not able to configure WebDriver correctly hence my functional test are failing for UI. I looked into both these SO links but not sure how to use the geckodriver.exe here and what is purpose of it. Spring Boot GUI Testing Selenium WebDriver Spring Boot Web Application using Selenium WebDriver I also...
user2325154
0

votes
0

answer
14

Views

Not able to select hidden element from drop down list in Selenium Webdriver

Html Code: Optus AC Number Date Of Birth Pass Phrase Transaction Id I'm using following code(POM) in Selenium Webdriver(with java) to select: public static By campAddDataType= By.id("Step1Model_CampaignAdditionalDataTypeId"); waitTime = new WebDriverWait(driver,20); waitTime.until(ExpectedConditions...
Samy
0

votes
3

answer
14

Views

How to get rid of the hardcoded sleep()?

def textfield(boxid,textadded): project = driver.find_element_by_id(boxid) project.send_keys(textadded) sleep(3) def dropdown(dropdownid, dropdownvalue): select = Select(driver.find_element_by_id(dropdownid)) select.select_by_visible_text(dropdownvalue) sleep(5) These 2 functions are functional howe...
Steve
3

votes
2

answer
172

Views

Using Selenium WebDriver in library csproj with .NET Core

I'm trying to put together a web-scraping app, using Selenium and .NET Core, but I'm having trouble getting my WebDriver exes to be found. I have one .csproj that will run the API for the project, which calls out to (amongst others) another .csproj that will handle the webscraping. All are in a sing...
Brondahl
1

votes
1

answer
4.5k

Views

How to create a single webdriver instance in python?

I am in the midst of creating an automation framework in python but I am stuck up in creating a single instance of web driver. Here's an excerpt of my framework design: A separate Driver.py which has the set up to create a web driver instance from selenium import webdriver class Driver: #creating a...
Praveen Pandey
0

votes
0

answer
6

Views

Is there a way to use a matcher like 'Verify' in rspec?

So far I'm using 'expect' in my test framework which will stop the execution when it meets a fail condition. I want something like, the execution should happen even if it meets the fail condition. I could see that there is a matcher called 'Verify' in rspec where I need to inherit 'Test::Unit::TestC...
esakiraja
1

votes
2

answer
707

Views

Can we write and run scripts in Selenium Webdriver without installing JDK?

I am new to selenium webdriver. We are working on creating a POC for automation testing using Selenium. I wanted to know if we can write and run selenium webdriver test cases in Java without installing JDK? I do have JRE installed on my machine but in my project we cannot install JDK. Also, if we ca...
HelloWorld
1

votes
3

answer
871

Views

How can i test an angular js web application with selenium?

I'm new in Test Automation. I want to use Selenium in order to test web application done by angular js. Can someone suggest to me how to start with a basic application and do you have an example of an angular js application.
Emna
1

votes
1

answer
134

Views

Possible bottle-neck issue in web-scraping with Python

First of all I apologize for the vague title, but the problem is that I'm not sure what is causing the error. I'm using Python to extrapolate some data from a website. The code I created works perfectly when passing one link at the time, but somehow breaks when trying to collect the data from the 80...
Shark8
0

votes
0

answer
8

Views

I am trying to write automation to be able to open an RDP and automate the applications that are opened in RDP. Can we do that?

Ihave written code to open up an RDP connection but the RDP opens up as an IE. The same web link does not work in chrome/IE and the only way to pen up that link is by using RDP connection. So, my question is can I automate the rdp opened IE like a regular IE? So I want to perform some tests in the r...
uday ganesh
1

votes
2

answer
1.2k

Views

How to put file path of chromedrive on Eclipse

How can I use Selenium to run for Google Chrome on Mac OS? I have put the code underneath but it is still giving me an error. System.setProperty("webdriver.chrome.driver", "/Users/STQRY/Document/Jay"); WebDriver driver = new ChromeDriver(); ERROR: ".....The driver executable is a directory: /Users/...
Jay
1

votes
1

answer
412

Views

Selecting a frameset with index in Selenium with Python

Im currently in the phase of learning selenium with python. Following is the code im trying to run: browser=webdriver.Firefox() browser.maximize_window() browser.get('https://netbanking.hdfcbank.com') #print browser.page_source elems=browser.find_elements_by_tag_name('frameset') browser.switch_to_fr...
abhishek nair

View additional questions