Python Automation Proficiency Quiz Quiz

  1. Python Syntax Basics

    How does Python define the start and end of code blocks such as functions or loops?

    1. Using indentation (whitespace)
    2. Using curly braces {}
    3. Using parentheses ()
    4. Using square brackets []
    5. Using semicolons ;
  2. Installing Selenium

    Which command is used to install the Selenium package for Python using pip?

    1. pip install selenium
    2. python install selenium
    3. pip selenium install
    4. install selenium --pip
    5. selenium.pip install
  3. Selenium Locators

    What does the find_elements() method return when used in Selenium with Python?

    1. A list of all matching elements
    2. The first matching element
    3. A single string with element names
    4. The total number of elements
    5. A Boolean indicating presence
  4. Waiting for Elements

    What is an explicit wait in the context of Selenium WebDriver with Python?

    1. A wait that pauses until a specific condition is met for an element
    2. A fixed wait for a predetermined amount of time for all elements
    3. Waiting until all images are loaded on the page
    4. Waits that are set in the system configuration
    5. Waiting only for script execution to finish
  5. Handling Browser Windows

    Which method will close all browser windows and end the WebDriver session in Python Selenium?

    1. quit()
    2. close()
    3. stop()
    4. end()
    5. shutdown()
  6. Dropdown Handling

    Which class is primarily used to interact with dropdown lists in Selenium using Python?

    1. Select
    2. DropdownHandler
    3. OptionList
    4. ListBox
    5. DropdownSelect
  7. Alerts

    How do you accept a JavaScript alert in Selenium with Python?

    1. alert.accept()
    2. alert.confirm()
    3. driver.click_alert()
    4. alert.press_ok()
    5. alert.submit()
  8. Navigation

    Which method in Python Selenium WebDriver sends the browser to a specified URL?

    1. get()
    2. navigate()
    3. open()
    4. url()
    5. launch()
  9. Attributes and Text

    If element is a found WebElement, how do you retrieve the current value of its 'id' attribute in Python?

    1. element.get_attribute('id')
    2. element.attribute('id')
    3. element.get('id')
    4. element.id()
    5. element.attr('id')
  10. Unittest Setup

    In Python's unittest framework, which method runs once before any tests in a class?

    1. @classmethodndef setUpClass(cls):
    2. def setUp(self):
    3. @classmethodndef tearDownClass(cls):
    4. def preTest(self):
    5. def setUpAll():