0% found this document useful (0 votes)
6 views2 pages

Bitmap Checkpoints Lab Guide

The document provides a guide for implementing bitmap checkpoint testing using Selenium and PyAutoGUI. It includes steps for setting up a virtual environment, installing necessary packages, and conducting two experiments: capturing and comparing web element screenshots and screen area screenshots. The conclusion emphasizes the effectiveness of bitmap comparison in validating UI consistency.

Uploaded by

dinkerpaul138
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Bitmap Checkpoints Lab Guide

The document provides a guide for implementing bitmap checkpoint testing using Selenium and PyAutoGUI. It includes steps for setting up a virtual environment, installing necessary packages, and conducting two experiments: capturing and comparing web element screenshots and screen area screenshots. The conclusion emphasizes the effectiveness of bitmap comparison in validating UI consistency.

Uploaded by

dinkerpaul138
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Software Testing Lab Guide

Experiments 3a & 3b: Bitmap Checkpoints

1. Objective

To implement bitmap checkpoint testing using Selenium and PyAutoGUI.

2. Virtual Environment Setup


cd ~/your_project_folder
python3 -m venv selenium-env
source selenium-env/bin/activate

3. Install Packages
pip install --upgrade pip
pip install selenium Pillow pyautogui

4. Experiment 3a: Web Element Bitmap Check

This experiment captures and compares a web element screenshot.


from selenium import webdriver
from [Link] import By
from [Link] import WebDriverWait
from [Link] import expected_conditions as EC
from PIL import Image
import os

driver = [Link]()
[Link]("[Link]

element = WebDriverWait(driver, 10).until(


EC.presence_of_element_located((By.CLASS_NAME, "python-logo"))
)

[Link]("current_element.png")

if not [Link]("baseline_element.png"):
[Link]("baseline_element.png")
print("Baseline image created. Run again to compare.")
else:
baseline = [Link]("baseline_element.png")
current = [Link]("current_element.png")
if list([Link]()) == list([Link]()):
print("PASS")
else:
print("FAIL")

[Link]()

5. Experiment 3b: Screen Area Bitmap Check

This experiment captures and compares a screen region.


import os
import pyautogui
from PIL import Image

region = (100, 200, 300, 200)

screenshot = [Link](region=region)
[Link]("current_area.png")

if not [Link]("baseline_area.png"):
[Link]("baseline_area.png")
print("Baseline created")
else:
baseline = [Link]("baseline_area.png")
current = [Link]("current_area.png")
if list([Link]()) == list([Link]()):
print("PASS")
else:
print("FAIL")

6. Conclusion

Bitmap comparison helps validate UI consistency effectively.

You might also like