Selenium Java Cheat sheet MCQs


Selenium Java cheat sheet in the form of multiple-choice questions that helps you to recap and revise the frequently used Selenium commands, syntaxes, and snippets.




Instructions

Topic- Selenium Java Cheat sheet

The test consists of 20 questions.

No negative marking for this test.

No Time limit

The pass percentage is 70%

The correct answer with a description will be displayed after the answer has been marked.

Submit the test to calculate your score once you are done with all the questions.

Complexity Level- Moderate








Q1: Select the correct Selenium Java code snippet to initialise the browser instance and launch the browser:



















Q2: Select the correct Selenium Java code snippets for setting the headless browser mode:




















Q3: Selenium java code for maximizing the screen size _______















Q4: Selenium java code to refresh the page _____:















Q5: WebDriver method to store the entire page source as a String _____

















Q6: WebDriver method that retrieves and stores the list of WebElements:

















Q7: Selenium code snippet to close the current open window:

















Q8: Selenium code snippet to close all the associated windows:















Q9: Select the correct library that automatically downloads and sets up the correct ChromeDriver executable for your system:

















Q10: Select the correct Selenium Java code that switch the webdriver focus to a particular frame ____

















Q11: WebDriver method that returns the URL of the current page:

















Q12: WebDriver method that returns the title of the page:

















Q13: Select the correct Selenium Java code that switch the webdriver focus back to the main page or main content of the web page ____

















Q14: Select the correct basic XPath syntax in Selenium:

















Q15: Suppose there is a text input field filled with a value - 'Robert'



Select the correct Selenium Java code snippet that extracts the value inside an input field:


















Q16: Select the correct Selenium Java code to accept an alert popup:

















Q17: Select the correct Selenium Java code snippet to disable a field:

(using DOM manipulation)


















Q18: Select the correct syntax for initialising the Fluent wait:




















Q19: Select the correct Selenium Java code snippet to find the colour of the web element:




















Q20: Select the correct Selenium Java code snippet to find the font size of the web element: