#testcases #test #testingautomation #selenium #webautomation #webtesting #paython
Setup (التهيئة): Actions performed before the test starts (e.g., Opening the browser, logging in).
Teardown (التنظيف): Actions performed after the test finishes (e.g., Closing the browser, taking a screenshot, logging out).
-Suite Setup / Suite Teardown: Runs once at the very beginning and once at the very end of the whole file.
-Test Setup / Test Teardown: Runs before and after every single test case in the file.
*** Settings ***
Library SeleniumLibrary
# This will run before EVERY test case
Test Setup Open My Website
# This will run after EVERY test case (even if they fail!)
Test Teardown Close Browser
*** Variables ***
${URL} file:///C:/Hussein/RFW_Tutorial/Robot Framework/login_page.html
${BROWSER} Chrome
*** Test Cases ***
Valid Login Test
[Documentation] Checking login with correct credentials
Input Text id=username_input RobotTester
Input Text id=password_input Test1234
Click Button id=login_button
Page Should Contain Welcome, RobotTester!
Invalid Login Test
[Documentation] Checking login with wrong credentials
Input Text id=username_input RobotTester
Input Text id=password_input Test1234
Click Button id=login_button
Page Should Not Contain Welcome
*** Keywords ***
Open My Website
Open Browser ${URL} ${BROWSER}
Maximize Browser Window
Created By : Hussein Mikawi
Email : [email protected]
Phone : +201100757603