selenium-webdriver

Selenium Webdriver C# element.Enabled evaluating to true when element is still disabled

旧巷老猫 提交于 2021-01-27 08:29:30
问题 My automated tests used to run smoothly, but we moved the QA environment to a different server, and now the tests are failing because the it keeps tries to click on elements that are still loading and greyed out/disabled. Here is part of the code that worked just fine on the previous server: while ( less than 7 seconds ) if (driver.FindElements(by).Count > 0) { if (driver.FindElement(by).Enabled && driver.FindElement(by).Displayed) break; } else { go back to while loop } The problem is that

Proxy authentication popup in Selenium

蓝咒 提交于 2021-01-27 07:41:03
问题 I am working on a project where I need to use a proxy. I am using the Chrome browser and when I run my script it forces me to enter the username and password of the proxy. I have tried passing the username and password with the URL itself, but it is not working. Here is the code: Proxy p = new Proxy(); p.setHttpProxy("in-pr.oxylabs.io:20000"); p.setSslProxy("in-pr.oxylabs.io:20000"); System.setProperty("webdriver.chrome.driver","D:\\Love_Testing\\Senium_Naveen\\chrome Driver\\chromedriver

Proxy authentication popup in Selenium

余生长醉 提交于 2021-01-27 07:40:34
问题 I am working on a project where I need to use a proxy. I am using the Chrome browser and when I run my script it forces me to enter the username and password of the proxy. I have tried passing the username and password with the URL itself, but it is not working. Here is the code: Proxy p = new Proxy(); p.setHttpProxy("in-pr.oxylabs.io:20000"); p.setSslProxy("in-pr.oxylabs.io:20000"); System.setProperty("webdriver.chrome.driver","D:\\Love_Testing\\Senium_Naveen\\chrome Driver\\chromedriver

Selenium - Exception - Connection getting closed

ぃ、小莉子 提交于 2021-01-27 07:07:07
问题 I am using the latest Selenium WebDriver running using .NET/Microsoft Technology stack. What I am observing these days is that all of my tests in the suite starts failing throwing this exception Additional information: A exception with a null response was thrown sending an HTTP request to the remote WebDriver server for URL http://localhost:5557/wd/hub/session/c775e68e-c842-41b3-a1a6-44a88ef4c210/element. The status of the exception was KeepAliveFailure, and the message was: The underlying

selenium scroll by specific pixel values

梦想与她 提交于 2021-01-27 05:20:27
问题 I see for python selenium I can scroll to element using self.driver.execute_script("return arguments[0].scrollIntoView(true);", element) Or using pixel value as driver.execute_script("window.scrollTo(0, <vertical_position_to_scroll> )") But is there way to scroll by specific pixel values from current element or current position. e.g. If I moved to element I want to scroll 10 pixel up from there. 回答1: I would use window.scrollBy(x, y) like this: #first move to the element self.driver.execute

npm error - Cannot find module './selenium-webdriver/lib/input'

送分小仙女□ 提交于 2021-01-27 04:58:06
问题 After I updated my Angular project's version from 5 to 7, I was getting a lot of vulnerabilities, to fix it - I ran all the commands that was suggested in the "npm audit" and all the vulnerabilities was fixed. But now when I run: ng serve I get this error: ERROR in node_modules/protractor/built/ptor.d.ts(33,17): error TS2307: Cannot find module './selenium-webdriver/lib/input'. Edit If I get in to the errors sources I can see the problem line: // node_modules/protractor/built/ptor.d.ts Key:

How to automate captcha using Selenium Webdriver? [closed]

笑着哭i 提交于 2021-01-27 04:36:15
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 1 year ago . Improve this question I am writing a script for a login page. But I have a captcha that I want to handle. 回答1: Selenium can't handle captcha. While website using captcha for the same reason so no one can automate their website using any robots. You can ask your developers to

what is the error of cucumber.runtime.CucumberException: Arity mismatch: Step Definition in selenium with Java

蓝咒 提交于 2021-01-27 03:52:27
问题 I have wrritten a feature file to test the create elements button. But it generates an error message of cucumber.runtime.CucumberException: Arity mismatch: Step Definition. I dont know why its happening since I am new to automation testing. The following is the code that I have written. @When("^create elements$") public void create_elements_for_attributes(WebElement elementToClick) throws Throwable { driver.findElement(By.id("newElement")).click(); } The error that I have recieved is as

what is the error of cucumber.runtime.CucumberException: Arity mismatch: Step Definition in selenium with Java

我的未来我决定 提交于 2021-01-27 03:51:33
问题 I have wrritten a feature file to test the create elements button. But it generates an error message of cucumber.runtime.CucumberException: Arity mismatch: Step Definition. I dont know why its happening since I am new to automation testing. The following is the code that I have written. @When("^create elements$") public void create_elements_for_attributes(WebElement elementToClick) throws Throwable { driver.findElement(By.id("newElement")).click(); } The error that I have recieved is as

How to write a CSS Selector selecting elements NOT having a certain attribute?

和自甴很熟 提交于 2021-01-27 02:50:48
问题 How to write a CSS Selector selecting elements NOT having a certain attribute? I have 2 <div> nodes as follows: First: <div class="weEq5" style="will-change; width;"> <button class="_35EW6"> Second: <div class="weEq5"> <button class="_35EW6"> I need to select the <div> (with the similar class) and each of them which have a similar descending <button> but without the style attribute. XPath seems working fine as: //div[@class and not (@style)]/button I am looking for an equivalent CssSelector .