selenium-chromedriver

How to make the settings for Download in Chrome when launched using Chromedriver?

醉酒当歌 提交于 2020-01-12 10:52:12
问题 I have checked the option to "Ask where to save each file before downloading" in settings of my Chrome. But each time I am opening the Chrome using Chromedriver it is getting unchecked due to which the files are getting saved to the default download location. What can I do so that the option does not get unchecked when I launch Chrome using Chromedriver? I am using the following code block to launch chrome using chromedriver: public static IWebDriver driver_chrome; driver_chrome = new

WebDriver Java: Reattach existing webdriver browser session to a driver instance

旧巷老猫 提交于 2020-01-12 10:46:58
问题 I'm looking for a way to reattach an existing webdriver browser session to a driver instance so i could control the browser again. So far, I've tried the following: I. ========================================== Reference: https://stackoverflow.com/a/38827934/2285470 Browser: Firefox v. 51.01 / Chrome v. 56.0.2924.87 Driver: geckodriver v. 0.14 / chromedriver v. 2.27 Solution tried: 1. Create a custom class that extends RemoteWebDriver public class RemoteDriver extends RemoteWebDriver { public

How to create element's Xpath using different search ( cssSelector / tag / ClassName )

删除回忆录丶 提交于 2020-01-11 14:17:09
问题 I would like to find an element using a differect cssSelector / tag / ClassName amd them get it's xpath value ( to be more specific, I have a website where when a day changes, one of the classes change it's class) here is what do I meean: <tr> <td> 1.1.2019 </td> <td> 2.1.2019 </td> <td class="active"> 3.1.2019 </td> <td> 4.1.2019 </td> </tr> <tr> <td> </td> <td> 10 </td> <td> </td> #Here <td> </td> </tr> I want to according to where is that "active class", click the table under it. ny idea

fake Geolocation in chrome automation

﹥>﹥吖頭↗ 提交于 2020-01-11 12:54:08
问题 I need to automate geolocation in chrome using python script. I have to fake the latitude and longitude. I followed some links in stackoverflow but they gave errors. chromeDriver.executeScript("window.navigator.geolocation.getCurrentPosition=function(success){var position = {"coords" : {"latitude": "555","longitude": "999"}};success(position);}"); is there any other way i can change the location? 回答1: You have to escape double quotes inside a string please try with below code: driver.execute

SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 76 with Selenium ChromeDriver

怎甘沉沦 提交于 2020-01-11 10:50:07
问题 I am currently using Chrome 75 and I've downloaded the compatible Chromedriver for linux. I've also added it to the PATH variable. However, when I attempt initializing a driver with driver = webdriver.Chrome() I get the following error: selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 76 What I get from this message is that my Chromedriver is ment for Chrome version 76, but both my Chromedriver and

selenium clear() command doesn't clear the element

荒凉一梦 提交于 2020-01-11 08:29:30
问题 I have been writing selenium scripts for a while in Java. I encountered a very weird issue today. Here is the issue: I cleared a text field using webelement.clear() method, later while executing next command (click event), the text area I had previously cleared, is now populated with previously filled value. Here is the code snippet: mobileNumField.get(0).clear(); Thread.sleep(4500); emailAddress.get(0).click(); emailAddress.get(0).clear(); Thread.sleep(4500); emailAddress.get(0).sendKeys

How to directly find WebElements by their attributes except “class” and “name” (for example “title”)

喜你入骨 提交于 2020-01-11 03:40:10
问题 I am very new at Java and Selenium so my apologies in advance if my question sounds a bit primary. I use: driverChrome.findElements(By.className("blabla")); to find elements which have "blabla" as their className, for example: <span class="blabla" title="the title">...</span> Now, what if I want to find all elements by their other attributes? something like: driverChrome.findElements(By.titleValue("the title")); This is the code that I am currently using to do this task: List<WebElement>

Unable to open chrome browser using Selenium Webdriver. Loading unpacked extensions are disabled by administrator

强颜欢笑 提交于 2020-01-10 11:30:21
问题 I am automating my application using Selenium Webdriver, C#, Visual Studio and Chrome browser. I am getting below popup when selenium tried to open the chrome browser. Failed to load extension from:C:\Users\VARA~1.PAK\AppData\Local\Temp\scoped_dir6712_14913\internal. Loading of unpacked extensions is disabled by the administrator. Once I click on OK button of the popup, Chrome is opening successfully but my test is failing due to below error. Test Name: _3_EnterDetailsAndSelectAnAddress_John

How to fix [1573451709.039][WARNING]: Timed out connecting to Chrome, retrying… while using chrome version 78 and chrome driver version 78.0.3904.70

你。 提交于 2020-01-10 06:11:19
问题 My Chrome browser is updated to version 78 and when I tried to execute any code of automation, it shows the error Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code. [1573451703.668][WARNING]: Timed out connecting to Chrome, retrying... Nov 11, 2019 11:25:05 AM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Detected dialect: W3C [1573451709.039][WARNING]: Timed out connecting to Chrome, retrying... How can I fix it? 回答1:

How to fix [1573451709.039][WARNING]: Timed out connecting to Chrome, retrying… while using chrome version 78 and chrome driver version 78.0.3904.70

不想你离开。 提交于 2020-01-10 06:09:07
问题 My Chrome browser is updated to version 78 and when I tried to execute any code of automation, it shows the error Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code. [1573451703.668][WARNING]: Timed out connecting to Chrome, retrying... Nov 11, 2019 11:25:05 AM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Detected dialect: W3C [1573451709.039][WARNING]: Timed out connecting to Chrome, retrying... How can I fix it? 回答1: