You are on page 1of 3

1. What are the different navigation commands ?

2. Difference between driver.quit and driver.close?


3. How will you ensure the page is loaded completely and correctly ?
4. Difference between frames and iframes ?
5. Selenium Architecture - Interface and Classes
a. SearchContext is the super most interface
6. Taking Screenshot with code
7. Implicit, Explicit and FluentWait with code
8. NoSuchElementExecption
a. Element you Attempting to find in DOM is not available
b. When ? When the element is not available in DOM / never will
c. Locator may be incorrect / Locator is correct, but some action may needed
make the element appear
9. getCSSValue (font, bgcolor etc)
10. How to identify the broken links in a webpage
11. Limitations of Selenium
12. What are all not possible to automate ?
13. What are the tests which should not be automated ?
14. Challenges used in Selenium

Framework - Explain
1. Config - url, uname and pwd, browser, role, etc
2. What are Listeners ? Are you using it in your framework ?
3. Reporting mechanisms (TestNg, Allure, Extent)
4. BDD ? (At least basic knowledge)
5. Have you used Interface in your framework ?
6. DDT - Reading Data from Excel
Solutions
1. findElement
String locator = By.xpath(“//div[@id=’test’]”);
WebElement element = driver.findElement(locator);

2. Actions Click
Actions act = new Actions(driver);
String locator = By.xpath(“//div[@id=’test’]”);
act.click(locator).perform();

//Take the screenshot


File screenshot = ((TakesScreenshot)
driver).getScreenshotAs(OutputType.FILE);

try {
FileUtils.copyFile(screenshot, new File("C:\\
projectScreenshots\\homePageScreenshot.png"));
} catch (IOException e) {
System.out.println(e.getMessage());
}

// capture entire page as screenshot and store the image


Screenshot s=new
AShot().shootingStrategy(ShootingStrategies.viewportPasting(1000)).take
Screenshot(driver);
ImageIO.write(s.getImage(),"PNG",new File("C:\\
projectScreenshots\\fullPageScreenshot.png"));

// Read From Excel

FileInputStream fis = new FileInputStream(“path of excel file”);

Workbook wb = WorkbookFactory.create(fis);

Sheet s = wb.getSheet(“sheetName”);

String value = s.getRow(rowNum).getCell(cellNum).getStringCellValue();

You might also like