[CSAT PY] Certified Selenium Automation Tester using Python Certification Exam Guide, Exams of Technology

This exam guide delivers comprehensive preparation in Selenium automation using Python, covering framework setup, scripting, test execution, debugging, and CI/CD workflows. The guide emphasizes hands-on testing competence and exam-aligned scenarios.

Typology: Exams

2025/2026

Available from 02/11/2026

shilpi-jain-3
shilpi-jain-3 🇮🇳

2.5

(11)

80K documents

1 / 105

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
[CSAT PY] Certified Selenium Automation
Tester using Python Certification Exam Guide
**Question 1.** Which of the following best defines test automation?
A) Executing test cases manually without tools
B) Using scripts or tools to run tests automatically
C) Designing test cases only for functional testing
D) Performing exploratory testing without documentation
Answer: B
Explanation: Test automation involves using software tools or scripts to execute test
cases automatically, reducing manual effort and increasing repeatability.
**Question 2.** In the ROI analysis for automation, which factor most directly
impacts the decision to automate a test case?
A) The skill level of the tester
B) The frequency of test execution
C) The color scheme of the application UI
D) The programming language used for development
Answer: B
Explanation: High-frequency test cases yield greater ROI when automated because
the time saved per execution accumulates quickly.
**Question 3.** Which phase of the Test Automation Life Cycle (TALC) involves
selecting the appropriate automation tool?
A) Requirement analysis
B) Tool selection criteria
C) Execution and maintenance
D) Test plan development
Answer: B
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download [CSAT PY] Certified Selenium Automation Tester using Python Certification Exam Guide and more Exams Technology in PDF only on Docsity!

Tester using Python Certification Exam Guide

Question 1. Which of the following best defines test automation? A) Executing test cases manually without tools B) Using scripts or tools to run tests automatically C) Designing test cases only for functional testing D) Performing exploratory testing without documentation Answer: B Explanation: Test automation involves using software tools or scripts to execute test cases automatically, reducing manual effort and increasing repeatability. Question 2. In the ROI analysis for automation, which factor most directly impacts the decision to automate a test case? A) The skill level of the tester B) The frequency of test execution C) The color scheme of the application UI D) The programming language used for development Answer: B Explanation: High-frequency test cases yield greater ROI when automated because the time saved per execution accumulates quickly. Question 3. Which phase of the Test Automation Life Cycle (TALC) involves selecting the appropriate automation tool? A) Requirement analysis B) Tool selection criteria C) Execution and maintenance D) Test plan development Answer: B

Tester using Python Certification Exam Guide

Explanation: Tool selection criteria is a dedicated phase where factors such as technology support, licensing, and integration are evaluated. Question 4. Which automation framework type emphasizes reusability by separating test data from test scripts? A) Linear framework B) Modular framework C) Data-Driven framework D) Keyword-Driven framework Answer: C Explanation: Data-Driven frameworks store inputs in external files (e.g., CSV, Excel) and drive the same script with multiple data sets. Question 5. In Python, which statement correctly creates a dictionary? A) my_dict = { "name": "Alice", "age": 30 } B) my_dict = [ "name": "Alice", "age": 30 ] C) my_dict = ( "name": "Alice", "age": 30 ) D) my_dict = "name":"Alice", "age":30 Answer: A Explanation: Curly braces {} with key-value pairs create a dictionary in Python. Question 6. What is the output of the following Python code?

x = [1, 2, 3] y = x y.append(4) ## Tester using Python Certification Exam Guide Explanation: Inheritance enables a child class to inherit attributes and methods from its parent. **Question 9.** Which block of code correctly handles a possible `ZeroDivisionError` exception? A) ```python try: result = a / b except ZeroDivisionError: print("Cannot divide by zero")

B)

if b == 0: raise ZeroDivisionError

C)

try: result = a / b finally: print("Done")

D)

## Tester using Python Certification Exam Guide except ZeroDivisionError: result = 0

Answer: A Explanation: The try/except construct catches the specific ZeroDivisionError and handles it gracefully. Question 10. Which library would you import to work with Excel files in Python for data-driven testing? A) csv B) json C) openpyxl D) xml.etree Answer: C Explanation: openpyxl provides read/write capabilities for .xlsx Excel workbooks. Question 11. Which command installs the Selenium library using pip? A) pip install selenium B) pip selenium install C) python -m selenium install D) pip get selenium Answer: A Explanation: pip install selenium downloads and installs the Selenium package from PyPI. Question 12. After installing ChromeDriver, which line correctly initiates a Chrome browser session in Python?

