selenium-chromedriver

Selenium chrome driver socks proxy configuration

蓝咒 提交于 2019-12-04 22:42:42
I am having troubles in setting socks proxy for chrome driver Proxy proxy = new Proxy(); proxy.setProxyType(Proxy.ProxyType.MANUAL); proxy.setAutodetect(false); proxy.setSocksProxy(ProxyHelper.PROXY_HOST + ":" + ProxyHelper.PROXY_PORT); DesiredCapabilities capabilities = DesiredCapabilities.chrome(); capabilities.setCapability(CapabilityType.PROXY, proxy); WebDriver chromeDriver = new ChromeDriver(capabilities); This configuration gives: Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: cannot parse capability: proxy from unknown error: proxyType is 'manual' but

ChromeOptions causes reference error using Selenium ChromeDriver for node.js

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 21:53:11
问题 I am trying to use the ChromeDriver driver for Selenium to run some tests using Chrome, but I'm getting a reference error when I use ChromeOptions . My Code I want to force the use of certain options, such as testing it against a particular user profile. Based on the Selenium and ChromeDriver documentation, this is my file test.js : opt = new chromeOptions(); // ERROR OCCURS HERE! opt.setBinary("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"); opt.addArguments("--user-data

how to export html table data displayed in web page to .csv format

时间秒杀一切 提交于 2019-12-04 21:30:46
How to export the table (table id="cross_rate_markets_stocks_1") at https://in.investing.com/equities/india after selecting any option from the drop down menu the table that is coming needed to be saved it in .csv format. its for my final year project .. i have tried using 3rd party websites but it is capturing all the data of the site but i only need data of (table id="cross_rate_markets_stocks_1") firstly one need to select any value from the drop down with default value BSE Sensex 30 then the all the data displayed on the table (table id="cross_rate_markets_stocks_1") needed to be copied to

action.sendKeys(body, Keys.CONTROL + “j”) dosen't open the download page

扶醉桌前 提交于 2019-12-04 21:09:51
I am using Java and Selenium to write tests for Chrome. I need to open the download page at one point so I used: action.sendKeys(Keys.CONTROL + "j").build().perform(); but it does NOT open the page. then I added this line before it as I though it might work but it didn't: WebElement body = wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//body[@id='body']"))); action.sendKeys(body, Keys.CONTROL + "j").build().perform(); The weird point is that action.sendKeys(Keys.CONTROL + "a").build().perform(); Works!! NOTE: I do not want to use Robot class as it will open the page on other

How to open new tab in Chrome with Selenium-chromeDriver in Python

你。 提交于 2019-12-04 19:52:46
问题 Is there anybody who used ChromeDriver to open new tabs in Chrome? With this code I can open my index.html in Chrome: driver = webdriver.Chrome("/usr/bin/chromedriver") driver.get("localhost:3000") And then I want to open localhost:3000/cloudPeer.html in a new tab: driver.find_element_by_tag_name("body").send_keys(Keys.CONTROL + 't') driver.get("localhost:3000/cloudPeer.html") This works well in Firefox, but in Chrome, it can't open a new tab, it just refresh the first page, and open the new

Selenium WebDriverWait but still “Element is not clickable at point”

隐身守侯 提交于 2019-12-04 19:39:56
I have the following code (br is the webdriver and everything is imported fine). The first 3 lines work fine but the link1.click() still gives me an error: link = WebDriverWait(br, 30).until(EC.element_to_be_clickable((By.ID, "buttonNew Project"))) link.click() link1 = WebDriverWait(br, 30).until(EC.element_to_be_clickable((By.ID, "MP"))) link1.click() And even though it should have waited until its clickable, I still get the the error: WebDriverException: unknown error: Element is not clickable at point (543, 170). Other element would receive the click: <div id="screenBlocker" style="width:

Selenium fails to start Chromedriver

孤街醉人 提交于 2019-12-04 19:00:05
问题 I am unable to start Chromedriver with Selenium . from selenium import webdriver browser = webdriver.Chrome() browser.get('http://www.google.com') It never gets to browser.get('http://www.google.com') but fails with: raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally (Driver info: chromedriver=2.21.371461 (633e689b520b25f3e264a2ede6b74ccc23cb636a),platform=Linux 3.13.0-76-generic

How to set window size in Selenium Chrome Python

青春壹個敷衍的年華 提交于 2019-12-04 18:37:27
The following code to resize a selenium chrome window does not work: driver.set_window_size(1920, 1080) time.sleep(5) size = driver.get_window_size() print("Window size: width = {}px, height = {}px.".format(size["width"], size["height"])) From which the output is: Window size: width = 1044px, height = 788px I've also tried using options to set the window size on driver creation (and lots of other things, seem comments below), but can't get it to work either: options.add_argument("--window-size=1920,1080") I am using selenium 3.14.0, chrome driver version 72.0.3626.109 and running in background

Opening Chrome browser in Android device using Robot Framework script and chromedriver?

会有一股神秘感。 提交于 2019-12-04 18:13:23
Automation setup on Ubuntu 14.04: Robot Framework 2.9.2 (Python 2.7.6 on linux2) selenium2library-1.7.4 ChromeDriver 2.20.353124 Device under testing: Nexus 7 (KitKat 4.4, Chrome v. 47) Everything works fine when running this following example test with Python --> URL is launched properly on Chrome in Nexus device. from selenium import webdriver capabilities = { 'chromeOptions': { 'androidPackage': 'com.android.chrome', } } driver = webdriver.Remote('http://localhost:9515', capabilities) driver.get('http://google.com') driver.quit() But actual problem exists when I try to get the same working

Customize Chrome webdriver using selenium to save files without prompting to save or discard files when downloading

℡╲_俬逩灬. 提交于 2019-12-04 16:13:54
I am trying to automate downloading files using selenium with chrome as my browser using chromedriver. When i try downloading exe files its prompting me "This type of file can harm your computer, Discard or save it". i want it to download anyway without any prompt. I have looked into few solutions like below: chromeOptions = webdriver.ChromeOptions() prefs = {"browser.helperApps.alwaysAsk.force" :False,"browser.helperApps.neverAsk.saveToDisk" : "application/octet-stream"} chromeOptions.add_experimental_option("prefs",prefs) browser = webdriver.Chrome(executable_path=//path//to//chrome_driver,