Robot Framework (RIDE): Data Sanity Check failing - robotframework

I am getting below error when I copy this value in my RIDE resource file in Robot Framework. Don't know what is wrong with this value.
I am able to save other 900 values in same format but not this one.
ERROR:Data Sanity Check Failed.Reset Changes?
Value I am trying to save is as below:
${MISDOB2ATTMM} Dobson to VF Migration (Manual)
Examples of correct values:
${CHILE} Chile
${CI} Cote d Ivoire (Ivory Coast)
${CN} China, Peoples Republic of
${COSTARICA} Costa recei

The error message you got was from the Text Editor (you did not mention this).
This could be because there may be invisible characters in that variable definition. Maybe indentation, or even a TAB symbol.
Also, that format for variable definition is correct for the section,
*** Variables ***
But not correct for keywords or test case sections.
I recommend to always use the '=' symbol for variables assignments outside the Variables section. For example:
${MISDOB2ATTMM}= Set Variable Dobson to VF Migration (Manual)

Related

Xcos throws "Undefined variable: scifunc_block_m" message in console

When I run a Xcos model containing a scifunc_block_m block like shown below
I get an error message relating to data dimensions inconsistency:
"Data dimensions are inconsistent:"
" Variable size=[1,1]"
"Block output size=[100,1]."
But when I double click in the block in order to see what can I change to make the dimensions correct I get a message in the console saying
Undefined variable: scifunc_block_m
What bugs me is that scifunc_block_m is not the name of any variable, but rather the name of the block itself like can be seen in the official docs.
Of course I double checked that nowhere in my function phase_shifter neither anywhere else I have any variable named like that.
I tried with Scilab 6.1.1 and 6.1.0 believing that it might be a bug from apparently not.
In your phase_shifter.sce file generating the input variable,
the signalIn variable does not comply with the From Workspace block requirements, whose documentation says that the input variable
must be a structure with time and values fields
.time must be a column vector, and in your case
.values must also be a column
So,
t = (0:1/fs:Npp/fs - 1/fs); // time vector
signalIn = A*%e^(%i*w*t);
should be replaced with
t = (0:1/fs:Npp/fs - 1/fs)'; // time column vector
signalIn = struct("time",t, "values",A*%e^(%i*w*t));
This fixes the inconsistent dimensions message.
In addition, i am not able to reproduce your issue about Undefined variable: scifunc_block_m. The parameters interface opens as expected.
You may get this kind of messages if you try to run some xcos parts out of xcos, without beforehand loading xcos-related libraries.
Then, we get an unclear "Output should be of complex type." message on the From workspace block.
By the way, you try to plot some complex values. Please have a look to the MATMAGPHI block before entering MUX: https://help.scilab.org/docs/6.1.1/en_US/MATMAGPHI.html

QA Wizard checkpoint wrong evaluation when using data source?

I'm using QA Wizard Pro from Perforce. I've added a checkpoint to my automated test case to verify a textbox contains a certain value, which was calculated by the program.
When I use the hard coded value (here 5.273) the test passes
Window("FormMain").EditBox("tbClassC").Checkpoint("Text", "5.273", True, "")
When I read the value from a data source (excel file) I get an error
Window("FormMain").EditBox("tbClassC").Checkpoint("Text", Cell("ClassC"), True, "")
Error:
Control (tbClassC) Property (Text): The "5.273" expected value does not match the actual value of "5.273".
I followed this tutorial on how to use the checkpoint feature.
Any idea what I may do wrong?
I figured out the problem. Since I was using an Excel file as source I had to specificly declare the cell as data type Text. This way QA Wizard interpreted the excel value as text and not as a number.

How to split robot testcases using colon, so that each will be treated as separate testcase?

I have 3 test cases which will test the same functionality. It will use same keywords as shown below.
Instead of writing three different test cases "test-1151,test-2125,test-2126", I want to write one test case separated with colons as shown below. But robot should treat this as three seperate test case and it should show pass/fail test case count accordingly.
test.robot:
*** Settings ***
Library lib.test
*** Variables ***
*** Keywords ***
*** Test Cases ***
test-1151:test-2125:test-2126
[Documentation] test_sample
[Tags] sanity
Install Adobe software
Launch the app
If I run the above robot file, robot is taking "test-1151:test-2125:test-2126" as one test case. How to tell robot to treat this as three different test cases (separated with colon)?
Why don't you turn the detail of the test case into a keyword? Then write three test cases that call the keyword?
This might be an alternative option for you:
http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#data-driven-style
Basically have one test template which would be the same, maybe have some arguments for parameters that will change based on test cases. You can then have many test cases doing exactly the same or slightly different things in a short and concise notation.
It's unclear what your real goals are. It seems that you want to see three items in the report, "test-1151", "test-2125", and "test-2126", but that you actually only want to run that test once.
I'm guessing that those names correspond to either a test plan or an item in a ticketing system of some sort.
My recommendation is to use tags to tag your test. You can give the test any name you want, and then give it tags for the names you want to see in the report. Once the test runs, the report can give you statistics based on tag.
For example:
test-1151:test-2125:test-2126
[Documentation] test_sample
[Tags] sanity test-1151 test-2125 test-2126
Install Adobe software
Launch the app
To answer your specific question of whether you can have this one test reported three times, the answer is "no". It will show up in the logs and report as a single test. However, the report also includes test status by tag, so you will see one item in the report for each tag.

