Real Time Automation Testing Interview Questions- Part 2- Selenium
Selenium • What is the difference between findelement & findelements? findelement will give the first appearance of that element which matches our locator, whereas findelements will give us list of all the elements which is present over the webpage and matching our locator. And if we don’t find the element findelement will give us nosuchelementexception whereas findelements will return NULL/Empty list. • Can you tell me how you will handle multiple window in selenium. We have windowhandle & windowhandles function for handling Multiple windows. Windowhandle will give the string value of only the active window that is open whereas windowhandles will give set of all the windows that are open in browser. • How you will move from one window to another? First we will check what all windows are open by using driver.getwindowhandles, to get set of opened windows , then use iterator to iterate over each of the pages and inside for loop will check like Current URL matches with the excep