Selenium Webdriver Test: Quiz!

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Abdul
A
Abdul
Community Contributor
Quizzes Created: 8 | Total Attempts: 22,361
Questions: 30 | Attempts: 516

SettingsSettingsSettings
Selenium Webdriver Test: Quiz! - Quiz


Questions and Answers
  • 1. 

    Select the operating system which is NOT supported by Selenium IDE.

    • A.

      Unix

    • B.

      Linux

    • C.

      Solaris

    • D.

      Window

    Correct Answer
    A. Unix
    Explanation
    Selenium IDE supports Linux, Solaris, and Windows operating systems, but it does not support Unix.

    Rate this question:

  • 2. 

    The Selenium RC is used:

    • A.

      To run your test against different browsers (except HtmlUnit) on different operating systems.

    • B.

      To create tests with little or no prior knowledge in programming

    • C.

      To test a web application against Firefox only

    • D.

      To run a huge test suite, that can be executed on multiple machines

    Correct Answer
    A. To run your test against different browsers (except HtmlUnit) on different operating systems.
    Explanation
    Selenium RC (Remote Control) is a tool that allows running tests on different browsers and operating systems. It enables testers to execute tests on various browsers, excluding HtmlUnit, and different operating systems. This flexibility is beneficial as it ensures that the web application being tested is compatible and functions correctly across multiple platforms. Selenium RC is not specifically designed for creating tests with little or no programming knowledge, testing only against Firefox, or running a large test suite on multiple machines.

    Rate this question:

  • 3. 

    Select the language which is NOT supported by the Selenium RC.

    • A.

      ASP

    • B.

      Java

    • C.

      C#

    • D.

      PHP

    Correct Answer
    A. ASP
    Explanation
    Selenium RC supports multiple programming languages for writing test scripts, including Java, C#, and PHP. However, ASP (Active Server Pages) is not supported by Selenium RC. ASP is a server-side scripting language primarily used for creating dynamic web pages and applications on Microsoft servers. Therefore, the correct answer is ASP.

    Rate this question:

  • 4. 

    The Web driver is used:

    • A.

      To execute tests on the HtmlUnit browser.

    • B.

      To design a test using Selenese

    • C.

      To quickly create tests

    • D.

      To test a web application against Firefox only.

    Correct Answer
    A. To execute tests on the HtmlUnit browser.
    Explanation
    The correct answer is to execute tests on the HtmlUnit browser. The HtmlUnit browser is a headless browser that allows for automated testing of web applications. It does not require a graphical user interface, making it faster and more efficient for running tests. Using the Web driver, tests can be written and executed on the HtmlUnit browser, providing a reliable and efficient way to test web applications.

    Rate this question:

  • 5. 

    Select the method which selects the option at the given index.

    • A.

      SelectByIndex()

    • B.

      SelectIndex()

    • C.

      SelectedByIndex()

    • D.

      SelectByIndexes()

    Correct Answer
    A. SelectByIndex()
    Explanation
    The correct method to select an option at a given index is "selectByIndex()". This method allows the user to select an option from a dropdown menu by specifying the index number of the option.

    Rate this question:

  • 6. 

    The Selenium can:

    • A.

      Access controls within the desktop

    • B.

      Both web and desktop applications

    • C.

      Only test web applications

    • D.

      None of the above

    Correct Answer
    C. Only test web applications
    Explanation
    Selenium is a widely used open-source framework for automating web browsers. It provides a set of tools and libraries for interacting with web elements, performing actions, and verifying the behavior of web applications. However, Selenium is specifically designed for testing web applications and does not have built-in capabilities to access controls within the desktop or test desktop applications. Therefore, the correct answer is that Selenium can only test web applications.

    Rate this question:

  • 7. 

    The Selenium Bottom of Form

    • A.

      Provides professional customer support

    • B.

      Test Reports are generated automatically

    • C.

      Comes with a built-in object repository

    • D.

      Cannot access elements outside of the web application under test

    Correct Answer
    D. Cannot access elements outside of the web application under test
    Explanation
    Selenium is a popular automation testing tool that is used for web application testing. It provides professional customer support, generates test reports automatically, and comes with a built-in object repository. However, one limitation of Selenium is that it cannot access elements outside of the web application under test. This means that it cannot interact with elements on other applications or systems outside of the web application being tested.

    Rate this question:

  • 8. 

    Consider the following code snippet WebDriverWait wait = new WebDriverWait(driver, 30); wait.until(ExpectedConditions.presenceOfElementLocated(by)); This is an example of an implicit wait.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The given code snippet is an example of an explicit wait, not an implicit wait. In an implicit wait, the WebDriver waits for a certain amount of time for elements to appear on the page before throwing an exception. However, in the given code, the WebDriverWait class is being used to explicitly wait for the presence of an element located by the specified By object. Therefore, the correct answer is False.

    Rate this question:

  • 9. 

    Which command can be used to enter values onto text boxes?

    • A.

      SendsKeys()

    • B.

      SendKey()

    • C.

      SendKeys

    • D.

      SendKeys()

    Correct Answer
    D. SendKeys()
    Explanation
    The correct answer is sendKeys(). This command is used to enter values onto text boxes. It is a method that is commonly used in automation testing to simulate keyboard input. By using sendKeys(), the test script can interact with text boxes by sending the desired input to them.

    Rate this question:

  • 10. 

    Select the language which is supported by The Selenium Web Driver.

    • A.

      Perl

    • B.

      Sql

    • C.

      Cobol

    • D.

      ASP

    Correct Answer
    A. Perl
    Explanation
    The correct answer is Perl because Selenium Web Driver supports multiple programming languages, including Perl, for writing test scripts and automating web applications. Perl is a widely used scripting language known for its flexibility and powerful text processing capabilities, making it a suitable choice for web automation tasks.

    Rate this question:

  • 11. 

    Which Selenium component supports All Operating System?

    • A.

      Selenium Generator

    • B.

      Selenium WebDriver

    • C.

      Selenium IDE

    • D.

      None of the above

    Correct Answer
    B. Selenium WebDriver
    Explanation
    Selenium WebDriver supports all operating systems. It is a powerful tool that allows users to automate browser interactions and perform tests on various web applications across different operating systems. It provides a programming interface for creating and executing test cases, making it compatible with Windows, Mac, Linux, and other operating systems.

    Rate this question:

  • 12. 

    Select the command in Selenium IDE used to open a page using the URL.

    • A.

      OpenRecord

    • B.

      Open

    • C.

      OpenText

    • D.

      OpenTable

    Correct Answer
    B. Open
    Explanation
    The correct command in Selenium IDE used to open a page using the URL is "Open". This command instructs Selenium to navigate to the specified URL and open the corresponding webpage.

    Rate this question:

  • 13. 

     In the case of Selenium IDE, the Source view shows your script in:

    • A.

      DHTML format

    • B.

      J2EE format

    • C.

      XML format

    • D.

      HTML format

    Correct Answer
    D. HTML format
    Explanation
    The Source view in Selenium IDE shows the script in HTML format. This means that the script is displayed as HTML code, which is the standard markup language used for creating web pages. This format allows users to view and edit the script using HTML syntax, making it easier to understand and modify the script as needed.

    Rate this question:

  • 14. 

    Select the command which is used to pause execution until the page is loaded completely.

    • A.

      WaitForPageToLoad

    • B.

      WaitForElementPresent

    • C.

      WaitForPage

    • D.

      WaitForLoad

    Correct Answer
    A. WaitForPageToLoad
    Explanation
    The command "waitForPageToLoad" is used to pause the execution of a script until the page is fully loaded. This command ensures that the script does not proceed with further actions until all the elements on the page have finished loading.

    Rate this question:

  • 15. 

     Select the variation which locates elements by the value of the "name" attribute in Web driver Selenium.

    • A.

      By.name

    • B.

      By.nametag

    • C.

      By.tagname

    • D.

      By.nametags

    Correct Answer
    A. By.name
    Explanation
    The correct answer is By.name because the By.name method in Selenium WebDriver is used to locate elements by their "name" attribute. This method allows you to find elements by the value specified in the "name" attribute of the HTML tag.

    Rate this question:

  • 16. 

    Select the variation which finds elements based on the driver's underlying CSS selector engine in Web driver Selenium.

    • A.

      By.cssSelected

    • B.

      By.cssSelection

    • C.

      By.cssSelector

    • D.

      By.Selectcs

    Correct Answer
    C. By.cssSelector
    Explanation
    The correct answer is "By.cssSelector". This variation is used to find elements based on the driver's underlying CSS selector engine in Web driver Selenium. It allows the user to locate elements using CSS selectors, which are powerful and flexible for targeting specific elements on a webpage.

    Rate this question:

  • 17. 

    Which method is used when you want to verify whether a certain check box, radio button or option in a drop-down box is selected in Web driver Selenium?

    • A.

      Is_Selected()

    • B.

      IsSelect()

    • C.

      IsSelected()

    • D.

      Is_Select()

    Correct Answer
    C. IsSelected()
    Explanation
    The isSelected() method is used to verify whether a certain checkbox, radio button, or option in a dropdown box is selected in Selenium WebDriver. This method returns a boolean value, true if the element is selected and false if it is not.

    Rate this question:

  • 18. 

    Which Component is used to run multiple tests simultaneously in different browsers and platforms?

    • A.

      Selenium Grid

    • B.

      Selenium IDE

    • C.

      Selenium RC

    • D.

      Selenium Webdriver

    Correct Answer
    A. Selenium Grid
    Explanation
    Selenium Grid is the correct answer because it is specifically designed to run multiple tests simultaneously in different browsers and platforms. It allows users to distribute test cases across multiple machines and execute them in parallel, thereby saving time and increasing efficiency. Selenium IDE, Selenium RC, and Selenium Webdriver are other components of Selenium but they do not have the capability to run tests simultaneously in different browsers and platforms like Selenium Grid does.

    Rate this question:

  • 19. 

    Select the method which clears all selected entries in Web driver Selenium

    • A.

      DselectAll()

    • B.

      Deselect_All()

    • C.

      Dselect_All()

    • D.

      DeselectAll()

    Correct Answer
    D. DeselectAll()
    Explanation
    The correct method to clear all selected entries in Web driver Selenium is "deselectAll()". This method is used to deselect all options that have been previously selected in a multi-select dropdown or list box. By calling this method, all selected entries will be cleared and no options will remain selected.

    Rate this question:

  • 20. 

    Select the method which performs a context-click at the current mouse location.

    • A.

      Click_Context()

    • B.

      Context.Click()

    • C.

      ContextClick()

    • D.

      Context_Click()

    Correct Answer
    C. ContextClick()
    Explanation
    The correct answer is "contextClick()". This method is the appropriate choice as it clearly indicates that it performs a context-click at the current mouse location. The other options do not follow the naming convention or do not accurately describe the action being performed.

    Rate this question:

  • 21. 

    Select the Get command which fetches the inner text of the element that you specify in Web driver Selenium.

    • A.

      GetinnerText()

    • B.

      Get_in_Text()

    • C.

      Get_inner_Text()

    • D.

      GetText()

    Correct Answer
    D. GetText()
    Explanation
    The correct answer is getText(). This method is used in Selenium WebDriver to fetch the inner text of an element on a webpage. It retrieves the visible text contained within the specified element, excluding any HTML tags or attributes. Therefore, getText() is the appropriate command to use in order to obtain the inner text of an element in Selenium WebDriver.

    Rate this question:

  • 22. 

    In Webdriver, which of the following commands retrieves the text of an html element?

    • A.

      SelectText()

    • B.

      GetText()

    • C.

      GetElementText()

    • D.

      GetText(WebElement)

    Correct Answer
    B. GetText()
    Explanation
    The correct answer is getText(). This command is used in Webdriver to retrieve the text of an HTML element. It allows the user to extract the visible text present within the element, such as the text displayed on a webpage or within a specific element. This command is commonly used in test automation to verify the expected text content of an element on a webpage.

    Rate this question:

  • 23. 

    In WebDriver, which command can be used to enter values onto text boxes?

    • A.

      SendKeys("text")

    • B.

      Elenium.type()

    • C.

      Driver.type("text")

    • D.

      SendKeys()

    Correct Answer
    A. SendKeys("text")
    Explanation
    The correct answer is sendKeys("text"). This command is used in WebDriver to enter values onto text boxes. It allows the user to input text by sending a series of keyboard keys to the element. The "text" parameter represents the value that will be entered into the text box.

    Rate this question:

  • 24. 

    In web driver, which of the following is a valid select statement that selects a value from a drop-down element?

    • A.

      SelectByIndex()

    • B.

      SelectByVisibleText()

    • C.

      SelectByValue()

    • D.

      All above

    Correct Answer
    D. All above
    Explanation
    The correct answer is "all above" because all three select statements mentioned (selectByIndex(), selectByVisibleText(), selectByValue()) are valid ways to select a value from a drop-down element in WebDriver. selectByIndex() selects an option by its index, selectByVisibleText() selects an option by its visible text, and selectByValue() selects an option by its value attribute.

    Rate this question:

  • 25. 

    In web driver, what is the method that counts the number of elements?

    • A.

      driver.getCountOfElements()

    • B.

      Driver.findElement(By.id("search")).getCount()

    • C.

      Driver.findElements(By.id("search")).size()

    • D.

      Driver.findElements(By.id("search")).length()

    Correct Answer
    C. Driver.findElements(By.id("search")).size()
    Explanation
    The correct answer is "driver.findElements(By.id("search")).size()". This is because the method "findElements" is used to locate all elements that match the given locator strategy, in this case, By.id("search"). The method returns a list of elements, and the "size()" method is then used to count the number of elements in that list.

    Rate this question:

  • 26. 

    Consider the following HTML snippet.
    • Firefox
    • Google Chrome
    • Internet Explorer
    • Opera
    • Safari
    Which CSS selector is a valid statement to select Opera?

    • A.

      Css = li.contains("Opera")

    • B.

      Css = ul.li(4)

    • C.

      Css = ul > li:nth-of-type(4)

    • D.

      Css = ul > li:nth-of-type(3)

    • E.

      Css = ul.li:nth-child(4)

    Correct Answer
    C. Css = ul > li:nth-of-type(4)
    Explanation
    The correct answer is "css = ul > li:nth-of-type(4)". This CSS selector is using the ">" combinator to select the direct child "li" elements of the "ul" element, and then the ":nth-of-type(4)" pseudo-class to select the fourth "li" element. This will select the "li" element that contains the text "Opera".

    Rate this question:

  • 27. 

    In web driver, which command takes you forward by one page on the browser’s history?

    • A.

      Navigate.forward()

    • B.

      Navigate.forward()

    • C.

      Navigate().forward()

    • D.

      Navigate_forward()

    Correct Answer
    C. Navigate().forward()
    Explanation
    The correct answer is navigate().forward(). This command is used in WebDriver to navigate forward by one page on the browser's history. It is a method that is called on the navigate object, which represents the browser's navigation interface. By using this command, you can simulate the action of clicking the forward button on the browser, moving to the next page in the history.

    Rate this question:

  • 28. 

     In web driver, which methods navigate to a URL?

    • A.

      GoToUrl("url")

    • B.

      Navigate.to("url")

    • C.

      GetUrl("url")

    • D.

      Get("url")

    Correct Answer
    D. Get("url")
    Explanation
    The correct answer is "get("url")". This method is used in web driver to navigate to a URL. The other options mentioned, such as "goToUrl", "navigate.to", and "getUrl" are not valid methods in web driver for navigating to a URL.

    Rate this question:

  • 29. 

    Consider the following code snippet WebDriverWait wait = new WebDriverWait(driver, 30); wait.until(ExpectedConditions.presenceOfElementLocated(by)); This is an example of an implicit wait.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The given code snippet is an example of an explicit wait, not an implicit wait. An implicit wait is a setting that is applied globally and is used to wait for a certain amount of time for elements to be found before throwing an exception. In the given code, a WebDriverWait object is created with a specific timeout value of 30 seconds, and it is used to wait for the presence of an element located by the specified By object. This is an example of explicit wait, where the wait condition is explicitly defined and applied to a specific element.

    Rate this question:

  • 30. 

    The following codes both print: Welcome to HotelApplication.com System.out.println(driver.getTitle()); System.out.println(driver.findElement(By.tagName(“title”)).getText())

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The given answer is true because both lines of code will print the same output, which is "Welcome to HotelApplication.com". The first line of code uses the `getTitle()` method to retrieve the title of the webpage, while the second line of code uses the `findElement()` method with the `By.tagName()` locator to find the title element and then retrieves its text. Since both methods are used to retrieve the same information, they will produce the same output.

    Rate this question:

Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.