selenium-chromedriver

How to disable location service by chromedriver selenium?

依然范特西╮ 提交于 2019-12-12 10:56:43
问题 I'm using selenium 2 - Webdriver , Chromedriver, Java. One of my tests needs to turn off the location service on Chrome . I notice that by default, the location service is turned on Chromedriver. I'm wondering if there is a way to disable location service on chromedriver? many thanks in advance! 回答1: Yes, it's possible. Use the ChromeOptions class, in the following way: ChromeOptions options = new ChromeOptions(); JSONObject jsonObject = new JSONObject(); jsonObject.put("profile.default

Rails: Proxy Authentication in Watir (Chrome Driver)

拜拜、爱过 提交于 2019-12-12 10:48:29
问题 i've tried to add proxy authentication in chrome webdriver which run on the watir like belows: require 'watir' proxies = ['--proxy-server=185.264.167.184:63109', '--proxy-auth=username:password'] browser = Watir::Browser.new :chrome, :switches => proxies browser.goto(url) when the browser run it still asking me username and password like below: And the question is how to set username and password in chrome driver which run on the watir ? 来源: https://stackoverflow.com/questions/46032288/rails

Only local connections are allowed Chrome and Selenium webdriver

拥有回忆 提交于 2019-12-12 10:22:06
问题 I am using Chrome webdriver 2.23 & Selenium 2.53.1 I have tried a lot but could not come the fix for this issue that whenever i run my selenium script it is giving me error Starting ChromeDriver 2.23.409699 (49b0fa931cda1caad0ae15b7d1b68004acd05129) on port 12162 Only local connections are allowed. 回答1: This is just an informational message. Your issue might be a missmatch between the versions of chromedriver and selenium-server-standalone. Try with the latest selenium version 3.0, it is

Headless Chrome and Selenium on Windows?

橙三吉。 提交于 2019-12-12 09:36:20
问题 I've seen that headless Chrome came out in some form last month and I've seen that it can be interacted with via Selenium but the articles I've seen mostly mention Linux and MacOS. Is this available for windows (7 and /or 10) yet? 回答1: The Headless mode for Windows is available in Chrome 60 beta , and the stable version is likely to be also in the 60th version. https://www.google.com/chrome/browser/beta.html There are no differences in the launch of Selenium 回答2: Yes, I use it on windows but

How to set window size in Selenium Chrome Python

≡放荡痞女 提交于 2019-12-12 09:20:12
问题 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

Window defender wants to reset your setting" -ChromeDriver 2.29 issue:ChromeBrowser opening with a new tab

[亡魂溺海] 提交于 2019-12-12 09:05:29
问题 Chrome Browser open up with a new Tab asking for Window defender wants to reset your setting" Please help me to resolve this issue This is happening in chrome v.57 and chromeDriver 2.29 ,please let me know if any suggestion 回答1: There are 2 solutions to this: Option A Create a new browser profile. Restart your machine. Option B If option A does not solve the issue, then this problem is caused by a key in the registry with the name, TriggeredReset . Delete this key, but first to be safe create

Using selenium to save images from page

与世无争的帅哥 提交于 2019-12-12 08:09:28
问题 I'm using Selenium & Google Chrome Driver to open pages programatically. On each page there is a dynamically generated image which I'd like to download. At the moment, I'm waiting for the page to finish loading, then I grab the image URL and download it using System.Net.WebClient. That works fine except I'm downloading the images twice - once in the browser, once with WebClient. The problem is that each image is roughly 15MB and downloading twice adds up quickly. So - is it possible to grab

Using chromedriver with selenium/python/ubuntu

喜你入骨 提交于 2019-12-12 07:12:28
问题 I am trying to execute some tests using chromedriver and have tried using the following methods to start chromedriver. driver = webdriver.Chrome('/usr/local/bin/chromedriver') and driver = webdriver.Chrome(executable_path='/usr/local/bin/chromedriver') and import os from selenium import webdriver chromedriver = "/usr/local/bin/chromedriver" os.environ["webdriver.chrome.driver"] = chromedriver driver = webdriver.Chrome(chromedriver) driver.get("http://stackoverflow.com") But none of these

Selenium switch to frame not working for Chrome 58

时光总嘲笑我的痴心妄想 提交于 2019-12-12 06:58:19
问题 After I've updated my Chrome to version 58, I cannot switch to the frame. Here is my code: driver.switchTo().frame(frameId); Tried to use another two overloaded frame() methods (that accepts index and WebElement ) - the same problem. Here is the exception: org.openqa.selenium.NoSuchFrameException: no such frame: element is not a frame (Session info: chrome=58.0.3029.110) (Driver info: chromedriver=2.28.455520 (cc17746adff54984afff480136733114c6b3704b),platform=Windows NT 10.0.14393 x86_64)

How to open a link in a new tab with Python selenium ChromeDriver

时光总嘲笑我的痴心妄想 提交于 2019-12-12 06:52:48
问题 Please, advise on how to open a link in a new tab with Python selenium Chrome Webdriver. So, I am not asking how to simply open a new tab, nor on how to open a new tab with Firefox. This one opens the same page in a new tab: first_link.send_keys(Keys.CONTROL + Keys.ENTER) This one too: first_link.send_keys(Keys.CONTROL + Keys.ENTER) alecxe answer to this question does not work since, I cannot get an url a link is pointing at. I need to simply emulate Right-mouse-click > "Open link in a new