selenium-chromedriver

How to download a HTML webpage using Selenium with python?

二次信任 提交于 2020-01-01 06:47:09
问题 I want to download a webpage using selenium with python. using the following code: from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.keys import Keys chromeOptions = webdriver.ChromeOptions() chromeOptions.add_argument('--save-page-as-mhtml') d = DesiredCapabilities.CHROME driver = webdriver.Chrome() driver.get("http://www.yahoo.com") saveas = ActionChains(driver).key_down(Keys.CONTROL)\ .key_down('s').key_up(Keys

sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) using findElement(By.className()) through Selenium and Java

旧巷老猫 提交于 2019-12-31 05:26:09
问题 When I execute the following code: driver.findElement(By.className("qview-product-name")).click(); I get the following error Session ID: d5df6f837164b1738991e8dc09027fe0 *** Element info: {Using=class name, value=qview-product-name} at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor

C# Selenium Proxy Authentication with Chrome Driver

寵の児 提交于 2019-12-31 04:00:11
问题 I am using the following code for the proxy. however, when chrome starts, pop-up window will pop up and the program will be locked. public async void StartDriver(string proxy) { var proxys = new Proxy(); ChromeDriverService chromeDriverService = ChromeDriverService.CreateDefaultService(); chromeDriverService.HideCommandPromptWindow = true; ChromeOptions chromeOptions = new ChromeOptions(); bool flag = !string.IsNullOrEmpty(proxy); if (flag) { proxys.Kind = ProxyKind.Manual; proxys

Failed: sendKeysToActiveElement error while invoking sendKeys to ENTER and other keystrokes using ChromeDriver Chrome with Protractor

╄→尐↘猪︶ㄣ 提交于 2019-12-31 03:19:09
问题 My Protractor tests that use sendKeys to press Enter or Tab failed today after I was auto-updated to Chrome 76. This worked find yesterday on Chrome 75. This is the code that used to work: browser.actions().sendKeys(protractor.Key.TAB).perform(); The error message is Failed: sendKeysToActiveElement Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53' System info: host: 'DESKTOP-6JGLC4V', ip: '192.168.0.5', os.name: 'Windows 10', os.arch: 'x86', os.version: '10

Chromedriver in Java not executable

一世执手 提交于 2019-12-31 03:08:47
问题 So i'm trying to to learn Selenium and encountered a problem. Can't run chromedriver. Error: Exception in thread "main" java.lang.IllegalStateException: The driver is not executable: /Users/Roberto/Documents/EclipseProjects/MansPirmaisSelenium/lib/chromedriver Code: System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir")+"//lib//chromedriver"); WebDriver chromeDriver = new ChromeDriver(); chromeDriver.get("http://www.google.lv"); I have my chromedriver in the right path i

Selenium Chromedriver causes Chrome to start without configured plugins, bookmarks and other settings

非 Y 不嫁゛ 提交于 2019-12-31 02:19:09
问题 I am a new user of Selenium. I want to use it to start up the Chrome browser but I have a problem. public static void processor(String url, String name) { System.setProperty("webdriver.chrome.driver", "C:/Documents and Settings/jingxiong/Local Settings/Application Data/Google/Chrome/Application/chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.get(url); WebElement element = driver.findElement(By.name(name)); element.sendKeys("google"); element.submit(); System.out.println(

Adding extension to Selenium2(WebDriver) chrome driver

血红的双手。 提交于 2019-12-31 01:53:29
问题 I'm using the code below to start chrome using webdriver (selenium 2) Map<String, String> mobileEmulation = new HashMap<String, String>(); mobileEmulation.put("deviceName", "BlackBerry PlayBook"); Map<String, Object> chromeOptions = new HashMap<String, Object>(); chromeOptions.put("mobileEmulation", mobileEmulation); DesiredCapabilities capabilities = DesiredCapabilities.chrome(); capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions); driver = new ChromeDriver(capabilities); How

Selenium: Getting chrome didn't shut down correctly

时光总嘲笑我的痴心妄想 提交于 2019-12-31 01:48:14
问题 I'm getting the chrome didn't shut down correctly error message when I reopen a chrome browser in my selenium framework. In the framework I'm opening the browser instance at the beginning for each of my test case using the below code if (browserType.equalsIgnoreCase("Chrome")) { try { System.setProperty("webdriver.chrome.driver", curProj+"\\drivers\\chromedriver.exe"); ChromeOptions options = new ChromeOptions(); options.setExperimentalOption("useAutomationExtension", false); options

Selenium, Python and InvalidArgumentException: invalid argument: value must be a non-negative integer

六眼飞鱼酱① 提交于 2019-12-30 22:56:24
问题 A Python script I have been using for the last several months broke today. The script monitors a modem for incoming calls and files FTC Do Not Call complaints. The error is InvalidArgumentException: Message: invalid argument: value must be a non-negative integer when calling implicitly_wait . I found similar reports for Firefox, but I have not found one for Chrome. The machine is fully patched, so there is nothing to update like in the Firefox reports. What is the problem and how do I fix it?

org.openqa.selenium.SessionNotCreatedException: session not created exception from tab crashed error when executing from Jenkins CI server

巧了我就是萌 提交于 2019-12-30 18:56:32
问题 I am trying to run my automation tests from Jenkins CI server (built with Gradle), but the browser crashes instantly with the error below. It also crashes when I run gradle test from the console. Now when I am running the same test from the IDE (Idea), everything works just fine. I run the exact same test file, in the exact same directory. Versions: Selenium: 3.11.0 Gradle: 4.6 TestNG: 6.14.2 Chrome: 65.0.3325.181 Chromedriver: 2.37 Anyone has any idea what could be causing this? org.openqa