Skip to main content

Posts

Showing posts from July, 2017

Top 50 Tricky Selenium Interview Questions

Previous Post: Good News for Selenium Testers  1. What are the annotations used in TestNG? @Test, @BeforeSuite, @AfterSuite, @BeforeTest, @AfterTest, @BeforeClass, @AfterClass, @BeforeMethod, @AfterMethod 2. How do you read data 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 (); 3. What is the use of xpath? It is used to find the WebElement in web page. It is very useful to identify the dynamic web elements. 4. What are different types of locators? There are 8 types of locators and all are the static methods of the By class. By.id () By.name () By.tagName () By.className () By.linkText () By.partialLinkText () By.xpath By.cssSelector () 5. What is the difference between Assert and Verify? Assert it is used to verify the result. If the test case fails then it ...