Last Updated On
Selenium Quiz – You can test your knowledge with this Selenium Quiz. We have created this Selenium WebDriver Quiz Online Test to help you master Selenium.
1. What is selenium, select the best answer.
Select the best answer
- Selenium is the open-source test automated tool to test web-based UI which only supports JavaScript’s
- Selenium is the open-source test automated tool to test web-based UI which supports many different languages like Java, Python, Perl, PHP, Ruby, and C#.
- Selenium is a behavioral testing tool that supports many different languages like Java, Python, Perl, PHP, Ruby, and C#.
2. Which one of the following is correct for WebDriver?
Choose one option
- Interface
- Abstract Class
- None
3. Which of the following is NOT a component of selenium?
Choose one option
- Grid
- RC
- IDE
- WebDriver
- WebElement
4. Which of the following languages is not supported by Selenium
Choose one option
- Java
- ASP
- Python
- PHP
- C#
5. What would be the outcome if you try to run the below code?
WebDriver driver=new WebDriver();
Choose one option
- WebDriver gets instantiated successfully
- Compilation error-Cannot instantiate the type WebDriver
- Run time error will occur
- None
6. How do you run the Selenium web script driver on the Chrome browser?
- Chromescript
- Chromescriptdriver
- Chromedriver
- Chrometestdriver
7. Select the Operating system which is supported by Selenium WebDriver
i. Windows
ii. macOS
iii. Linux
Options
- i, ii
- ii, iii
- i, iii
- i, ii, iii
8. Which of the following is NOT a type of wait mechanism available in Selenium?
Choose one option
- thread.sleep();
- implicitwait();
- explicitwait();
- fluentwait();
9. Is Implicit wait time applied to all elements in your code?
Choose one option
- Yes
- No
10. Select the correct statement for a fluent wait:
Choose one option
- It looks for a web element repeatedly at regular intervals until timeout happens or until the object is found.
- Polling period can be set and The user can configure the wait to ignore any exceptions during the polling period
- Both a and b
- None
11. Select the correct statements about driver.close() and driver.quit()
Choose several options
- Both are the same and can be used interchangeably
- driver.close() closes the current window
- driver.quit() is used to quit the driver whereas driver.close() is used to close the window
- driver.quit() closes every associated window with this driver and quits the driver
12. The format to write a custom xpath
Choose one option
- tag-name[@attribute=’attribute value’]
- //tag-name[@attribute=’attribute value’]
- tag-name(@attribute=’attribute value’)
- None
13. Which of the below methods verify the presence of a WebElement on the screen?
Choose one option
- isDisplayed()
- isPresent()
- isEnabled()
- None
14. Which of the below method can ensure that the WebElement is enabled or not?
Choose one option
- isActive()
- isEnabled()
- isPresent()
- None
15. What would be the exception thrown by the WebDriver if the web page is refreshed after the element is located?
Choose one option
- NoSuchElementException
- StaleElementReferenceException
- ElementNotVisibleException
- None
16. Which of the following expression is used for “anything”?
Choose one option
- **
- .*
- *.
- *+
17. Select the correct option on how to select an element that contains “QAAutomation”
Choose one option
- WebElement element = driver.findElement(By.xpath(“//[contains(text(), ‘ QAAutomation’)]”));
- WebElement element = driver.findElement(By.xpath(“//[(text(), ‘ QAAutomation’)]”));
- WebElement element = driver.findElement(By.xpath(“\*[contains(text(), ‘ QAAutomation’)]”));
- None
18. Which command you use to navigate to https://qaautomation.expert
Choose one option
- driver.navigate(“https://www.qaautomation.expert”);
- driver.navigate.to(“https://www.qaautomation.expert”);
- driver.navigate.url(“https://www.qaautomation.expert”);
- None
19. In Selenium WebDriver, which methods you use to navigate to https://www.qaautomation.expert
i. navigate().to(“url”)
ii. open(“url”)
iii. goTo(“url”
iv. get(“url”)
Options
- i & ii
- ii & iii
- i & iv
- ii & iv
20. Selenium command for entering text into text boxes?
Choose one option
- sendKeys()
- sendsKeys()
- SendsKeys()
- None
21. findElements(“Locator”) method returns
Choose one option
- String representation of XPath
- By class object
- List of WebElements
- None
22. Select the correct statement to maximize the browser window
Choose one option
- driver.maximize();
- driver.manage().maximize();
- driver.manage().window().maximize();
- None
23. What is the best call for finding multiple elements using XPath?
Choose one option
- findElement(By.Xpath)
- findElements(By.XPath)
- findElement(By.CssSelector)
- Both B & C
24. Which of the following methods is used to clear the text in a text field using Selenium?
Choose one option
- element.clear()
- element.delete()
- element.clean()
- None
25. Which of the following classes provides helper methods to select and deselect options on a Select tag?
Choose one option
- Actions
- Select
- Choose
- None
====================================================================
Selenium Multiple Choice Questions – MCQ2
Selenium Multiple Choice Questions – MCQ3
Answers
1) b) Selenium is the open-source test automated tool to test web-based UI which supports many different languages like Java, Python, Perl, PHP, Ruby, and C#.
2) a) Interface
3) e) WebElement
4) b) ASP
5) b) Compilation error- Cannot instantiate the type WebDriver
6) c) Chromedriver
7) d) i, ii, iii
8) a) thread.sleep();
9) a) Yes
10) c) Both a and b
11) b) driver.close() closes the current window and d) driver.quit() closes every associated window with this driver and quits the driver
12) b) //tag-name[@attribute=’attribute value’]
13) a) isDisplayed()
14) b) isEnabled()
15) b) StaleElementReferenceException
16) b) .*
17) a) WebElement element = driver.findElement(By.xpath(“//*[contains(text(), ‘ QAAutomation’)]”));
18) b) driver.navigate.to(“https://www.qaautomation.expert”);
19) d) ii & iv
20) a) sendKeys()
21) c) List of WebElements
22) c) driver.manage().window().maximize();
23) b) findElements(By.XPath)
24) a) element.clear()
25) a) Select