Tester using Python Certification Exam Guide

Question 15. Which command will close only the current browser window while keeping the WebDriver session alive? A) driver.quit() B) driver.close() C) driver.end() D) driver.exit() Answer: B Explanation: driver.close() closes the active window; driver.quit() ends the entire session. Question 16. Which locator strategy is generally the fastest and most reliable? A) XPath B) CSS Selector C) ID D) Link Text Answer: C Explanation: Locating by id leverages the DOM’s native indexing, making it the quickest and most stable. Question 17. Which XPath expression selects an element with the exact text “Login”? A) //button[text()='Login'] B) //button[contains(text(),'Login')] C) //button[@value='Login'] D) //button[@id='Login'] Answer: A Explanation: text()='Login' matches the node’s exact text content.

Tester using Python Certification Exam Guide

Question 18. How would you locate a button element using a CSS selector that has both classes btn and primary? A) button.btn.primary B) button#btn.primary C) .btn#primary D) #btn .primary Answer: A Explanation: In CSS, chaining class names without spaces selects an element that possesses both classes. Question 19. Which Selenium method clears the existing text from an input field? A) element.erase() B) element.clear() C) element.delete() D) element.remove() Answer: B Explanation: clear() removes any pre-filled value from a text box. Question 20. To select an option with visible text “Canada” from a `` element, which code is correct? A)

Select(element).choose_by_visible_text("Canada")

B)

Tester using Python Certification Exam Guide

A) driver.switch_to.frame("frame1") B) driver.switch_to.window("frame1") C) driver.switch_to.alert("frame1") D) driver.switch_to.parent_frame("frame1") Answer: A Explanation: switch_to.frame() accepts name, id, index, or WebElement to focus on a specific iframe. Question 23. Which ActionChains method performs a mouse hover over an element? A) move_to_element() B) hover() C) click_and_hold() D) drag_and_drop() Answer: A Explanation: move_to_element(element).perform() moves the mouse cursor over the target element, simulating a hover. Question 24. What is the default polling interval for Selenium’s WebDriverWait? A) 0.1 seconds B) 0.5 seconds C) 1 second D) 2 seconds Answer: C Explanation: WebDriverWait polls the DOM every 500 milliseconds by default, but the effective interval is 0.5 s; however, the timeout parameter is expressed in seconds, and the internal default poll is 0.5 s. Since the question asks for the

Tester using Python Certification Exam Guide

“default polling interval,” the correct answer is 0.5 seconds, which corresponds to option B. Corrected Answer: B Explanation: Selenium’s WebDriverWait checks the condition every 500 ms (0.5 seconds) unless a custom poll frequency is set. Question 25. Which of the following is an example of a Fluent Wait? A) driver.implicitly_wait(10) B) WebDriverWait(driver, 15).until(EC.title_contains("Home")) C) wait = FluentWait(driver).with_timeout(20).polling_every(2).ignore_all([NoSuchElementExc eption]) D) time.sleep(5) Answer: C Explanation: Fluent Wait allows specifying timeout, polling frequency, and ignored exceptions, providing fine-grained control. Question 26. In PyTest, which decorator is used to declare a fixture that runs before each test function? A) @pytest.fixture(scope="module") B) @pytest.fixture(scope="function") C) @pytest.setup D) @pytest.before Answer: B Explanation: The default scope is “function,” but explicitly setting scope="function" indicates the fixture runs for each test.

Tester using Python Certification Exam Guide

def user(request): return request.param

