Automation Certification Level I Python Practice Exam, Exams of Technology

This entry-level automation exam tests Python scripting fundamentals for test automation. Topics include Python syntax, file handling, exception management, test data creation, basic API testing, automation logic, and writing maintainable test scripts. Real-world tasks require candidates to automate small scenarios and debug faulty scripts.

Typology: Exams

2025/2026

Available from 01/13/2026

shilpi-jain-1
shilpi-jain-1 🇮🇳

4.2

(5)

29K documents

1 / 91

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Automation Certification Level I Python
Practice Exam
**Question 1. Which of the following best describes an “automationready” task?**
A) A task that requires creative decisionmaking
B) A repetitive, rulebased, highvolume process
C) A oneoff manual data entry
D) A task that depends on unpredictable human input
Answer: B
Explanation: Automationready tasks are those that are repetitive, follow clear rules, and occur
frequently, making them ideal for scripting or robotic process automation.
**Question 2. In calculating ROI for an automation project, which factor usually has the greatest
impact?**
A) License cost of the automation tool
B) Time saved per execution multiplied by execution frequency
C) Number of developers involved
D) Length of the source code file
Answer: B
Explanation: ROI is driven primarily by the time saved (in labor cost) and how often the
automated task runs; high frequency magnifies savings.
**Question 3. Which statement correctly differentiates attended from unattended
automation?**
A) Attended automation runs on a server without user interaction, unattended requires a user
present.
B) Attended automation is triggered by a user, unattended runs automatically without human
initiation.
C) Attended automation can only be written in Python, unattended must use PowerShell.
D) There is no functional difference; the terms are interchangeable.
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

Partial preview of the text

Download Automation Certification Level I Python Practice Exam and more Exams Technology in PDF only on Docsity!

Practice Exam

Question 1. Which of the following best describes an “automation‑ready” task? A) A task that requires creative decision‑making B) A repetitive, rule‑based, high‑volume process C) A one‑off manual data entry D) A task that depends on unpredictable human input Answer: B Explanation: Automation‑ready tasks are those that are repetitive, follow clear rules, and occur frequently, making them ideal for scripting or robotic process automation. Question 2. In calculating ROI for an automation project, which factor usually has the greatest impact? A) License cost of the automation tool B) Time saved per execution multiplied by execution frequency C) Number of developers involved D) Length of the source code file Answer: B Explanation: ROI is driven primarily by the time saved (in labor cost) and how often the automated task runs; high frequency magnifies savings. Question 3. Which statement correctly differentiates attended from unattended automation? A) Attended automation runs on a server without user interaction, unattended requires a user present. B) Attended automation is triggered by a user, unattended runs automatically without human initiation. C) Attended automation can only be written in Python, unattended must use PowerShell. D) There is no functional difference; the terms are interchangeable.

Practice Exam

Answer: B Explanation: Attended automation is invoked by a user (e.g., a macro), while unattended runs on its own schedule or trigger without user involvement. Question 4. Which command creates a new isolated Python environment named “env” using the built‑in venv module? A) python - m pip create env B) python - m venv env C) pyenv install env D) pipenv --python env Answer: B Explanation: python - m venv <folder> creates a virtual environment in the specified folder. Question 5. After activating a virtual environment, which command installs packages listed in a requirements file? A) pip install - r requirements.txt B) python install requirements.txt C) pipenv sync requirements.txt D) conda install - f requirements.txt Answer: A Explanation: pip install - r <file> reads the file and installs each package with the specified version. Question 6. Which of the following is the correct way to access the third command‑line argument passed to a Python script? A) sys.argv[2]

Practice Exam

Question 9. In Python, which of the following statements correctly imports the Path class from the pathlib module? A) import pathlib.Path B) from pathlib import Path C) import Path from pathlib D) from os import Path Answer: B Explanation: The syntax from <module> import <name> imports a specific class or function. Question 10. What is the primary advantage of using pathlib.Path over the older os.path functions? A) It only works on Windows systems. B) It provides an object‑oriented interface that is more readable and chainable. C) It automatically installs missing packages. D) It replaces the need for any file I/O operations. Answer: B Explanation: pathlib offers an OO approach, allowing path manipulations via methods and operator overloading, improving readability. Question 11. Which of the following loops will execute at least once regardless of the condition? A) for i in range(5): B) while condition: C) do … while condition (Python does not have this) D) None; Python has no loop that guarantees at least one execution. Answer: D

