HOME
Selenium Quiz 3 – You can test your knowledge with this Selenium Quiz. We have created this Selenium WebDriver Quiz Online Test to help you master Selenium.
Selenium Multiple Choice Questions – MCQ1
Selenium Multiple Choice Questions – MCQ2
1. What is the recommended way to handle dynamic elements?
i. By using relative XPath locators
ii. By using regular expressions
Select the best answer
- i, ii
- i
- ii
- None
Answer
2. In Selenium WebDriver, which of the following is not a valid select statement?
Choose one option
- selectByValues()
- selectByIndex()
- selectByVisibleText()
Answer
3. What is the difference between WebDriver and RemoteWebDriver?
Choose one option
- WebDriver is a class and RemoteWebDriver is an interface
- WebDriver is an interface and RemoteWebDriver is a class
- WebDriver and RemoteWebDriver is a class
- WebDriver and RemoteWebDriver is an interface
Answer
4. Can you upload the file using the Sendkeys method in selenium WebDriver?
Choose one option
- Yes
- No
Answer
5. Which of the following method allows you to change control from one window to other?
Choose one option
- SwapTo ()
- SwitchTo ()
- Swap ()
- Switch ()
Answer
6. In selenium 4, which of the following method allows us to take a screenshot of a specific web element?
- GetScreenshot ()
- getScreenshotAs ()
- ScreenshotAs ()
- None
Answer
7. In selenium 4, is there any method to take a screenshot of the entire page?
- Yes
- No
Answer
8. Which open-source tool allows us to read and write MS Excel files using Java?
Choose one option
- Apache Map-reduce
- Apache POI
- AutoIT
- None of the above
Answer
9. ____ browser is a browser that doesn’t have a GUI?
Choose one option
- Chrome
- Plain
- Headless
- Error-free
Answer
10. Which of the following method is used to work with multiple browser windows?
Choose one option
- getMultipleWindows()
- getWindowHandles()
- getWindowhandle()
- Both 2 & 3
Answer
11. Which one is a class in Selenium ?
Choose one options
- WebDriverWait
- WebElement
- WebDriver
- getPageSource
Answer
12. Complex user actions through mouse like – drag and drop, double-click, context-click, etc. can be performed with the help of:
Choose one option
- Select class
- Actions class
- Command class
- None
Answer
13. Consider the web page is still loading, and the element is not yet on the screen at the time of the find operation. What would be the exception thrown by the WebDriver?
Choose one option
- NoSuchElementException
- StaleElementReferenceException
- ElementNotVisibleException
- None
Answer
14. contextClick() method of the Actions class performs __________ operation?
Choose one option
- Double click
- Right click
- Click and hold
- None
Answer
15. Given the below statement, select the correct method chaining for performing the right-click operation?
Actions a=new Actions(driver);
Choose one option
- a.contextClick().perform();
- a.contextClick().build();
- a.contextClick();
- None
Answer
16. setHeadless(true) will _____
Choose one option
- Executes the test without a graphical user interface
- Executes the test only if GUI is available
- Check if GUI is available or not
- None
Answer
17. driver.getTitle() will _____
Choose one option
- Return the heading of the web article
- Return the title of the webpage displayed on the browser tab
- Return the text specified in the inner HTML
- None
Answer
18. Which exception is thrown when attempting to add a cookie under a different domain than the current URL?
Choose one option
- NoSuchCookieException
- InvalidCookieDomainException
- InvalidElementStateException
- None
Answer
19. Suppose you are attempting to clear an element that isn’t both editable and resettable, then which web driver exception will be thrown?
- InvalidElementStateException
- StaleElementException
- NoSuchElementException
- None
Answer
20. On the occurrence of org.openqa.selenium.SessionNotCreatedException what would be the probable solution
Choose one option
- Update the waiting period of an implicit wait.
- Use Actions class.
- Apply the explicit wait.
- Update the chrome driver.
Answer
21. An invalid locator specified in the FindBy method results in________
Choose one option
- ElementNotVisibleException
- NoSuchElementException
- InvalidCoordinatesException
- None
Answer
22. What is the purpose of the Selenium Grid?
Choose one option
- To distribute test execution on multiple machines
- To manage different browser versions and configurations
- To run tests in parallel
- All of the above
Answer
23. Which method firstly performs a click-and-hold on the source element, moves to the location of the target element and then releases the mouse.
Choose one option
- DragAndDrop
- moveToElement
- doubleClick
- None
Answer
24. Which of the following is used to execute JavaScript commands in Selenium?
Choose one option
- WebDriver
- TestNG
- JavaScriptExecutor
- None of the above
Answer
25. Which of the following is used to switch to a frame in Selenium?
Choose all options
- driver.switchTo().window()
- driver.switchTo().frame()
- driver.switchTo().alert()
- None
Answer
Selenium Multiple Choice Questions – MCQ1
Selenium Multiple Choice Questions – MCQ2
====================================================================
Answers
1) 2) By using relative XPath locators
2) 1) selectByValues()
3) 2) WebDriver is an interface and RemoteWebDriver is a class
4) 1) Yes
5) 2) SwitchTo ()
6) 2) getScreenshotAs ()
7) 1) Yes. getFullPageScreenshotAs()
8) 2) Apache POI
9) 3) Headless
10) 2) getWindowHandles()
11) 2) WebElement
12) 2) Actions class
13) 1) NoSuchElementException
14) 2) Right Click
15) 1) a.contextClick().perform();
16) 1) Executes the test without a graphical user interface
17) 2) Return the title of the webpage displayed on the browser tab
18) 2) InvalidCookieDomainException
19) 1) InvalidElementStateException
20) 4) Update the chrome driver.
21) 2) NoSuchElementException
22) 4) All of the above
23) 1) DragAndDrop
24) 3) JavaScriptExecutor
25) 2) driver.switchTo().frame()