Using Get Time in Robot Framework Test cases

How to Use a particular Time For all the test cases in RF.Suppose i have to give time in some field of UI(User Interface).
I have to give that as current time plus 15 mins across all the test cases..How can this be done?
I have declared global variable in Resources.txt and this is being imported across all the test case files
${hr}= Get Time hour NOW + 15min
${min}= Get Time min NOW + 15min
When i run the test case, am getting the following error :
Setting variable '${hr}' failed: Creating a scalar variable with a list value in the Variable table is no longer possible. Create a list variable '#{hr}' and use it as a scalar variable '${hr}' instead.
Setting variable '${min}' failed: Creating a scalar variable with a list value in the Variable table is no longer possible. Create a list variable '#{min}' and use it as a scalar variable '${min}' instead.
But when i use the same in Test1.txt they are working fine..
If the code you are using is in the *** Variables *** section, the format is wrong. Within the variables table you cannot call keywords. What you're doing is creating a list named ${hr} with the literal value of ["Get Time", "hour", "NOW + 15min"]
From the robot framework user's guide:
The most common source for variables are Variable tables in test case
files and resource files. Variable tables are convenient, because they
allow creating variables in the same place as the rest of the test
data, and the needed syntax is very simple. Their main disadvantages
are that values are always strings and they cannot be created
dynamically.
You will need to call the Get Time keyword from within a keyword or test case. Since you want to do this at startup, you can call the keyword in the suite setup.
*** Keywords ***
initialize timestamp variables
${hr}= Get Time hour NOW + 15min
${min}= Get Time min NOW + 15min
set suite variable ${hr}
set suite variable ${min}
*** Settings ***
Suite setup initialize timestamp varaibles
If you do this in multiple suites, it's entirely possible that not all suites will use exactly the same value. An alternative solution would be to set a global variable, and only set it once. Each suite could detect if it's been set yet, and only set it if it hasn't been set.
You could also do this through a python based variable file.
Note: this solution only sets the variable for the current suite. If you do this in a suite initialization file (eg: mysuite/__init__.robot), you will need to use Set Global Variable rather than Set Suite Variable.

remove log information from report and save report in desire location

I am new to robot framework and wanted to see if i can get any simple code for custom report. I am also fine with answer to my problem. I went through all questions related to report but could not find any specific answer to my problem. currently my report contains log and wanted to see if i can remove log information from reports and save report in specific location. I just want to get PASS/FAIL information in my report. Can any one give me example how i can overcome this problem? I also need to know how i can save my report in different location. Any example would be helpful. Thank you in advance.
There is a tool called Rebot which is part of Robot Framework.
By default, Robot Framework creates XML reports. The XML reports are automatically converted into HTML reports by Rebot.
You can set the location of the output files in the execution by specifying the parameter --outputdir (and thus set a different base directory for outputs).
From the documentaiton:
All output files can be set using an absolute path, in which case they are created to the specified place, but in other cases, the path is considered relative to the output directory. The default output directory is the directory where the execution is started from, but it can be altered with the --outputdir (-d) option. The path set with this option is, again, relative to the execution directory, but can naturally be given also as an absolute path. Regardless of how a path to an individual output file is obtained, its parent directory is created automatically, if it does not exist already.
You can call Rebot yourself to control this conversion.
You can also run Rebot after the test was run in order to create new output on a different location.
See documentation in:
http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#post-processing-outputs
The following example shows how to store the HTML reports in a different location and including only partial data:
rebot --include smoke --name Smoke_Tests c:\results\output.xml --outputdir c:\version1.0\reports
In the example above, we process the file c:\results\output.xml, create a new report called Smoke_Tests that includes only tests with the tag smoke and save it to the output folder c:\version1.0\reports
In addition you can also set the location of the log file (HTML) from the execution.
The command line option --log (-l) determines where log files are created.
The command line option --report (-r) determines where report files are created
Removing log lines can be done a bit differently. If you run rebot --help you'll get the following options:
--removekeywords all|passed|for|wuks|name: * Remove keyword data
from all generated outputs. Keywords containing
warnings are not removed except in `all` mode.
all: remove data from all keywords
passed: remove data only from keywords in passed
test cases and suites
for: remove passed iterations from for loops
wuks: remove all but the last failing keyword
inside `BuiltIn.Wait Until Keyword Succeeds`
name:: remove data from keywords that match
the given pattern. The pattern is matched
against the full name of the keyword (e.g.
'MyLib.Keyword', 'resource.Second Keyword'),
is case, space, and underscore insensitive,
and may contain `*` and `?` as wildcards.
Examples: --removekeywords name:Lib.HugeKw
--removekeywords name:myresource.*
--flattenkeywords for|foritem|name: * Flattens matching keywords
in all generated outputs. Matching keywords get all
log messages from their child keywords and children
are discarded otherwise.
for: flatten for loops fully
foritem: flatten individual for loop iterations
name:: flatten matched keywords using same
matching rules as with
`--removekeywords name:`

Resources