Home > Selenium WebDriver

File Upload Using Windows Automation Tool And Selenium

Here are the step to upload file using selenium Click on Select file / Select button (This part could be handled using Selenium) Select file from open dialogue box(This part could not be handled using selenium) Click on Upload or Upload file button. File Upload for INPUT tag with TYPE ="file" Example Url: If

This Article is TAGGED in , , . Read more

Java library for text file operations

To perform text file operation like Create File, Compare Text file, Replace words etc we have created jar which you can download Attached Zip File: TextUtility  After extracting zip file you will get jar file which contains below functionality which is extremely easy to use. Functions appendLine → Read Text File and append new

This Article is TAGGED in , , , , . Read more

Selenium WebDriver Locator: Class Name

Locator Type: Class Name Class attribute in HTML element used to apply style or select web element(s) JavaScript functions.  One class attribute could contain multiple classes separated by space and it is called as composite class.  Class attribute need not to be unique like id.  Java code to find web element using class attribute value.  [crayon-67370d996d654104500867-i/] Steps to

This Article is TAGGED in , , , . Read more

Selenium WebDriver Locator: Tag Name

Locator Type: Tag Name  HTML document is structure of different html elements which normally contains start tag with attribute closing tag and some text within opening and closing tag.  Opening tag consist within Tag Name within two angular brackets (‘<’ and ‘>’) while closing tag contains forward slash before Tag Name within angular brackets. Java code to find

This Article is TAGGED in , , , . Read more

Selenium Locator: Link Text and Partial Link Text

Locator Type:  Link Text or Partial Link Text. This locator is used to locate anchor web element using it's text. Link text is a element text between opening <a> and closing anchor tag </a>. Partial link text is used to find anchor element similar to point 1 but it used partial unique text

This Article is TAGGED in , , . Read more

Use Actions class to perform keyboard event in selenium

Code to perform key press events , mouse left right operations using action class. Functions for keyboard Uses keyDown(java.lang.CharSequence key) To simulate key down event on current location. keyDown(WebElement target, java.lang.CharSequence key) To simulate key down event on target element. keyUp(java.lang.CharSequence key) To simulate key up event on current location. keyUp(WebElement target, java.lang.CharSequence key) To simulate key up event on

This Article is TAGGED in . Read more

Use Action class to perform drag and drop In selenium

Drag and drop activity performed by using Actions class. dragAndDrop(WebElement source, WebElement target) → It used to drag source element to target web element. dragAndDropBy(WebElement source, offsetX , offsetY) →  It used to drag source web element to targeted location using offset. Code snippet: [crayon-67370d996df54858176607/]  

This Article is TAGGED in , , . Read more

Write xpath using text and text functions in selenium?

Write Xpath using element text and string functions. Information for this section  Symbols used while Xpath creation ./ (period symbol and forward slash)      → Current element /* (forward slash and asterisk symbol)   → All child element of current element .. (double period symbol)                          → Immediate parent

This Article is TAGGED in , , , . Read more

Write xpath using attribute and tag name in Selenium

Xpath Basic Information Xpath is a language and used to find targeted web element within html document. Types of Xpath Absolute Xpath: Path from root element to targeted element without missing any elements in between. Absolute xpath could be form by using '/' (single forward slash) and '[index]' (square bracket with index). Example: To locate <input>

This Article is TAGGED in , , , . Read more

Code to locate element by Name using Selenium Webdriver

Locator Type: Name  Name attribute is unique throughout html document except checkbox and radio button.  Name attribute is not unique if multiple radio button and checkboxes used with same name.  Name attribute used with iframe which can be used to switch driver from current web page to iframe by using name.  Java code to

This Article is TAGGED in , , . Read more