Home > Automation Testing (Page 2)

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

Code to Handle alert, window and iframe in Selenium

SwitchTo() Functions are used to handle alert, browser window and iframe. driver.switchTo() functions are used to handle alert window, new tab or new window in browser and iframe within html document.  Refer below table for switchTo functions and their uses: switchTo functions  Uses driver.switchTo().frame(index); Switch focus to iframe element using index of iframe in html document. driver.switchTo().frame("iframe_name"); Switch

This Article is TAGGED in , . Read more

Selenium WebDriver Locator by ID

Here is example to find element by Locator Type as ID  ID is attribute used with HTML element to uniquely identify it in HTML document.  Faster and easiest way to locate an element in HTML document using selenium.  How to find web element by using id in Java language [crayon-67b96f84ba6f3220971976/] Steps to find ID attribute of web element. Open

This Article is TAGGED in , , , . Read more