selenium-webdriver

How to make selenium webdriver open in google chrome without Incognito

大兔子大兔子 提交于 2021-02-07 11:07:37
问题 I'm using selenium for the past 1 month. I want to create some small applications using selenium. Selenium webdriver opens an incognito window when I run it. Is there any way to make it launch in normal window(i.e which has my accounts logged in)? This is the code which I'm using : (python code in linux) chromedriver = Path to chrome driver os.environ["webdriver.chrome.driver"] = chromedriver driver = webdriver.Chrome(chromedriver) driver.get("http://www.gmail.com") 回答1: If you want to re-use

double slash for xpath. Selenium Java Webdriver

纵然是瞬间 提交于 2021-02-07 10:52:46
问题 I am using Selenium WebDriver. I have a doubt about the xpath. If I have the following code example: <div> <div> <div> <a> <div> </div> </a> </div> </div> </div> And I want to locate the element which is in the last <div> . I think I have 2 options with the xpath. First option is with single slash: driver.findElement(By.xpath("/div/div/div/a/div")).click(); Second option is using double slash (and here is where I have the doubt). driver.findElement(By.xpath("//a/div")).click(); Is it going to

Selenium: Trying to get Firefox console logs results in “WebDriverError: HTTP method not allowed”

倖福魔咒の 提交于 2021-02-07 09:55:01
问题 I'm trying to capture console errors in my selenium tests (node environment with selenium-webdriver 4.0.0-alpha.5 and the latest geckodriver and chromedriver). I've set up one driver for Firefox and another one for Chrome like this: const chrome = require('selenium-webdriver/chrome'); const firefox = require('selenium-webdriver/firefox'); const webdriver = require('selenium-webdriver'); const { Builder, By, Capabilities, until } = webdriver; let loggingPref = new webdriver.logging.Preferences

Selenium: Trying to get Firefox console logs results in “WebDriverError: HTTP method not allowed”

喜夏-厌秋 提交于 2021-02-07 09:54:39
问题 I'm trying to capture console errors in my selenium tests (node environment with selenium-webdriver 4.0.0-alpha.5 and the latest geckodriver and chromedriver). I've set up one driver for Firefox and another one for Chrome like this: const chrome = require('selenium-webdriver/chrome'); const firefox = require('selenium-webdriver/firefox'); const webdriver = require('selenium-webdriver'); const { Builder, By, Capabilities, until } = webdriver; let loggingPref = new webdriver.logging.Preferences

Selenium: Trying to get Firefox console logs results in “WebDriverError: HTTP method not allowed”

主宰稳场 提交于 2021-02-07 09:54:03
问题 I'm trying to capture console errors in my selenium tests (node environment with selenium-webdriver 4.0.0-alpha.5 and the latest geckodriver and chromedriver). I've set up one driver for Firefox and another one for Chrome like this: const chrome = require('selenium-webdriver/chrome'); const firefox = require('selenium-webdriver/firefox'); const webdriver = require('selenium-webdriver'); const { Builder, By, Capabilities, until } = webdriver; let loggingPref = new webdriver.logging.Preferences

OSError: [WinError 6] The handle is invalid [Selenium Python]

╄→尐↘猪︶ㄣ 提交于 2021-02-07 09:26:26
问题 I've been running my suite of tests and I'm seeing this error message when I execute my suite. Command used in cmd line: py TestSuite.py Output: Test1 (__main__.TestSuite) ... ok Test2 (__main__.TestSuite) ... ok Test3 (__main__.TestSuite) ... ERROR Test4 (__main__.TestSuite) ... ERROR Test5 (__main__.TestSuite) ... ERROR Test6 (__main__.TestSuite) ... ERROR Test7 (__main__.TestSuite) ... ERROR Traceback (most recent call last): File "E:\Python\lib\site-packages\selenium\webdriver\chrome

Azure Function using Selenium WebDriver.dll

99封情书 提交于 2021-02-07 08:35:59
问题 i am trying to use Selenium WebDriver.dll from Azure Function C# code and having following issue when instantiating WebDriver. Error: 2017-10-16T20:02:25.169 Exception while executing function: Functions.fnTestSelenium. Microsoft.Azure.WebJobs.Script: One or more errors occurred. mscorlib: The path is not of a legal form.2017-10-16T20:02:25.278 Function completed (Failure, Id=2fcb928f-ee39-4cfe-99f2-4be2d57e91b2, Duration=843ms) Code #r "D:\home\site\wwwroot\fnTestSelenium\bin\WebDriver.dll"

Azure Function using Selenium WebDriver.dll

雨燕双飞 提交于 2021-02-07 08:34:09
问题 i am trying to use Selenium WebDriver.dll from Azure Function C# code and having following issue when instantiating WebDriver. Error: 2017-10-16T20:02:25.169 Exception while executing function: Functions.fnTestSelenium. Microsoft.Azure.WebJobs.Script: One or more errors occurred. mscorlib: The path is not of a legal form.2017-10-16T20:02:25.278 Function completed (Failure, Id=2fcb928f-ee39-4cfe-99f2-4be2d57e91b2, Duration=843ms) Code #r "D:\home\site\wwwroot\fnTestSelenium\bin\WebDriver.dll"

Python, Selenium find element with class and wait for class change

淺唱寂寞╮ 提交于 2021-02-07 07:26:45
问题 I have a web page which loads content dynamically and while page loads, there is spinning wheel, I already found solution to grab content loaded immediately on page, but seems i can't find solution to grab content loaded later in dom. What i can think of is to find element with specific class of that wheel spinning, and wait for it to change, once it's changed, than it means content is loaded in dom. I am using Selenium with Firefox webdriver on Ubuntu . Here is the class i am looking to

Selenium 2 (webdriver): Taking a Screenshot returns a black image

空扰寡人 提交于 2021-02-07 06:25:28
问题 I am using Selenium 2 (Webdriver), in an ASP.NET website to build a service, where users can enter their URL and gets screenshots of the page, made with different browsers. My page is hostet on an Windows Server 2008 R2. Taking Screenshots with FirefoxDriver works perfect. But when I am using InternetExplorerDriver , I just get an empty black file. The App is running as Administrator - so there should't be permission issues. My Code: // Opening the Browser var ieCapabilities =