Selenium Java Interview Questions and Answers Part-24 1) What is Git? What is the difference between Git and GitHub? Git is a distributed version-control system for tracking changes in any set of files. Git is a version control system to manage source code history but GitHub is a hosting service for Git repositories. 2) What…
Selenium Java Interview Questions and Answers Part-23 1) What is a headless browser? Headless browsers provide automated control of a web page in an environment similar to popular web browsers, but they are executed via a command-line interface. Some of the headless browsers are Chrome Headless, PhantomJS, HTMLUnit etc… 2) How frequently do you use…
Selenium Java Interview Questions and Answers Part-22 1) How to select an option in list box? We can use the select class and methods to select an option in list box. Select select = new Select(element); select.selectByVisibleText("QA"); 2) What is an iframe and how to handle it using Selenium WebDriver? An iframe is an…
Selenium Java Interview Questions and Answers Part-21 1) What is the difference between WebDriver Listeners and TestNG Listeners? TestNG work on test related events while WebDriver Listeners work on automation related events. 2) TestNG- Write sample code to select browser depending on parameter given in testing.xml? We can define the browser parameter value in testing.xml:…
Selenium Java Interview Questions and Answers Part-20 1) How do you fail test cases in TestNg? We can use Assert.fail() method to the fail the test case 2) Sequence of execution of below annotations: @Test @BeforeGroups @AfterGroups @BeforeSuite @AfterSuite @BeforeMethod @AfterMethod @BeforeClass @AfterClass? Below is the sequence of annotations: @BeforeSuite @BeforeTest @BeforeClass @BeforeGroups @BeforeMethod @Test…
Selenium Java Interview Questions and Answers Part-19 1) Why do you get NoSuchElementException ? NoSuchElementException is thrown when the element is not present in the page. 2) Write syntax for switching to default content after switching to any frame? driver.switchTo().defaultContent(); 3) Write syntax for actions class? Actions actions = new Actions(driver); actions.moveToElement(element).click().build().perform(); 4)…
Selenium Java Interview Questions and Answers Part-18 1) Explain the usage of different annotations available in TestNG? @BeforeSuite – Method will run before all tests run in the suite @AfterSuite – Method will run after all tests run in the suite @BeforeTest – Method will run before any test method within the class is run…
Selenium Java Interview Questions and Answers Part-17 1) What is the name of the plugin that is used to integrate Eclipse with Cucumber? Cucumber Eclipse Plugin can be used in Eclipse to integrate with Cucumber. 2) What is the meaning of TestRunner class in Cucumber? TestRunner class is the starting point from where the execution…
Java for Testers – Interview Questions and Answers Part-14 1) Write a Java Program to print the below output: * 1 * 12 * 123 * 1234 * 12345 * 123456 * 1234567 public class Patterns { public static void main(String[] args){ int c = 2; int num = 1; System.out.print("*" + " " +…
Selenium Java Interview Questions and Answers Part-16 1) Explain JUnit Runner? A JUnit Runner is a class that extends JUnit’s abstract Runner class. Runners are used for running test classes in a Cucumber Project. Runner class can be run by using the @RunWith annotation 2) What are the steps to generate a report in Cucumber?…