D) Both A and C Answer: D Explanation: Both `@pytest.mark.parametrize` and a fixture with `params` achieve data-driven execution. **Question 29.** Which command generates an HTML report using pytest-html? A) `pytest --html=report.html` B) `pytest -report html` C) `pytest --generate-html` D) `pytest -html report.html` Answer: A Explanation: The `--html` option from the `pytest-html` plugin creates the specified HTML file. **Question 30.** In the unittest (PyUnit) framework, which method is automatically called before each test method? A) `setUpClass()` B) `tearDownClass()` C) `setUp()` D) `tearDown()` Answer: C Explanation: `setUp()` runs before every test method, providing test-specific initialization. ## Tester using Python Certification Exam Guide **Question 31.** Which Python module provides a flexible logging system for automation scripts? A) `log` B) `logging` C) `trace` D) `debugger` Answer: B Explanation: The built-in `logging` module supports different log levels, handlers, and formatting. **Question 32.** In Git, what command creates a new branch named `feature/login` and switches to it? A) `git branch feature/login` B) `git checkout -b feature/login` C) `git switch feature/login` D) `git merge feature/login` Answer: B Explanation: `git checkout -b ` creates and checks out the new branch in one step. **Question 33.** Which Jenkins feature allows you to trigger Selenium tests automatically after each code commit? A) Post-build actions B) Build Triggers → Poll SCM C) Build Triggers → GitHub hook trigger for GITScm polling D) All of the above Answer: D ## Tester using Python Certification Exam Guide import csv with open('data.csv', 'r') as f: reader = csv.reader(f)

B)

import csv reader = csv.read('data.csv')

C)

import pandas as pd df = pd.read_csv('data.csv')

D) Both A and C Answer: D Explanation: Both the standard csv reader and pandas read_csv can load CSV data. Question 37. Which Selenium command scrolls the page until a specific element is visible? A) driver.scroll_into_view(element) B) driver.execute_script("arguments[0].scrollIntoView();", element) C) element.scrollTo() D) driver.scrollTo(element) Answer: B

Tester using Python Certification Exam Guide

Explanation: Executing JavaScript scrollIntoView() via execute_script brings the element into the viewport. Question 38. What is the primary purpose of the __name__ == "__main__" guard in Python test scripts? A) To define a class name B) To ensure code runs only when the script is executed directly, not when imported C) To declare global variables D) To start a Selenium session automatically Answer: B Explanation: The guard prevents code from running during imports, enabling reusable modules. Question 39. Which of the following is a best practice when handling dynamic element IDs in Selenium? A) Use absolute XPath that includes the dynamic ID B) Use a CSS selector that relies on stable attributes like class or data-test-id C) Hard-code the ID values in the script D) Use Thread.sleep() to wait for the ID to appear Answer: B Explanation: Stable attributes make locators resilient to ID changes; absolute XPaths are brittle. Question 40. Which Selenium method retrieves the current page title? A) driver.getTitle() B) driver.title C) driver.get_page_title()

Tester using Python Certification Exam Guide

B) driver.find_element(By.PARTIAL_LINK_TEXT, "Hom") C) driver.find_element(By.ID, "Home") D) Both A and B are valid Answer: C Explanation: By.ID locates by element ID, not link text; the other two are correct link-text strategies. Question 44. In a hybrid automation framework, which component typically manages test data, test execution, and reporting? A) Only the test scripts B) A combination of data-driven and keyword-driven modules with a central driver class C) Only the reporting module D) None of the above Answer: B Explanation: Hybrid frameworks blend multiple patterns (data-driven, keyword-driven) and often include a central driver for orchestration. Question 45. Which Python built-in function can be used to pause execution for a fixed time, though it is discouraged for synchronization? A) time.wait() B) sleep() from time module C) pause() from os module D) delay() from sys module Answer: B Explanation: time.sleep(seconds) halts execution but is not recommended for dynamic waits in Selenium.

Tester using Python Certification Exam Guide

Question 46. Which of the following statements about implicitly_wait() is true? A) It applies only to the next find operation B) It sets a global timeout for locating elements throughout the WebDriver session C) It overrides explicit waits D) It replaces the need for any other synchronization technique Answer: B Explanation: implicitly_wait() defines a default polling period for all element searches. Question 47. What does the Select class in Selenium require as an argument? A) A WebElement that represents a tag B) The driver instance C) The index of the option to select D) The visible text of the option Answer: A Explanation: `Select(element)` wraps the WebElement to provide selection methods. Question 48. Which command captures a screenshot of the current browser window and saves it as error.png? A) driver.save_screenshot("error.png") B) driver.take_screenshot("error.png") C) driver.get_screenshot_as_file("error.png") D) Both A and C Answer: D