Home > Selenium WebDriver (Page 2)

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-67372425d197c642843408/] Steps to find ID attribute of web element. Open

This Article is TAGGED in , , , . Read more