Home > Automation Testing (Page 5)

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-67686348773ef078098884/]  

This Article is TAGGED in , , . Read more

Use of actions class to perform mouse operation in selenium

In Selenium Action class is used to perform drag and drop operation move any element Press composite key hover on element Click action related function with their uses Click and Move Actions Their uses click() Perform left click action on current mouse position. click(WebElement target) Perform left click action on center of given web element. contextClick() Perform right/context click action on current mouse

This Article is TAGGED in , , . Read more

Code to identify all web / broken links of a website

Below selenium code will be useful to identify all website links from all the pages as well as broken links. [crayon-676863487786b912980022/] Output of above program after entering valid url and domain name  Link Name Internal / External Response of link http://www.mundrisoft.com/index.html internal link working 200 http://www.mundrisoft.com/ internal link working 200 http://www.mundrisoft.com/capabilities.html internal link working 200 http://www.mundrisoft.com/case-studies.html internal link working 200 Selenium Tutorial >>

This Article is TAGGED in . Read more

Test bulk urls using Excel VBA macro

To verify page load errors, specific text for thousands of web page it is possible using simple excel Macro.  To perform testing on thousands of URL we can easily use below macro code to verify page load error 404, verification of specific text or any other data validation requirment. [crayon-676863487799f843075789/]   >> Manual Testing

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

Compare images using Java

This code will compare pixel from base image with other image. If both pixel at location (x,y) are same then add same pixel in result image without change. Otherwise it modifies that pixel and add to our result image. In case of baseline image height or width is larger than other image

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