selenium-webdriver

In Python3.6 (selenium module): ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine

别来无恙 提交于 2020-01-25 00:13:05
问题 I am studying Python with the book "Automate the boring stuff with Python" (written by Al Sweigart) and I have a problem with web scraping (Chapter 11), namely the selenium module. I am writing the following in Python IDLE: >>> from selenium import webdriver >>> browser = webdriver.Firefox() # Here Windows command black window appears # and Mozilla Firefox with blank page opens >>> browser.get('http://inventwithpython.com') Traceback (most recent call last): File "<pyshell#2>", line 1, in

Exception in thread “main” java.lang.NoClassDefFoundError: okhttp3/ConnectionPool with Selenium and Java

被刻印的时光 ゝ 提交于 2020-01-24 23:40:11
问题 i have a simple Selenium Test Code: public static void main(String[] args) { System.setProperty("webdriver.chrome.driver", "/home/chromedriver"); WebDriver driver= new ChromeDriver(); driver.get("http://google.com"); } And i get this Error: Exception in thread "main" java.lang.NoClassDefFoundError: okhttp3/ConnectionPool | Caused by: java.lang.ClassNotFoundException: okhttp3.ConnectionPool I think the jars and Dependency are ok but i still get this Error 回答1: please check of this jars files

FirePath not displaying HTML code after typing x-path

99封情书 提交于 2020-01-24 23:19:13
问题 Upon typing xpath in fire-path text field, if x-path is correct then it'll display the corresponding HTML code. It was working fine previously. But now it's not displaying the corresponding HTML code even though the xpath is correct. Can anyone help me to find the solution for this problem? I even uninstalled fire-path and installed again but still, it's not working. 回答1: If you visit the GitHub Page of FirePath, it clearly mentions that : FirePath is a Firebug extension that adds a

Unable to open Edge in InPrivate mode using selenium web driver

筅森魡賤 提交于 2020-01-24 21:30:17
问题 From the C# object model, it looks like this should do the trick, but the UseInPrivateBrowsing property has no effect at my end. Just opens a regular browser session in the edge. var options = new EdgeOptions(); options.UseInPrivateBrowsing = true; var driver = new EdgeDriver(options); I am using the latest Selenium.WebDriver.MicrosoftDriver. These are the installed packages: <?xml version="1.0" encoding="utf-8"?> <packages> <package id="NUnit" version="3.10.1" targetFramework="net47" />

Unable to open Edge in InPrivate mode using selenium web driver

时间秒杀一切 提交于 2020-01-24 21:29:04
问题 From the C# object model, it looks like this should do the trick, but the UseInPrivateBrowsing property has no effect at my end. Just opens a regular browser session in the edge. var options = new EdgeOptions(); options.UseInPrivateBrowsing = true; var driver = new EdgeDriver(options); I am using the latest Selenium.WebDriver.MicrosoftDriver. These are the installed packages: <?xml version="1.0" encoding="utf-8"?> <packages> <package id="NUnit" version="3.10.1" targetFramework="net47" />

While fetching all links,Ignore logout link from the loop and continue navigation in selenium java

匆匆过客 提交于 2020-01-24 20:29:56
问题 I am fetching all the links in the page and navigating to all links. In that one of the link is Logout. How do i skip/ignore Logout link from the loop? I want to skip Logout link and proceed List demovar=driver.findElements(By.tagName("a")); System.out.println(demovar.size()); ArrayList<String> hrefs = new ArrayList<String>(); //List for storing all href values for 'a' tag for (WebElement var : demovar) { System.out.println(var.getText()); // used to get text present between the anchor tags

While fetching all links,Ignore logout link from the loop and continue navigation in selenium java

余生颓废 提交于 2020-01-24 20:29:09
问题 I am fetching all the links in the page and navigating to all links. In that one of the link is Logout. How do i skip/ignore Logout link from the loop? I want to skip Logout link and proceed List demovar=driver.findElements(By.tagName("a")); System.out.println(demovar.size()); ArrayList<String> hrefs = new ArrayList<String>(); //List for storing all href values for 'a' tag for (WebElement var : demovar) { System.out.println(var.getText()); // used to get text present between the anchor tags

InvalidElementStateException when attempting to clear text through Selenium

痞子三分冷 提交于 2020-01-24 20:14:08
问题 The web application I am testing requires confirmation when deleting a record. I have created a test to enter in a valid reason for deleting this record. The code to do this is as follows: DeleteFieldButton. Click(); WaitMethods.WaitForElementToBeDisplayed(RemovalReason, 20); RemovalReason .Click(); RemovalReason .Clear(); RemovalReason .SendKeys("Automated Test - Delete Field"); The XPath to the text box is as follows: private Label RemovalReason = new Label(By.XPath("//*[@placeholder =

Error CS7036 There is no argument given that corresponds to the required formal parameter 'driver' of 'SpecflowBaseTest.SpecflowBaseTest(IWebDriver)'

社会主义新天地 提交于 2020-01-24 19:46:09
问题 I am creating a new framework as PageFactory has been deprecated. I am getting the error Error CS7036 There is no argument given that corresponds to the required formal parameter 'driver' of 'SpecflowBaseTest.SpecflowBaseTest(IWebDriver)' UnitTestProject1 D:\Selenium Projects\Olympus\UnitTestProject1\UnitTestProject1\Steps\LoginSteps.cs 14 Active My full code snippet of my framework is below. I am trying the dependency injection because PageFactory is deprecated, not used anymore. I am not

Selenium: are there events like “New element inserted in DOM”

时光总嘲笑我的痴心妄想 提交于 2020-01-24 18:21:13
问题 The site I am testing has a notification logic that brings up a message at the bottom of the screen, keeps it there for one second and then sends it away. When the notification is displayed it hides other elements and that makes my test unstable. I did my best to figure out when the notification is displayed (when the business logic displays it) and dismiss it but every now and then I detect new cases my code are not aware of when the notification is displayed. Is there a way (using Selenium)