Last Updated On
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
2. In Selenium WebDriver, which of the following is not a valid select statement?
Choose one option
- selectByValues()
- selectByIndex()
- selectByVisibleText()
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
4. Can you upload the file using the Sendkeys method in selenium WebDriver?
Choose one option
- Yes
- No
5. Which of the below method lets you change control from one window to another?
Choose one option
- SwapTo ()
- SwitchTo ()
- Swap ()
- Switch ()
6. In selenium 4, which of the following method allows us to take a screenshot of a specific web element?
- GetScreenshot()
- getScreenshotAs()
- ScreenshotAs()
- None
7. In selenium 4, is there any method to take a screenshot of the entire page?
- Yes
- No
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
9. ____ browser is a browser that doesn’t have a GUI?
Choose one option
- Chrome
- Plain
- Headless
- Error-free
10. Which of the following method is used to work with multiple browser windows?
Choose one option
- getMultipleWindows()
- getWindowHandles()
- getWindowhandle()
- Both 2 & 3
11. Which one is a class in Selenium ?
Choose one options
- WebDriverWait
- WebElement
- WebDriver
- getPageSource
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
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
14. contextClick() method of the Actions class performs __________ operation?
Choose one option
- Double click
- Right click
- Click and hold
- None
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
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
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
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
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
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.
21. An invalid locator specified in the FindBy method results in________
Choose one option
- ElementNotVisibleException
- NoSuchElementException
- InvalidCoordinatesException
- None
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
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
24. Which of the following is used to execute JavaScript commands in Selenium?
Choose one option
- WebDriver
- TestNG
- JavaScriptExecutor
- None of the above
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
==============================================================
Additional MCQ for Selenium
I love this. Very handy. Can you please add some questions related to selenium with ci/cd or selenium with other frameworks …more advance selenium questions
LikeLike
Thank you Neeti. https://qaautomation.expert/2024/12/26/selenium-multiple-choice-questions-mcq4/ contains advance level multiple choice question.
LikeLike