selenium-chromedriver

Unable to hide “Chrome is being controlled by automated software” infobar within Chrome v76

半腔热情 提交于 2019-12-04 10:37:02
问题 After updating Chrome to version 76, I cannot figure out how to hide the "Chrome is being controlled by automated software..." notification overriding some controls on the page. The latest stable release of ChromeDriver is indeed 76.0.3809.68. The following code worked with Chrome 75 and ChromeDriver 74. var options = new ChromeOptions(); options.AddArgument("--test-type"); options.AddArgument("--disable-extensions"); options.AddArguments("disable-infobars"); options.AddArguments("--disable

What are the Chrome command line switches / parameters?

白昼怎懂夜的黑 提交于 2019-12-04 10:36:30
问题 Where can I find a list of command line switches to use with Chrome and chromedriver? 回答1: For Chromium find a list here: http://web.archive.org/web/20151209175936/https://src.chromium.org/svn/trunk/src/chrome/common/chrome_switches.cc or (in a more readable format) here: http://peter.sh/experiments/chromium-command-line-switches/ 来源: https://stackoverflow.com/questions/21136212/what-are-the-chrome-command-line-switches-parameters

How to use chomedriver with a proxy for selenium webdriver?

别来无恙 提交于 2019-12-04 10:15:35
Our network environment using a proxy server to connect to the outside internet, configured in IE => Internet Options => Connections => LAN Settings, like "10.212.20.11:8080". Now, I'm using selenium webdriver for chrome and IE, but with the proxy server enabled, I can't start the browser. Here is the python code: from selenium import webdriver driver = webdriver.Chrome(executable_path='E:\Selenium\WebDrivers\chromedriver.exe') Here is the error message(If disable the proxy in IE "Internet Options", it works fine): Traceback (most recent call last): File "E:\WorkSpace\GitHub\selenium\sandbox

ImportError: sys.meta_path is None, Python is likely shutting down

自作多情 提交于 2019-12-04 10:11:01
Newbee here. Kindly explain why this issue happened and how to fix it. Error: "C:\Program Files (x86)\Python36-32\python.exe" C:/Users/Vivek-Pc/PycharmProjects/tryOutSeries/searchTryout2.py Exception ignored in: > Traceback (most recent call last): File "C:\Program Files (x86)\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 173, in del File "C:\Program Files (x86)\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 149, in stop File "C:\Program Files (x86)\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 120, in send

Unable to load default profile in Chrome with Selenium WebDriver

不打扰是莪最后的温柔 提交于 2019-12-04 10:07:54
I am using Selenium WebDriver to do something on a page that requires http authentication. I am already login in my default profile. But the selenium chromedriver will automatically use a new profile for each use therefore I can't get past the authentication stage. Therefore, I was thinking of using my default profile (With account login inside) on Selenium WebDriver for Chrome. The default profile don't seem to be loaded into Chrome even when I use the code as below ChromeOptions options = new ChromeOptions(); options.AddArguments("user-data-dir=C:/Users/user_name/AppData/Local/Google/Chrome

Can't get proper console logs from WebDriver (Chrome, C#)

落花浮王杯 提交于 2019-12-04 10:07:28
I wrote following micro-test (it's useless but it's not the case here) in Selenium WebDriver, C#, for Chrome browser: [Test] public void T2_API_001_PrintingAlerts() { pgactions.OpenDataset(driver, settings.dataset); // opening page for (int i = 0; i < 10; i++) { ((IJavaScriptExecutor)driver).ExecuteScript("TsTable.Admin.log('this is error message', true);"); } var logs = driver.Manage().Logs.GetLog(LogType.Browser); foreach (var log in logs) { Console.WriteLine(log.ToString()); } Thread.Sleep(100000); } In debugging console in VS I expect to see (like I see in Chrome browser instance started

What are valid deviceNames for Chrome emulation testing with Protractor?

☆樱花仙子☆ 提交于 2019-12-04 09:53:26
问题 The common web consensus seems to be that if you see a name in your chrome emulator, you can use it as-is in your protractor config ... so I tried Apple iPad : { browserName: 'chrome', chromeOptions: { mobileEmulation: { deviceName: 'Apple iPad' } } } But I had to muck around until trial & error yielded the correct deviceName to be: Apple iPad 3 / 4 Now I've searched here: https://developer.chrome.com/devtools/docs/device-mode#enable-device-mode and here: https://sites.google.com/a/chromium

Elixir Hound wait for page to load

青春壹個敷衍的年華 提交于 2019-12-04 09:45:14
I'm submitting a login form and trying to capture the HTML afterwards using elixir / hound. After submitting I run page_source and get nothing. If I wait for a second (for the page to finish loading) then I get back the html. Is there a way to make hound wait till the page is finished loading? I'm currently doing: :timer.sleep(2000) as a work around, hoping for a better way :/ This is what I do: Create a function that repeatedly checks for a test condition every 100ms, in this case I'm waiting for particular text to appear by using visible_page_text @tag timeout: 6000 test "My Test" do assert

Headless chrome + ignore-certificate-errors

两盒软妹~` 提交于 2019-12-04 09:02:36
问题 I need to get headless chrome to ignore certificate errors. The option is ignored when running in headless mode, and the driver returns empty html body tags when navigating to an https resource. <html xmlns="http://www.w3.org/1999/xhtml"><head></head><body></body></html> This is how I am configuring my chrome driver. ChromeOptions chromeOptions = new ChromeOptions(); chromeOptions.addArguments("--headless", "--disable-gpu", "--window-size=1920,1200","--ignore-certificate-errors");

Feign focus in Selenium chrome browser

本秂侑毒 提交于 2019-12-04 08:26:58
I'm using Selenium to scrape data from a website. The website requires window focus in order to display certain elements that I need. I want to be able to run my program in the background, without having to focus the window while it's running. Is there any way to trick the site into thinking it's focused on? I'm using the selenium chrome driver. Edit: Here's a quick and dirty test I built . Check out the code on GitHub The website background color will turn black when the window.onblur event is recieved, and turn back white when the window.onfocus event is recieved. I want to fake those events