Practice Exam

Explanation: Python lacks a do…while construct; all its loops may skip execution if the condition is false initially. Question 12. What will be the output of the following list comprehension? [x**2 for x in range(3) if x%2==0] A) [0, 1, 4] B) [0, 4] C) [1, 9] D) [0, 2, 4] Answer: B Explanation: range(3) yields 0,1,2; filter x%2==0 keeps 0 and 2; squaring gives 0 and 4. Question 13. Which keyword is used to define a function that can accept an arbitrary number of positional arguments? A) **kwargs B) *args C) *var D) **params Answer: B Explanation: *args collects extra positional arguments into a tuple. **Question 14. Consider the following code:

x = 10 def foo(): ## Practice Exam A) import utils.py B) from utils import * C) import utils D) include utils Answer: C Explanation: `import utils` loads the module; the `.py` extension is omitted. **Question 17. When handling file I/O, which exception is raised if the specified file does not exist?** A) IOError B) FileNotFoundError C) OSError D) ValueError Answer: B Explanation: In Python 3, `FileNotFoundError` is a subclass of `OSError` specifically for missing files. **Question 18. Which pattern correctly implements a retry mechanism that attempts a network call up to three times before failing?** A) ```python for i in range(3): try: request() break ## Practice Exam except ConnectionError: continue 

B)

while True: request() 

C)

try: request() except: pass 

D)

retry(request, 3) 

Practice Exam

B) csv.DictReader C) csv.load_dict D) csv.getrows Answer: B Explanation: csv.DictReader maps each row to a dict using the first row as field names. Question 22. When writing JSON data to a file, which parameter ensures the output is human‑readable with indentation? A) indent= B) pretty=True C) format='json' D) line_break=True Answer: A Explanation: json.dump(..., indent=4) adds whitespace for readability. Question 23. Which regular‑expression pattern matches an email address of the form [email protected]? A) \w+@\w+\.\w+ B) [a-z]+@[a-z]+.[a-z]+ C) .+@.+\..+ D) [\w.-]+@[\w.-]+\.[a-zA-Z]{2,} Answer: D Explanation: Option D correctly allows letters, digits, underscores, dots, hyphens, and enforces a top‑level domain of at least two letters. Question 24. In the openpyxl library, which object represents an individual worksheet?

Practice Exam

A) Workbook B) Worksheet C) Sheet D) ExcelSheet Answer: B Explanation: openpyxl.Workbook contains Worksheet objects accessed via wb.active or wb[sheetname]. Question 25. Which HTTP status code indicates that the client’s request was successful and a resource was created? A) 200 B) 201 C) 202 D) 204 Answer: B Explanation: 201 (Created) signals that a new resource has been successfully created. Question 26. When using the requests library, which method sends a POST request with JSON payload automatically encoded? A) requests.post(url, data=json_data) B) requests.post(url, json=json_data) C) requests.post(url, payload=json_data) D) requests.send(url, json=json_data) Answer: B Explanation: The json= parameter serializes the object to JSON and sets the appropriate header.

Practice Exam

Explanation: button.submit-btn selects <button> elements that have the class submit-btn. Question 30. When automating a browser with Selenium, which method clicks on a web element stored in variable elem? A) elem.select() B) elem.click() C) elem.press() D) elem.activate() Answer: B Explanation: click() triggers a mouse click on the element. Question 31. Which Python module provides a simple way to schedule recurring jobs without external cron? A) schedule B) timeit C) threading D) joblib Answer: A Explanation: The schedule library lets you define jobs with every().day.at() etc., and run them in a loop. Question 32. In the logging module, which log level is intended for detailed diagnostic information? A) INFO B) DEBUG C) WARNING

