selenium-webdriver

pyinstaller and geckodriver generate issue after compile to exe

a 夏天 提交于 2021-02-19 06:24:05
问题 I hope i will get help here. I'm writing program who will read and export to txt 'devices live logging events' every two minutes. Everything works fine until i generate exe file. What is more interesting, program works on my enviroment(geckodriver and python libraries installed), but does not work on computers without python enviroment. Even if I generate exe with --onedir. Any ideas or tips? part of code is below(without tkinter): browser = webdriver.Firefox() def logs(): global writing

Difference between JsonWireProtocol mechanisms and the new standards in W3C Living Document when using Selenium

强颜欢笑 提交于 2021-02-19 05:34:21
问题 I'm wondering what are the differences between the mechanisms in JsonWireProtocol ( Status: OBSOLETE ) and W3C Living Document from 31 December 2019 ( the new standard ) when using Selenium for UI tests. I know that Selenium have used the following: When we make a new instance of a driver (C#): using OpenQA.Selenium; using OpenQA.Selenium.Chrome; IWebDriver driver = new ChromeDriver(); we actually make a POST /session request to the selenium server. After that via JsonWireProtocol and, in

Exception while taking screenshot null and FAILED CONFIGURATION: @AfterMethod teardown

拥有回忆 提交于 2021-02-19 05:24:45
问题 I am facing some trouble and got stuck since yesterday; unable to figure out the cause for it. Tried solution of answers here. I created @Test, with sample of code to login and check dashaboard of application. and @AfterMethod, for when Assert is false, should capture a screenshot. If i comment the Aftermethod code it works fine without any issue; It used to run fine w/o any problem earlier. Could you please help me in finding some solution. (it may be very small thing for you.. but pls do

Chrome canary headless mode does not work on windows10

ぃ、小莉子 提交于 2021-02-19 04:16:50
问题 Google Chrome Canary does not work with headless on Windows. Chrome headless does not work on windows. The Error happens like following when I tried to execute below code. But it works on non-headless mode. I know Canary is unstable but I want to using it to learning about web advanced spec. This error caused by bug in canary? Or caused by my code? code: from selenium import webdriver from selenium.webdriver.chrome.options import Options op = Options() op.binary_location = "C:\\Users\

Chrome canary headless mode does not work on windows10

感情迁移 提交于 2021-02-19 04:14:53
问题 Google Chrome Canary does not work with headless on Windows. Chrome headless does not work on windows. The Error happens like following when I tried to execute below code. But it works on non-headless mode. I know Canary is unstable but I want to using it to learning about web advanced spec. This error caused by bug in canary? Or caused by my code? code: from selenium import webdriver from selenium.webdriver.chrome.options import Options op = Options() op.binary_location = "C:\\Users\

Python proxy authentication through Selenium chromedriver

青春壹個敷衍的年華 提交于 2021-02-19 03:10:18
问题 We tried for a few days to setup Proxy Authentication with selenium chromedriver in Python. We couldn't set ip up because Chrome throws a pop-up for authentication. Problem is that selenium can't switch to that window and so, can't type. The only solution that worked for us was using pyautogui which is a bad solution for us because we want to use the headless function. Here are all the methods we tried: driver.switch_to_window() driver.switch_to_active_element() driver.switch_to_alert()

Python proxy authentication through Selenium chromedriver

痞子三分冷 提交于 2021-02-19 03:06:10
问题 We tried for a few days to setup Proxy Authentication with selenium chromedriver in Python. We couldn't set ip up because Chrome throws a pop-up for authentication. Problem is that selenium can't switch to that window and so, can't type. The only solution that worked for us was using pyautogui which is a bad solution for us because we want to use the headless function. Here are all the methods we tried: driver.switch_to_window() driver.switch_to_active_element() driver.switch_to_alert()

Selenium test in Internet Explorer in InPrivate mode

强颜欢笑 提交于 2021-02-18 22:11:12
问题 Is there any way how to run Selenium automation test in Internet Explorer 9 in InPrivate mode with IEDriverServer? I need to test 2 (two) testcases: 1. browser is closed. Open one window of IE InPrivate mode. Run test. 2. browser is opened in normal mode. Open new window of IE InPrivate mode. Run test. How should JAVA code look for this tests? Thank you 回答1: public void openBrowserInPrivacyMode(boolean isBrowserActive) { System.setProperty("webdriver.ie.driver", "path/to/IEDriverServer_x32

Specifying multiple conditions in xpath

旧时模样 提交于 2021-02-18 11:42:05
问题 I want to select all the tags with <td class='blob-code blob-code-addition'> and <td class='blob-code blob-code-deletion'> . So I am trying to include or condition here between the two predicates. It does not work. However, if I include only one of the two classes it works . What is the problem here? Something is wrong with the syntax. By getChanges = By.xpath("//td[@class='blob-code blob-code-addition'] or //td[@class='blob-code blob-code-deletion']"); 回答1: You want to specify that like the

How to find element that has multiple class in selenium

不羁的心 提交于 2021-02-18 08:05:25
问题 I have an element with 3 classes which I need to find with selenium <button style="padding:2px 7px; background-color:#4caeea" class="btn btn-xs btn-custom" </button> I could not find it with : By.classname("btn btn-xs btn-custom") I do not want to use xpath & cssSelector . What other options do I have ? 回答1: This By.classname("btn btn-xs btn-custom") will not work, as it contains multiple spaces which means it is combination of 3 classes. You will have to switch to css selector or xpath , I