July 2, 2020

Selenium Interview Questions Set 1

By Atul Kumar Mishra
  • What is the difference between the close() and quit() method?

  • What is the difference between the get() and navigate() method?

  • What is the difference between the parentFrame() and defaultContent() method?

  • What is the difference between the getWindowHandle() and getWindowHandles()? What are the return types of these?

  • What is the difference between the W3C Protocol and JSON Wire Protocol?-Chandan

  • Explain Selenium HTTP API calls? How would you test selenium API using postman?-Chandan

  • Explain this line-
    webdriver driver = new chromedriver()
    -Chandan

  • What is the super interface of webdriver in Selenium Webdriver? Explain it in detail-Chandan

  • What is RemoteWebDriver? What is the purpose of using it over normal Webdriver?

  • What is the difference between WebDriver findElement and WebElement findElements? Can we use findelements to interact with single elements too? If no then Why not?

  • What is the difference between Selenium webDriver click() and Javascript click()? ‌ ‌Which one is better in terms of performance?

  • How to handle tabs, frames, and windows in Selenium?, How would you switch between tabs and windows efficiently?

  • How to handle alerts, modal and window pops in Selenium?

  • How to perform mouse hover and content drag and drop in Selenium?

  • How to drag and drop content from one frame to another where frames have no relation between each other ‌(By Chandan)

  • How to select/deselect checkboxes and radio buttons in Selenium?

  • What are the different waits provided by Selenium WebDriver?Tell us the use cases of each wait type a situation where each waittype would be more useful compared to other‌ ‌(By Chandan)

  • List different Exceptions you faced in Selenium WebDriver?‌ ‌Give an example of each?

  • What is StaleElementException? How will you fix this exception in your script?

  • In which condition sendKeys() can be used to upload files? If sendKeys() does not work then what are other alternatives?

  • How to select a date from the calendar using Selenium? Write a sample code for this.

  • How will you handle dynamic WebTable? Write a sample code for this.

    ‌ ‌
  • How will you scroll left, right, top, and down using Selenium? Write a sample code.

  • What is the difference between findElement() and @FindBy?

  • What is initElements Method? Why are we using this? What happens if we don’t use this?

  • How to get a typed text from a textbox?

  • How to fetch CSS properties such as font color, font size and background color using Selenium?-Chandan

  • How to fetch coordinates of element in Selenium? -Chandan

  • How to take screenshot of particular element in Selenium.-Chandan

  • How to resize browser window based on custom size provided by the user during runtime-Chandan


    Note: We have not provided answers as we believe you will learn more and remember more when you look for answers yourself and you will also improve your Research and Development Skills while doing that.