Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zahid-automate/robotframework
Robot framework automation using Python
https://github.com/zahid-automate/robotframework
python robotframework
Last synced: 18 days ago
JSON representation
Robot framework automation using Python
- Host: GitHub
- URL: https://github.com/zahid-automate/robotframework
- Owner: Zahid-Automate
- Created: 2024-03-31T07:15:25.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-05-04T22:38:33.000Z (8 months ago)
- Last Synced: 2024-10-29T22:08:54.095Z (2 months ago)
- Topics: python, robotframework
- Language: HTML
- Homepage:
- Size: 831 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Robot Framework Demo
Robot Framework is a generic open source test automation framework. In addition to introducing Robot Framework test data syntax, this demo shows how to execute test cases, how generated reports and logs look like, and how to extend the framework with custom test libraries.Contents:
Downloading package
To get the project, you can either download and extract the latest package from the GitHub or checkout the source code directly. As a result you get **RobotFramework** directory with several files.Example test cases, test library used by a robo project, and generated results are available also online. Therefore, you do not need to download the project if you are not interested in running it yourself.
Test cases
This project contains the below test cases
1. Login into a website
2. Verifying Input Box
3. Selecting Radio buttons and Checking/Unchecking of Checkboxes
4. Selecting Drop Down values
5. Using Implicit wait keyword **set selenium implicit wait** for a Registration Page on a website
6. Command to run only test cases with Tag regression
```cmd
robot --include=regression .\TestCases\CredentialTest.robot
```
Command to exclude test cases with Tag regression```cmd
robot -e regression .\TestCases\Credentials.robot
```
Command to run test cases with both Tags i.e sanity and regression
```cmd
robot -i sanity -i regression .\TestCases\Credentials.robot
```
6. Reading data from a complex Json file and passing the same onto a websitePython based debugging in Robot Framework
Import the DebugLibrary.py file present in this project root folder into your test case
Use Suite Tear down keyword and a keyword Teardown Actions as shown below
Make sure to include the set breakpoint in your test case to activate the Python Debugger (Pdb)
Use the below command in the terminal, to run the test cases in Debug Mode
```cmd
$Env:ROBOT_DEBUG = 'TRUE'; robot .\TestCases\ReadingDataFromJson.robot
```
Set the value of the variable to the desired value at run time
```cmd
BuiltIn().set_local_variable("{firstName}", "Superman")```
In order to get the value of the variables during run time use below command in Pdb
```cmd
BuiltIn().get_variable_value("${firstName}")
```
Screen-shot of how the value will look like after runtime modification of the variable
When pause for debug keyword is used , we get to see the below pop-up, where the execution gets stopped
Printing the console logs to a txt file
```
robot .\TestCases\Credentials.robot > results/console-output.txt
```The above will create a txt log file which has all the contents of **Log to Console** key word present in your test case into a results directly
Re-run the failed test cases and Merge the rerun results with the Previously failed test result
```
robot --output original.xml tests # first execute all tests
```
```
robot --rerunfailed original.xml --output rerun.xml tests # then re-execute failing
```
```
rebot --merge original.xml rerun.xml # finally merge results
```[Re-run Failed Tests.html](https://rawcdn.githack.com/Zahid-Automate/RobotFramework/0713dc35875b2d96c6dafdec4a0f92fc7552240e/report.html)
Generated results
After running tests, you will get report and log in HTML format. Example files are also visible online in case you are not interested in running the demo yourself. Notice that one of the test has failed on purpose to show how failures look like.[FirstReport.html](https://raw.githack.com/Zahid-Automate/pythonAutomationRoboProject/master/report.html)
[Firstlog.html](https://raw.githack.com/Zahid-Automate/pythonAutomationRoboProject/master/log.html)
[ReportWithFailures.html](https://rawcdn.githack.com/Zahid-Automate/pythonAutomationRoboProject/2cb204fd0e407d755137fdffee0f650289556658/report.html)
[LogWithFailures.html](https://rawcdn.githack.com/Zahid-Automate/pythonAutomationRoboProject/2cb204fd0e407d755137fdffee0f650289556658/log.html)Preconditions
A precondition for running the tests is having [Robot Framework](https://robotframework.org/) installed. It is most commonly used on [Python](https://www.python.org/) but it works also with Jython (JVM) and IronPython (.NET). Robot Framework [installation instructions](https://github.com/robotframework/robotframework/blob/master/INSTALL.rst) cover installation procedure in detail. People already familiar with installing Python packages and having pip package manager installed, can simply run the following command:
```
pip install robotframework
```Robot Framework 3.0 and newer support Python 3 in addition to Python 2.