Q. How to handle frame in Webdriver?
Ans:
- Select iframe by id: driver.switchTo().frame(*ID of the frame*);
- Locating iframe using tagName;driver.switchTo().frame(driver.findElements(By.tagName(*iframe*).ger(0));
- Locating iframe using index driver.switchTo().frame(0);
- frame(Name of Frame);driver.switchTo().frame(*name of the frame*);
- Select Parent window:driver.switchTo().defaultContent();
Q. How can we handle web based pop up?
Ans:
- Alert alert = driver.switchTo().alert();
- alert.accept();
Q. Explain using Webdriver how you can perform double click?
Syntax:
- Actions act = new Actions(driver);
- act.doubleClick(webelement);
Q. When we can use Actions class in Selenium Webdriver test case?
- Drag and drop element
- Drag and drop by X,Y pixel offset
- Selecting JQuesry selectable Items
- Moving JQuery slider
- Re-sizing JQuery re-sizable element
- Selecting date from JQuery date picker
Q. Five web driver common exceptions which you faced during test case execution?
- Timeout Exception : This exception will be thrown when command execution does not complete in given time
- NoSuchElement Exception : Webdrvier will throw this exception when element could not be found on page
- ElementNotSelectableException : It will be thrown when webdriver is trying to select unselectable element
- ElemtnNotVisible Exception : Thrown when webdriver is not able to INTERNET with element which is available in DOM but is is hidden
No comments