Questions tagged [selenium]

16782 questions
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
4.6k

Views

xpath identification Dynamic value passing

the xpath driver.findElement(By.xpath("//input[@accesskey='9']")); how cound we pass the Dynamic value in the accesskey Attribute, because the accesskey Attribute assign with any integer so i get that id from database and try to pass that id in the accesskey attribute how using java? Html code td st...
Prabu
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
0

answer
16

Views

Scraping More than rendered Data with Beautiful Soup

I'm scraping apps names from Google Play Store and for each URL as input I get only 60apps (because the website rendered 60apps if the user doesn't scroll down). How is it working and how can I scrape all the apps from a page using BeautifulSoup and/or Selenium ? Thank you Here is my code : urls = [...
userHG
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
2

votes
2

answer
56

Views

How to convert #ffffff to #fff or #fff to #ffffff for Assertion?

How to convert #ffffff to #fff or #fff to #ffffff for Assertion? I have used getCssValue("background") which returns rgb(255, 255, 255) which I can split into: r -> 255 g -> 255 b -> 255 The following line of code: String hex = String.format("#%02x%02x%02x", r, g, b); Converts rgb to hex and gives a...
DebanjanB
0

votes
0

answer
7

Views

python selenium action chain

need help here about "paste" action in web selenium in linux python3. the copied content in local test.txt can successfully be paste into web context by using search.send_keys(Keys.CONTROL+ "v"). however, while I try to use actionchains to simulate the mouse "right click" and "paste", it failed. the...
The_flash
1

votes
1

answer
132

Views

execute a method from protractor and get the return value

Can I execute a method from protractor and get the return value of the method? For example: I use jqxGrid widget, and the widget have a method that return the table details in json, how can I import the variable to the protractor project. The method I want to call in the project: var table = $("#Gri...
user1684140
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
1

answer
2.5k

Views

Set up selenium server [closed]

I am looking for a clear and concise tutorial on how to set up selenium server on a remote host and how to use it appropriately. I am still new to some of the set up and configurations of servers in general, and the selenium documentation seems worded in a way that is meant for a higher level of und...
Michael Gibson
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
0

votes
0

answer
6

Views

selenium error when checking for attribute in try loop

url='https://relatedwords.org/relatedto/music' headers={'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626'} from selenium import webdriver options = webdriver.ChromeOptions() options.add_argument('headless') driver=webdriver.Chrome...
timmy turner
0

votes
0

answer
6

Views

Error: unknown error: DevToolsActivePort file doesn't exist, when executing ruby script with watir

I am fairly new to Centos7 and trying to develop a solution for browser automation in the below environment: OS: Centos7 Ruby: 2.6 Watir Browser:Google Chrome 72.0.3626.109 Driver: ChromeDriver 2.46.628388 My script: require 'watir' # Initialize the browser with the driver path site="https://google....
Nishant Kansal
-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
2

answer
5.2k

Views

Need to click, hold and move at certain coordinates with capybara(ruby)

Im trying to implement a click, drag and release at certain coordinates for a web page, headlessly using Capybara. The target is an element containing calendar, which responds to mouse events via ajax. Schedules are added via clicking, dragging and releasing. I have tried 2 methods: Method 1 cal = f...
Miika Palokangas
1

votes
2

answer
60

Views

Selinium web driver- Unable to locate href

I trying to locate a link "Taschen" in the below code(Taschen) using selinium webdriver. Could anyone please guide me Taschen
1

votes
1

answer
439

Views

How to call Selenium methods with defined Capybara driver using Ruby?

I use Capybara as a driver in my auto tests. I defined a driver as: Capybara.default_driver = :selenium But it is impossible to use Selenium methods in usual way (like: @driver.find_element(:xpath, ::Login_button).send_keys("MY_login")). I saw on some resources that it is possible to call Selenium m...
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
0

answer
25

Views

how to get data in Array list

Current approach for source and target UI Validation 1.Inspect Element from source UI and save in Excel. Inspect Element fron Target UI and save in Excel. 2.Run automation Script to capture all elements from soucre UI and save in diffrent Excel File Run automation Script to apture all elements from...
Preet
1

votes
2

answer
784

Views

TestNG Based Selenium Tests not running in Parallel

I am using the below TestNG Config to enable parallel execution of Selenium tests. Java Code: @Test(dataProvider = "TestData") public void firstTest(String data){ //Code } @Test(dataProvider = "TestData") public void secondTest(String data){ //Code } @Test(dataProvider = "TestData") public void thir...
Purus
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
0

votes
0

answer
8

Views

How to execute my java,cucumber and selenium test cases in heroku cloud platform?

I am not able to execute my java+cucumber+selenium test cases in heroku cloud platform.Please help me is there in build pack configuration i have to add to my application. I have even kept the chrome driver in corresponding path.And even though it is not working.?
AnilkumarReddy
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
1

votes
3

answer
55

Views

How to wait for invisibility of an element through PageFactory using Selenium and Java

Is there a way to wait for an element not present in Selenium using PageFactory annotations? When using: @FindBy(css= '#loading-content') WebElement pleaseWait; to locate the element, and then: wait.until(ExpectedConditions.invisibilityOfElementLocated(pleaseWait)); I would get: org.opeqa.selenium....
Mate Mrše
2

votes
0

answer
22

Views

Selenium Chrome Driver not working on Pi Zero with error code -4

I am trying to set up a script on a new Pi Zero W that was previously working on my Pi 3 B. It seems the hardware may be causing the issue as simply moving the whole operating system etc over to the new pi causes this issue. There is no other changes. I have tried looking at my Chrome and chrome dri...
Joss Sparkes
6

votes
2

answer
149

Views

How to change proxy on my webdriver multiple times on a single session?

I am working on a bot. I want the bot to change the proxy of the webdriver every 50 searches. I have an API that requests the proxy and the socket, i store those variables and so far i have been using firefox profiles to set it up but that doesnt work very well. So given the fact that i already have...
0

votes
0

answer
8

Views

Firefox fails to open an url with the error: Exception… "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND)

I am starting with Selenium WebDriver and Ecplise. After configuring the Eclipse and running simple code to launch the website I am getting an error. Additionally added to the project: selenium-server-standalone-3.141.59.jar geckodriver.exe v.0.24.0 Firefox version - 56.0 I have checked the answers...
Tatiana
0

votes
0

answer
4

Views

Getting no data from mybrandnewlogo.com

I'm building an autonomous Selenium + Python tool to scrape logos (SVG type) to my computer but end up getting nothing when extract data In my code, I tried to get Selenium to go through all the input steps and finally got to the logos creation page. However, after waiting for all logos to load succ...
Phúc Hưng
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

junit Test with SerenityParameterizedRunner in RunWith annotation: does not find tests (java.lang.Exception: No tests found matching Method)

I'm trying to run a junit test with Serenity BDD framework, using IntelliJ IDEA. I get an error when I try to run the test: java.lang.Exception: No tests found matching Method ... from [email protected] This appears to be due to using RunWith annotation invoking Seren...
phantom

View additional questions