Automation Interview Questions Java Selenium

5 How to invoke an application in WebDriver?

When using WebDriver, you can launch applications by either calling the “get” method on the driver instance, or by using the “navigate” method. Applications can also be invoked using a third-party tool such as Selenium IDE. However, doing so requires that you have the URL of the application to be launched beforehand. When using the “get” method, you simply need to pass in the URL of the application as a string.Â

4 What are the WebDriver supported Mobile Testing Drivers?

There are four main WebDriver-supported mobile testing drivers: AndroidDriver, IPhoneDriver, RemoteWebDriver, and Selendroid.

  • AndroidDriver is used to test Android applications. It can be used on real devices or emulators.
  • IPhoneDriver is used to test iOS applications. It can only be used on real devices.
  • RemoteWebDriver is used to test web applications on mobile devices. It can be used with a variety of browsers, including Safari, Chrome, and Firefox.
  • Selendroid is used to test Android applications. It can be used on real devices or emulators.
  • Explain the difference between single slash and double slash in XPath.

  • Single slash (/): Single slash is used to create an XPath with an absolute path. In this case, the XPath would start selection from the document’s start node.
  • Double slash (//): Double slash is used to create an XPath with a relative path. In this case, the XPath would start selection from anywhere within the document.
  • What are the different types of WAIT statements in Selenium WebDriver? Or the question can be framed like this: How do you achieve synchronization in WebDriver?

    There are basically two types of wait statements: Implicit Wait and Explicit Wait.

    Implicit wait instructs the WebDriver to wait for some time by polling the DOM. Once you have declared implicit wait, it will be available for the entire life of the WebDriver instance. By default, the value will be 0. If you set a longer default, then the behavior will poll the DOM on a periodic basis depending on the browser/ driver implementation.

    Explicit wait instructs the execution to wait for some time until some condition is achieved. Some of those conditions to be attained are:

    38)  Using web driver how you can store a value which is text box?

    You can use following command to store a value which is text box using web driver

    3  What is test automation or automation testing?

    Test automation or automation testing is the process of using specialized software to control the execution of tests and compare the results with expected outcomes. Automation testing can help reduce the time, cost, and effort required to test software applications by automating repetitive tasks and allowing testers to focus on more critical test cases.Â

    4 Write a code snippet to launch Chrome browser in WebDriver.

    WebDriverWait wait = new WebDriverWait(driver, 30);

    String url = “https://www.google.com”;

    System.out.println(“Page title is: ” + driver.getTitle());

    This code snippet will launch the Chrome browser, navigate to Google.com, and then print the page title to the console.

    12) What is JUnit Annotations and what are different types of annotations which are useful?

    In JAVA a special form of syntactic meta-data can be added to Java source code, this is know as Annotations. Variables, parameters, packages, methods and classes are annotated some of the Junit annotations which can be useful are

  • Test
  • Before
  • After
  • Ignore
  • BeforeClass
  • AfterClass
  • RunWith
  • Ques. Which browsers/drivers are supported by Selenium Webdriver?

    Ans. Some commonly used browsers supported by Selenium are-

  • Google Chrome – ChromeDriver
  • Firefox – FireFoxDriver
  • Internet Explorer – InternetExplorerDriver
  • Safari – SafariDriver
  • HtmlUnit (Headless browser) – HtmlUnitDriver
  • Android – Selendroid/Appium
  • IOS – ios-driver/Appium
  • Automation Testing Interview| Java Interview Questions For Selenium Testers

    Related Posts

    Leave a Reply

    Your email address will not be published. Required fields are marked *