0
0
Selenium Pythontesting~5 mins

First Selenium script in Selenium Python - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is Selenium used for in software testing?
Selenium is a tool used to automate web browsers. It helps testers check if websites work correctly by simulating user actions like clicking buttons or filling forms.
Click to reveal answer
beginner
What is the first step in writing a Selenium script in Python?
The first step is to import the Selenium WebDriver module and set up the browser driver, like ChromeDriver, to control the browser.
Click to reveal answer
beginner
How do you open a website using Selenium in Python?
You use the 'get' method of the WebDriver instance with the website URL as the argument, for example: driver.get('https://example.com').
Click to reveal answer
beginner
Why is it important to close the browser at the end of a Selenium script?
Closing the browser frees up system resources and ensures the test ends cleanly. You do this with driver.quit() or driver.close().
Click to reveal answer
beginner
What is a locator in Selenium?
A locator is a way to find elements on a web page, like buttons or text boxes. Common locators include ID, name, class name, and XPath.
Click to reveal answer
Which Python package do you import to use Selenium WebDriver?
Aselenium.webdriver
Bselenium.browser
Cselenium.driver
Dselenium.web
What method opens a webpage in Selenium WebDriver?
Aopen()
Bget()
Cload()
Dnavigate()
Which command closes all browser windows and ends the WebDriver session?
Adriver.exit()
Bdriver.close()
Cdriver.quit()
Ddriver.stop()
Which locator is the most reliable to find a web element?
AID
BClass name
CXPath
DTag name
What do you need to run Selenium scripts on Chrome browser?
AFirefoxDriver
BSafariDriver
CEdgeDriver
DChromeDriver
Describe the basic steps to write and run your first Selenium script in Python.
Think about what you need to start, do, and finish a test.
You got /5 concepts.
    Explain why locators are important in Selenium and name some common types.
    Imagine trying to click a button without knowing where it is.
    You got /3 concepts.