selenium-chromedriver

Break on exception in Chrome using Selenium

六眼飞鱼酱① 提交于 2021-02-07 13:34:20
问题 In order to investigate some Selenium test failures I would like to automatically enable the pause on exception feature in the Chrome Devtools when running the tests. There is the --auto-open-devtools-for-tabs command line option for automatically opening the DevTools pane which I am already using but apparently there is no CLI option/parameter for the autopause feature I am looking for. What I came across though is the Debugger.setPauseOnExceptions Chrome Devtools Protocol command which I

Break on exception in Chrome using Selenium

穿精又带淫゛_ 提交于 2021-02-07 13:31:04
问题 In order to investigate some Selenium test failures I would like to automatically enable the pause on exception feature in the Chrome Devtools when running the tests. There is the --auto-open-devtools-for-tabs command line option for automatically opening the DevTools pane which I am already using but apparently there is no CLI option/parameter for the autopause feature I am looking for. What I came across though is the Debugger.setPauseOnExceptions Chrome Devtools Protocol command which I

Python Selenium with Chrome. How to switch between different tabs

北慕城南 提交于 2021-02-07 10:24:42
问题 I click a button which opens a new tab. How to I then navigate around the new tab? This sounds like a simple task but after several hours trying to find a solution I'm not any closer. Is there a simple way of doing this? Tried using keys for CONTROL + 'T' and read other suggestions but nothing seems to work. Many thanks 回答1: I just implemented my solution and it worked for my case, which looks very similar to yours. First you need to check the window_handles : len(driver.window_handles) > 1

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

How to Detach Chrome Browser from Chrome Driver (Selenium Web Driver C#)

天大地大妈咪最大 提交于 2021-02-07 03:03:42
问题 I want to use Selenium Web Driver in VS 2010 C# to open a Chrome browser, navigate to some web page and then close the driver but keep the browser open . I realize that I will have to manually close the browser afterwards and I'm okay with that. So far I have: DriverService service = ChromeDriverService.CreateDefaultService(); ChromeOptions options = new ChromeOptions(); options.AddAdditionalCapability("chrome.detach",true); m_driver = new ChromeDriver(service, options, TimeSpan

How to Detach Chrome Browser from Chrome Driver (Selenium Web Driver C#)

橙三吉。 提交于 2021-02-07 03:01:23
问题 I want to use Selenium Web Driver in VS 2010 C# to open a Chrome browser, navigate to some web page and then close the driver but keep the browser open . I realize that I will have to manually close the browser afterwards and I'm okay with that. So far I have: DriverService service = ChromeDriverService.CreateDefaultService(); ChromeOptions options = new ChromeOptions(); options.AddAdditionalCapability("chrome.detach",true); m_driver = new ChromeDriver(service, options, TimeSpan

How to scrape the first element of each parent using from The Wall Street Journal market-data quotes using Selenium and Python?

て烟熏妆下的殇ゞ 提交于 2021-02-05 10:46:21
问题 Here is the HTML that I'm trying to scrape: I am trying to get the first instance of 'td' under each 'tr' using Selenium (beautifulsoup won't work for this site). The list is very long so I am trying to do it iteratively. Here is my code: from selenium import webdriver import os # define path to chrome driver chrome_driver = os.path.abspath('C:/Users/USER/Desktop/chromedriver.exe') browser = webdriver.Chrome(chrome_driver) browser.get("https://www.wsj.com/market-data/quotes/MET/financials

Can you help me use Selenium to click Add To Cart button?

柔情痞子 提交于 2021-02-05 09:26:57
问题 I am trying to do a tutorial and learn Selenium in python however i cant seem to get Selenium to click the "Add To Cart" button using either find_element_by_class or find_element_by_XPATH. The problem is to check if the item is out of stock, and if it is out of stock then to refresh the webpage and restart the script. If the item is in stock then it should click "Add To Cart" I am using: Python v3.9 Chrome v87 This is the URL i am practicing on: https://www.currys.co.uk/gbuk/tv-and-home

Fullscreen in Headless Chrome using Selenium [duplicate]

扶醉桌前 提交于 2021-02-05 09:26:18
问题 This question already has answers here : How to set window-size to fullscreen for headless-chrome using chrome options? (3 answers) Closed 3 months ago . I have a number of tests in an E2E suite where a video element is fullscreened and the fullscreen status is verified. However, when running the suite headlessly, these tests fail. Screenshots of the page show the video is simply not in fullscreen, even after the fullscreen button is clicked. Is there a way to achieve fullscreen functionality

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

回眸只為那壹抹淺笑 提交于 2021-02-05 08:15:48
问题 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