Practice Exam

D) ERROR

Answer: B Explanation: DEBUG is the lowest level, used for verbose debugging output. Question 33. Which handler writes log records to a file named app.log? A) logging.StreamHandler('app.log') B) logging.FileHandler('app.log') C) logging.ConsoleHandler('app.log') D) logging.OutputHandler('app.log') Answer: B Explanation: FileHandler directs logs to a specified file. Question 34. Which of the following smtplib methods initiates a TLS‑encrypted session after connecting? A) starttls() B) enable_tls() C) secure() D) encrypt() Answer: A Explanation: SMTP.starttls() upgrades the connection to use TLS. Question 35. In a Windows environment, which command creates a scheduled task that runs script.py daily at 02:00? A) schtasks /create /tn "MyTask" /tr "python script.py" /sc daily /st 02: B) taskschd /new /name "MyTask" /run script.py /daily 02:

Practice Exam

B) is_file() C) is_dir() D) is_path() Answer: B Explanation: is_file() returns True only if the path exists and is a regular file. Question 39. Which of the following code snippets correctly creates a dictionary comprehension that maps numbers 1‑5 to their squares? A) {x: x**2 for x in range(1,6)} B) [x: x**2 for x in range(1,6)] C) dict(x, x**2 for x in range(1,6)) D) {x, x**2 for x in range(1,6)} Answer: A Explanation: Dictionary comprehensions use {key: value for ...} syntax. Question 40. In Python, which built‑in function can be used to convert an iterable into a list? A) tuple() B) set() C) list() D) dict() Answer: C Explanation: list(iterable) returns a list containing the items from the iterable. Question 41. Which exception should you catch to handle a failed HTTP request due to a timeout using the requests library?

Practice Exam

A) requests.HTTPError B) requests.ConnectionError C) requests.Timeout D) requests.RequestException Answer: C Explanation: requests.Timeout is raised specifically when a request exceeds the timeout limit. Question 42. Which of the following statements about *args and **kwargs is true? A) *args captures keyword arguments, **kwargs captures positional arguments. B) Both must appear together in a function definition. C) *args must appear before any regular positional parameters. D) **kwargs must appear after any *args in the parameter list. Answer: D Explanation: The correct order is def func(pos1, *args, **kwargs): .... Question 43. Which shutil function copies a single file while preserving its metadata? A) copy() B) copy2() C) copyfile() D) move() Answer: B Explanation: shutil.copy2() copies the file and attempts to preserve metadata such as timestamps.

Practice Exam

Question 47. Which log level should be used for messages that indicate a recoverable problem that does not stop program execution? A) INFO B) DEBUG C) WARNING D) CRITICAL Answer: C Explanation: WARNING signals an issue that may need attention but doesn’t abort the program. Question 48. Which of the following statements about Python’s with statement is correct? A) It can only be used with file objects. B) It ensures that the entered context’s __exit__ method is called, even if an exception occurs. C) It automatically retries the block on failure. D) It replaces the need for functions. Answer: B Explanation: The with statement guarantees cleanup by invoking __exit__ regardless of exceptions. Question 49. Which pathlib method returns the file name and extension of a path as a string? A) name() B) stem() C) name

Practice Exam

D) suffix Answer: C Explanation: Path.name returns the final component, including extension; stem returns name without suffix. Question 50. In a REST API, which status code indicates that the client is not authorized to access the requested resource? A) 401 B) 403 C) 404 D) 500 Answer: A Explanation: 401 (Unauthorized) means authentication is required or failed; 403 means authenticated but forbidden. Question 51. Which of the following Python statements correctly appends a new row to a CSV file using csv.writer? A) writer.writerow(['a','b','c']) after opening file with mode 'a' B) writer.write(['a','b','c']) after opening file with mode 'w' C) writer.addrow(['a','b','c']) D) writer.append(['a','b','c']) Answer: A Explanation: Opening the file in append mode ('a') and calling writer.writerow() adds a new row. Question 52. Which of the following is a correct way to parse a JSON string s into a Python dictionary?