selenium-chromedriver

Getting error exception in thread “main” java.lang.NullPointerException

偶尔善良 提交于 2021-02-05 08:15:46
问题 When i run the following class files in selenium, the browser is launched and URL is opened but error after that: exception in thread "main" java.lang.NullPointerException at guru99project.guru99project.printtitlepage(guru99project.java:25) at guru99project.Main_method.main(Main_method.java:10) Code trials: package guru99project; import org.openqa.selenium.By; import org.openqa.selenium.Dimension; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa

Selenium C# How to handle Alert “Open Pick an app”?

[亡魂溺海] 提交于 2021-02-05 08:08:53
问题 I am trying to get the Alert's Text using Selenium C# for Chrome But this alert seems different from a normal JavaScript Alert, using the code below returns an error exception: string text = driver.SwitchTo().Alert().Text; OpenQA.Selenium.NoAlertPresentException: no such alert Is this considered as an alert? Is there a way to handle it? 回答1: The dialog you're seeing is shown on the OS level so there's no way for you to see that in the DOM or use Selenium to interact with it. If you really

Driver info: driver.version: unknown with ChromeDriver Chrome using Selenium and Python

不羁的心 提交于 2021-02-05 07:37:09
问题 It is showing timed out for driver server to start when I use chrome driver. And when I try to use Firefox it is showing session unexpectedly exited. I am trying to run the Remote driver on a server using selenium in python what should I do? Unable to create new session. UnknownError: Timed out waiting for driver server to start. Build info: version: '3.141.0', revision: '2ecb7d9a', time: '2018-10-31T20:22:52' System info: host: 'server.*******.com', ip: '61.16.155.6', os.name: 'Linux', os

Headless Chrome Driver not working for Selenium

核能气质少年 提交于 2021-02-05 07:27:06
问题 I am current having an issue with my scraper when I set options.add_argument("--headless") . However, it works perfectly fine when it is removed. Could anyone advise how I can achieve the same results with headless mode? Below is my python code: from seleniumwire import webdriver as wireDriver from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver

How to hide the warning “This type of file can harm your computer” while downloading .xml file using Chrome Chromedriver 79 with Selenium Java

一笑奈何 提交于 2021-02-05 06:38:25
问题 Despite setting safebrowsing.enabled to true / false , the warning ...This type of file can harm your computer... is still being displayed in browser. How to hide this information? 回答1: To enable downloading of file using Chrome/ChromeDriver hiding the warning This type of file can harm your computer you need to: Add the preferences: download.default_directory download.prompt_for_download download.extensions_to_open safebrowsing.enabled As well as add the following arguments to whilelist: -

How to hide the warning “This type of file can harm your computer” while downloading .xml file using Chrome Chromedriver 79 with Selenium Java

拈花ヽ惹草 提交于 2021-02-05 06:38:06
问题 Despite setting safebrowsing.enabled to true / false , the warning ...This type of file can harm your computer... is still being displayed in browser. How to hide this information? 回答1: To enable downloading of file using Chrome/ChromeDriver hiding the warning This type of file can harm your computer you need to: Add the preferences: download.default_directory download.prompt_for_download download.extensions_to_open safebrowsing.enabled As well as add the following arguments to whilelist: -

selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 85

一笑奈何 提交于 2021-02-05 06:31:07
问题 Hey so I have this simple code to open google using selenium from selenium import webdriver import chromedriver_binary driver = webdriver.Chrome() driver.get('https://google.com') Instead of opening the google page I get this error. Traceback (most recent call last): File "main.py", line 5, in <module> driver = webdriver.Chrome() File "C:\Users\vipku\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 76, in __init__ RemoteWebDriver.__init

“java.lang.module.InvalidModuleDescriptorException: Provider class org.apache.bsf.BSFManager not in module” error with ChromeDriver Selenium

浪尽此生 提交于 2021-02-04 21:00:42
问题 I am using eclipse 09-2019 with jdk13 and selenium 3.0.1 .jar file. My Code is: package package1; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox.FirefoxDriver; public class Script1 { public static void main(String[] args) { System.out.println("Hii"); System.setProperty("Webdriver.chrome.driver","E:\\Selenium\\chromedriver.exe"); WebDriver driver=new ChromeDriver(); driver.get("http://www.google.com"); } } Error: java

Python and Selenium mobile emulation

孤者浪人 提交于 2021-02-04 19:08:50
问题 I'm trying to emulate Chrome for iPhone X with Selenium emulation and Python, as follow: from selenium import webdriver mobile_emulation = { "deviceName": "iphone X" } chrome_options = webdriver.ChromeOptions() chrome_options.add_experimental_option("mobileEmulation", mobile_emulation) driver = webdriver.Chrome(r'C:\Users\Alex\PythonDev\chromedriver') driver.get('https://www.google.com') However, nothing happens: my page is still a normal browser page, and I don't see it as a mobile page.

nodejs/selenium webdriver: Can't move mouse to a required position

最后都变了- 提交于 2021-02-04 08:30:08
问题 I'm having trouble in moving mouse pointer in chrome webdriver to a required position in nodejs. I'm using -selenium webdriver 4.0.0-alpha.1 . This is how i'm building the driver const {Builder,By} = require("selenium-webdriver"); let driver = new Builder().forBrowser('chrome').build(); This is where i'm defining the logic to move mouse to a position named value = { x: 262, y: 315 } await driver.wait(until.elementLocated(By.className("OUeyt"))); let a = driver.findElement(By.className("_3Bxar