browser-automation

manually able to log in but with salenium webdriver its showing invalid credentials,how to handle this?

不问归期 提交于 2019-12-08 12:48:07
问题 i am using Selenium webdriver with java to automate an angularJS based app. Manually i am able to log in to the application but in automation its showing invalid credentials. I checked with credential, they are same. I tried two location strategies Css selector and Xpath results are same. /*driver.findElement(By.cssSelector("#username")).sendKeys("9813555555");//username driver.findElement(By.cssSelector("#password")).sendKeys("9813555555");//password driver.findElement(By.cssSelector(".btn

Write TestCases using PageFactory (Selenium-WebDriver). Advantages? [closed]

。_饼干妹妹 提交于 2019-12-08 09:27:24
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 3 years ago . Is it a good practice to go the PageFactory way when writing testcases in Selenium2? If yes why? To be frank I have never used them when writing test-cases and have not missed it either. But I would to know what are the advantages of using PageFactory over not using it. 回答1:

WebDriver API blocking behavior when browser is busy executing some long running JavaScript

回眸只為那壹抹淺笑 提交于 2019-12-07 04:05:58
问题 I read somewhere in the docs that WebDriver API's are non blocking (except for a few like driver.get). So performing a WebElement click() or isDisplayed() should generally be asynchronous (assuming native events are enabled, of course). I have a simple HTML page that performs a long operation (basically a long loop). While the JS executes, the browser is unresponsive which is expected. But I also noticed that WebDriver API's like click()/isDisplayed()/executeScript() block as long as the

Convert iMacros script into another free automation tool like Kantu or Selenium?

依然范特西╮ 提交于 2019-12-06 09:57:41
问题 I'm trying to create a script to perform mass actions on a personal account (context not relevant, I think). I figured a way to do it using this script for iMacros and it was working. However, I needed to add a new variable to have a random delay between actions instead of having a fixed "WAIT SECONDS". Since I'm using the free version of iMacros, this doesn't work because it's using more than 3 variables :( Now, problem is, I have no idea how to convert this script into another browser

Browser Automation with Selenium: Fingerprints, recognizability and traceability?

旧时模样 提交于 2019-12-06 05:46:32
问题 I want to use selenium/webdriver to simulate a browser and scrape some website-content with it. Even if its not the fastest method, for me it has many advantages such as executing scripts etc. For many websites it is forbidden to access them via an automated method, for example search engines like google or bing. For one tool i need to scrape the estimated resultstat from google for several keywords. This will look like the following: simulate the browser that visits google.com and types in a

What is the mechinism used for commiunication between webdriver and browser

我的未来我决定 提交于 2019-12-06 02:54:13
Anyone can explain how communication happen between browser and web-driver?. How does webdriver object read and identify html elements in browser ?. For that what is the relationship between webdriver object and browser and how to build the relationship browser and webdriver object? driver = new FirefoxDriver(); driver.findElements(By.id("element")); The communication between webdriver and browser happens through a json-wire protocol which is specified in the W3C documentation . All browsers that webdriver supports, uses this same protocol. How does webdriver read and identify elements in a

How to use multiple locators to find an element in selenium webdriver

五迷三道 提交于 2019-12-05 18:21:20
How can I locate an element in a page with selenium webdriver by using multiple locators at the same time . I am having 2 elements with same id but different values. So in order to access them I need to use a combination of both id and value. What is the syntax. I'm using java. Also I'm automating an application that works only in IE. Since I'm unable to access xpath, I'm not using it. element=driver.findElement(By.id("id").cssSelector("input[@value='value1']")); Xpath allows you to use and and or to evalute multiple attributes. so you can form an xpath using this //input[@id='id' and @value=

WebDriver API blocking behavior when browser is busy executing some long running JavaScript

余生长醉 提交于 2019-12-05 11:17:45
I read somewhere in the docs that WebDriver API's are non blocking (except for a few like driver.get). So performing a WebElement click() or isDisplayed() should generally be asynchronous (assuming native events are enabled, of course). I have a simple HTML page that performs a long operation (basically a long loop). While the JS executes, the browser is unresponsive which is expected. But I also noticed that WebDriver API's like click()/isDisplayed()/executeScript() block as long as the browser is busy executing the script. Since WebDriver is issuing a native event for the click and not a

How to use synchronize in Capybara exactly?

蹲街弑〆低调 提交于 2019-12-05 01:58:26
If how to use wait_until is pretty clear (I've used the methods like this while creating tests through the native Webdriver methods), but not the new synchronize method (sorry:)). I've read the theme about why wait_until is deprecated, I've read the article about that, I've read the docs with method description and also read the code where the description present too. But I didn't find any example or tutorial how exactly to use this method. Anybody, please, provide few cases where I (and maybe someone else) could see and learn how to use this method For example the case expect(actual).to equal

How Do You Set Value of Input Element Programmatically Through CSharp?

风格不统一 提交于 2019-12-05 00:28:49
问题 Hello I am trying to automate my IE to log into a website but the problem is that the input elements do not have an HTML ID attribute! For example: <input type="text" name="user" size="15" value=""> How do you program C# to insert text in this text box? Thanks 回答1: Add the following attributes to your input tag: runat="server" and id="someId" <input id="user" type="text" size="15" runat="server"> Then server-side you do: user.Text = "sample text"; Then you can do something like: foreach