Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Selenium Interview Questions and Answers

Ques 26. What is the wait? How many types of waits in selenium?

Selenium Webdriver introduces the concept of waits for the AJAX-based application. There are two types of waits:

  1. Implicit Wait
  2. Explicit Wait

Is it helpful? Add Comment View Comments
 

Ques 27. What is the main disadvantage of implicit wait?

The main disadvantage of implicit wait is that it slows down test performance.

Another disadvantage of implicit wait is:

Suppose, you set the waiting limit to be 10 seconds, and the elements appear in the DOM in 11 seconds, your tests will be failed because you told it to wait a maximum of 10 seconds.

Is it helpful? Add Comment View Comments
 

Ques 28. What is Selenium Grid?

Selenium Grid facilitates you to distribute your tests on multiple machines and all of them at the same time. So, you can execute tests on Internet Explorer on Windows and Safari on Mac machine using the same text script. It reduces the time of test execution and provides quick feedback.

Is it helpful? Add Comment View Comments
 

Ques 29. How can we launch different browsers in Selenium WebDriver?

We have to create an instance of a driver of that particular browser.

 

WebDriver driver =newFirefoxDriver();  

Here, "WebDriver" is an interface, and we are creating a reference variable "driver" of type WebDriver, instantiated using "FireFoxDriver" class.

Is it helpful? Add Comment View Comments
 

Ques 30. Write a code snippet to launch Firefox browser in WebDriver.

public class FirefoxBrowserLaunchDemo {  
  
 public static void main(String[] args) {  
  
  //Creating a driver object referencing WebDriver interface  
  WebDriver driver;  
  
  //Setting webdriver.gecko.driver property  
  System.setProperty("webdriver.gecko.driver", pathToGeckoDriver + "\\geckodriver.exe");  
  
  //Instantiating driver object and launching browser  
  driver = newFirefoxDriver();  
  
  //Using get() method to open a webpage  
  driver.get("http://javatpoint.com");  
  
  //Closing the browser  
  driver.quit();  
  
 }  
  
}  

Is it helpful? Add Comment View Comments
 

Most helpful rated by users:

©2024 WithoutBook