Pages

Sep 8, 2025

From Hello World to Smarter Testing: Kickstarting Your Coding Journey — Part 1

With AI supplementing human-written code in today’s applications, testers should no longer limit themselves to checking if features work functionally. To increase their awareness and knowledge and understanding about how code drives the system behaviour, learning to code would be a great start. But instead of learning abstract coding explaining concepts of a programming language, this is an attempt to build something directly relevant to the testing community i.e. building automated checkpoints can give us practical insight into developer’s instructions and how they translate those into the application behaviours we test.

Coding isn’t about turning testers into developers but rather equpping them to see risks earlier and designing smarter strategies to test the application and becoming stronger advocates of quality in AI driver future.

So lets start the building something simple — the “Hello World” of Selenium using Python, goal being to open a browser, navigate to a url and close when ready. This approach is similar to how developers start their journey. Before starting please install python, selenium and chromedriver.

Step 1: Create project folder

  • Create a folderblayzelite and open in VSCode(or any code editor of your choice)
  • Inside this folder create a file start.py and add below code
from selenium import webdriver

driver = webdriver.Chrome()
driver.get("http://selenium.dev")
input("Did Selenium.dev webpage open successfully?\n press enter to continue")
driver.quit()

  • Open terminal, navigate to blayzelite folder and run python start.py , if everything is installed correctly (Python + Selenium + ChromeDriver) you should see the Selenium.dev page opening in Chrome browser. Press Enter, and the browser will close

Step 2: Think like a tester

Now, as testers, we know in real projects we don’t just test one URL and on one browser. We deal with multiple environments (dev, test, staging, prod) and multiple browsers (Chrome, Firefox, Edge, etc.). That means we need a smarter way to handle browsers and URLs instead of hardcoding them into our script.

This is where the idea of a configuration file comes in , let’s see how to make our script flexible enough to run against any environment and browser we choose. The config makes your setup flexible (avoiding hardcode URLs or browser types), and the driver is the bridge that connects your code to the browser or app. Create the following files inside our project folder:
#blayzelite/config.py
import configparser

class Config:
def __init__(self, config_file="config.ini"):
self._config = configparser.ConfigParser()
self._config.read(config_file)

def get(self, section, key, fallback):
"""Always return a string. If no value found, return empty string."""
value = self._config.get(section, key, fallback=fallback)
return value if value is not None else ""

def getboolean(self, section, key):
return self._config.getboolean(section, key)

config = Config()
#blayzelite/config.ini
[web]
base_url = https://www.selenium.dev
browser = chrome
headless = false
#blayzelite/start.py
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions
from selenium.webdriver.firefox.options import Options as FirefoxOptions

from config import config


def create_driver():
browser = config.get("web", "browser", fallback="chrome").lower()
headless = config.getboolean("web", "headless")
driver_classes = {
"chrome": (webdriver.Chrome, ChromeOptions),
"firefox": (webdriver.Firefox, FirefoxOptions),
}

if browser not in driver_classes:
raise ValueError(f"Unsupported browser: {browser}")

driver_cls, options_cls = driver_classes[browser]
options = options_cls()

if headless and hasattr(options, "add_argument"):
options.add_argument("--headless")

driver = driver_cls(options=options)
return driver


if __name__ == "__main__":
driver = create_driver()
base_url = config.get("web", "base_url", fallback="selenium.dev")
driver.get(base_url)

input(
f"Did {base_url} webpage open successfully?\nPress Enter to close the browser..."
)
driver.quit()
Now in your terminal, navigate to the project folder and run: python blayzelite/start.py, this should should launch the browser, load the Selenium.dev page, and wait for you to press Enter before closing.

Step 3: Trial


Try changing the browser in config.ini to firefox, edge, or safari (depending on what you have installed) and rerun the script, additionally try out handling invalid urls e.g. empty urls or invalid URLs.

This concludes Part 1. We now have a flexible setup that can launch different browsers and environments with just a config change. In the next post, we’ll move beyond simply opening a page and start handling actions(clicks, send keys etc.)

From Hello World to Smarter Testing: Kickstarting Your Coding Journey — Part 1

With AI supplementing human-written code in today’s applications, testers should no longer limit themselves to checking if features work fun...