Skip to content

Thanasornsawan/RobotFramework-Practice

Repository files navigation

Robot Framework Selenium Practice

This repository is my robot framework practice.In web automation folder is practice robot frammework with just robot framework command (codeless) but if you want python with robot framework, please check in Python Selenium folder.

Version of package in this repository

robotframework | 5.0.1
robotframework-pythonlibcore | 3.0.0
robotframework-requests | 0.9.3
robotframework-seleniumlibrary | 6.0.0
selenium | 4.2.0

Please check your version and document during following this repository because some old robot framework version use another way to define variables

How to start robot

robot {filename.robot}
normal command: robot broke.robot
run specific test case in test suite: robot -t "tc-001*" .\broke.robot
keep the result inside folder Results: robot -d .\Results\ '.\web automation\eBay\basicSearch.robot' 
Specify variable: robot -d .\Results\ -v env:uat '.\web automation\eBay\basicSearch.robot' 
robot -d .\Results\ -v url:www.google.com -v browser:firefox '.\web automation\eBay\basicSearch.robot' 

Web automation

require pip install robotframework and pip install robotframework-seleniumlibrary
Download chrome driver and set into PATH system.

Doppio Tech

File for test web automation is in folder ep01_material for test on localhost
Focus on practice many techniques for xpath input text box and form.

  • ex00 focus on input text that have unique ID
  • ex01 focus on input text that have custom attribute 'v'
  • ex02 focus on parent tag
    have custom attribute 'v'
  • ex03 focus on parent tag
    have custom attribute 'v' + random value
  • ex04 both parent 'div tag' and child 'input tag' not have attribute but have custom attribute 'c'
  • ex05 None of tags has attruibutes, focus on text between
  • ex06 dupplicate attribute on parent tags, use keyword 'and'
  • assignment practice input, click element in dropdown, select checkbox, click button
eBay

Focus on testing real web application with "Page Object Model" pattern from Resources folder
The idea of POM is to seperate common functions following pages or navigation to use with many places.
The commonFunctionality.robot is common functions that can use for all test suites like open and close browser.

- basicSearch.robot use varaible file from ./Resources/WebElements.py and `POM` pattern by seperate into HeaderPage.robot and SearchResultsPage.robot and get parameter arguments from Keywords section.
DemoQA

Focus on practice all Elements, Forms, Alert, Frame & Windows, Widgets, Interactions, Book Store Application

  • broke.robot is focus on veiry image valid/invalid and link valid/invalid
  • radio.robot
  • checkbox.robot (for loop, concat string, scroll to bottom with js)
SauceDemo - ifelse.robot

API automation

require pip install robotframework-requests Run local server by java -jar doppio_api.jar File for test web automation is in folder ep03_material_v2 for test on localhost

Android automation

required pip install robotframework-robotframework-appiumlibrary File for test web automation is in folder ep02_material for test on localhost

  • Download Android studio and then set PATH ANDROID_HOME under system (path from SDK Manager)
  • Download Appmium and Appmium Inspector
  • Download openJDK8 and then set PATH JAVA_HOME under system
  • Start Virtual Device Manager on Android studio and install com.material.components.apk
  • Appium Server GUI -> Advanced > Server address: localhost, Port: 4723, Allow CORP: yes
  • Appium Inspector -> Remote host: localhost, Port: 4723, Path: /wd/hub
  • Copy json in ep2_material\ep2\testapp.json to put in Appium Inspector and then Start Session

The json data meaning..

I want to run test on Android 11 device with application = com.material.components
Start screen = com.material.components.activity.MainMenu

Appium Inspector act as client to sent JSON data to Appium Server for create session. The Appium Server act as middle man that translate JSON data into native framework for both andorid and ios for interacting with that application.But, we also can use robot framework to be client call data to Appium Server.

Execution time fast-slow: Accessibility ID > ID > (UISelector, Xpath)

Python Selenium

refer: https://selenium-python.readthedocs.io/page-objects.html

/Python Selenium/testcase
	main.py (main test cases)
	page.py (verify the testing page)
  	locator.py (keep any attribute like class,id)
        element.py (base function for any element use like search that need to wait page to see element)

Other useful links for practice robot framework

Recommend vs-code plugin for robot framework project

vscode plugin