Testing

Introducing software testing such as automated testing, tool test...

Create PyDev/Python project in Eclipse

« Previous Next »

Go to File -> New -> Other…

Type “pydev” and then select PyDev Project and click Next button.

Input project name is “LoginForm” and location where the project will be stored. Then click Finish button.

Create a Python source code file

Right click on LoginForm of the project and click New -> PyDev

Type package name is “Demo” and click Finish button.

Add a Python file with name is “login-form-successfully.py and click Finish button.

Run a simple Selenium Python script

Create open-istqblearning-website.py file and input the script below.

import time
from selenium import webdriver

# Creates a new instance of the chrome driver.
driver = webdriver.Chrome()

# Loads a web page in the current browser session
driver.get("https://istqblearning.com")

# Waits for 5 seconds and then close the browser
time.sleep(5)
driver.close()
print("Finish running the script")

Run the script by right-clicking on the file and select Run As -> Python. The message “Finish running the script” will be printed in the Eclipse console.

« Previous Next »
Scroll to top