if variable usage bug in Robot Framework? - robotframework

I find the follow variables are handled as one variable in RF:
${user_name}= Set Variable idiot_robot
Log To Console ${user_name}
Log To Console ${username}
Log To Console ${userName}
the print values are all the same, who can tell me if this is RF's bug?

This is intended behaviour as stated in the official Robot Framework docs (https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html).
Quote from section 2.6.2 "Robot Framework variables, similarly as keywords, are case-insensitive, and also spaces and underscores are ignored."

Related

Log values outside keywords in log.html in robot framework

I am new to robot framework and I am trying to log some values in log.html
Similar to how Log with Warn option works, I want to log values outside the keywords in html file
Is there any option for this in robot framework

Getting Tagname value passed during execution in robot framework

Need help in robot framework, I want to know how to pass tag names that passed during execution of robot file in robot framework to python function.
Example:
executing robot file with tag name Sanity, I want way to get the value Sanity and pass to the python function.
robot -i Sanity testsuite.robot
def pyfunction(tagname):
*** Here i need to get value "Sanity" which is passed during executing robot file.

Robot tests calling another robot file

Is it possible to call a robot framework file from another robot framework file. Can some one give examples of it
Requirement
We have some tests which are of repetitive nature. The idea is to have these tests present in a Robot file which can be called into the main robot tests file. This will allow us to keep adding to the list of repetitive tests and all the new / old tests will be available for the main tests.
Any examples will help. Thanks.
-KK
Tests (or Test cases) are not reusable components in robot framework. Tests exist to perform verifications. Once those verifications have been made, there's no point in running the test again in the same test run.
Even though tests can't call other tests, they can call user keywords, which is the foundation of robot framework. If you have bits of functionality that you want to be reusable, you put that functionality in keywords, and then you can use those keywords in as many tests as you want.
For example, lets say that you need to send a signal to a device and check for a light to come on. Instead of writing a test that does this, and then repeating the test over and over, you create a keyword that sends the signal, and a keyword that verifies the light is on, and then call these keywords from multiple tests (or one data-driven test).
Yeah.
Just declare the file that you wish to call in Settings section of your code as specified below.
Resource ../common/Resource_Apps.robot
Now you can use or call all the keywords written in this resource file.
just import the another robot as a Resource
Settings:
Library PythonLibrary.py
Resource <Folder_Name>/Example.robot

How to Customise the Log file generated in the robot Framework Report

I want only test scenarios in the Log file of the report generated in the Robot Framework but while clicking upon the Test Scenarios the test scripts is getting expanded and the Test steps are clearly visible how can stop this issue
I have attached the screenshots I want to achieve this
But I am getting this type of Log Report
In Robot Framework userguide there is an entire section dedicated to this functionality: Removing and Flattening Keywords. In your case I think that the --removekeywords all or the --removekeywords passed should be of particular interest.

What does "--dryrun" do in Robot Framework pybot command?

I have used --dryrun along with my pybot command; I want to know what exactly it validates for in testcase or in library.
It parses all of the test suites and executes the tests. It does not execute any keywords, but it does parse them for correctness. The main benefits listed by the user guide are:
Using keywords that are not found.
Using keywords with wrong number of arguments.
Using user keywords that have invalid syntax.
In addition to these failures, normal execution errors are shown, for example, when test library or resource file imports cannot be resolved.
For more information see http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#dry-run

Resources