Skip to main content

Posts

Showing posts from February, 2017

Using Selenium for Web Automation? Let UFT Pro (LeanFT) help you!

Using Selenium for Web Automation? Let UFT Pro (LeanFT) help you!: Intro Selenium is a widely used, cross-platform, open-source framework for web application automation. Selenium’s core feature is its WebDriver API, which allows the creation of tests (scripts) in various programming languages, and run them on various browsers. HPE UFT Pro (LeanFT) is a functional...

Popular posts from this blog

Alternate Way for sendKeys

One of my friend called me yesterday, he had an interview on Selenium WebDriver and got confused on 1 Question.

What is an alternative for sendKeys Method in WebDriver? I also got stammered on this and thought in mind
Why the hell do we need this? There are below possible reason that I could find, When we need any alternative to sendKeys.
When the Text element is disabled or locked, sendKeys can not set the value in text field.
(in my opinion, this is not the correct way of Automation, because the element is locked or disabled by intend to not allow any text insertion)When we want to write huge text as input... that time the way WebDriver work, by sending Series of characters from String one by one, and Which is Very time consuming. so to minimize that time we can use this alternate method So now we have above two problems with sendKeys ......
Solution!!! The best alternative I found is JavaScript
Way 1 to Execute Script WebDriver driver = new FirefoxDriver(); driver…

Selecting Date on JQuery Datepicker

Hello Friends,

In this post we will see how to select specific date in JQuery Datepicker.

Its very easy to enter date as text by .sendKeys() method, but mostly when application uses JQuery Datepicker, it disables typing on the text-box. the text-box sets to read only.

While automating such screens we need to write logic which can interact with Datepicker and selects desired date.

Consider below example of Datepicker.


Html code for above example is


To automate this, we first break apart a problem.
Decide which date we want to set Read the current date from datepicker Calculate difference between both dates in Months(difference will positive in case of set date is in future respective to current date & will negative when set date is in past respective to current date of datepicker) Set loop depends on month difference and navigate the datepicker to specific month Select the Day. 
Lets implement the above logic.
Note: we have used Joda Date Time Library for calculate date and time …

XPATH Basics....

XPATH Basics...
XPath is a text syntax for locating parts of HTML document XPath contains a library of standard functions which helps to locate the WebElement XPath is a W3C recommendation
XPath uses path expressions to select WebElement or sets of WebElements in Web page. These expressions look very much like the expressions you see when you work with a traditional computer file system. like c:\MyFolder\another_folder\myFile.txt
XPATH terminologies Nodes While using Selenium WebDriver, we come across following three types of nodes
elementattributetext Look at below HTML code sample
Link to GoogleLink to YahooLink to FaceBook here div, a are element nodes (element is the basically type of WebElement). Attribute nodes for div element is class and its value is myLink"a" element has text nodes as Link to Google, Link to Yahoo, Link to FaceBook Relationship of Nodes There are various relations available in XPATH but as a selenium user we must have knowledge of below relations…