use output test case with other test case in input value, RIDE/robot framework - testing

I have a probelm to use an output from a test case to use it with another test tase like input value ! did you have an idea how to do that ?

Even I have seen this issue with Ride. Sometimes ride does not save changes. Need to restart ride to see the saved changes. So, I am using ride only for development purpose and using command line to run test cases. On one window edit changes in ride and run test cases on command line.
To run single test case from command line:
python -m robot -t test_case_name test_suite_name
Hope it clears your doubt.

Related

Is it possible to run just a single or few lines in GAMS?

I have a code of more than 400 lines, and it takes a long time to run it. I'm at the stage of debugging and was wondering whther its possible to just run only a display command in a particular line? I mean like the option we have in PyCharm that we jsut press shift+enter at the desired line and it'll execute only that line.
Thanks
Short answer: No, you can not run just a single line (unless it is the first one).
Little longer, some way that could still be useful to save some time while debugging:
You could add $exit to run just the lines before that and skip the rest of your model.
If you have "static code" that takes some time at the start before you have other code that is work in progress and you want to save the time for the first part, you can use the "Save and Restart" facility of GAMS (see https://www.gams.com/41/docs/UG_SaveRestart.html). For this, you split the model in parts, lets say, the first part will be saved in longPrep.gms, the second part is wip.gms.
Then, you run gams longPrep.gms s=prep, which will generate a save file prep which will be your starting point for your second part by running gams wip.gms r=prep.

Is it possible to disable the syntax check when running molecule test?

I have role, role-1, that I'm testing that is dependent on another role, role-2.
I clone the second role, role-2, into /tmp during the prepare step, and it is imported later from /tmp during the converge, however during the
INFO Running default > syntax
I get an error, that role-2 is not found, as this role is not yet cloned and does not exist on the system.
From the debug/verbose output it look like molecule test result in the following command being run
COMMAND: ansible-playbook --diff --inventory /home/vagrant/.cache/molecule/role-1/default/inventory --skip-tags molecule-notest,notest --syntax-check /opt/role-1-role/ansible/roles/role-1/molecule/default/converge.yml
Is there a way to stop this command running the --syntax-check, override the default command that molecule test runs? Or the have the syntax-check skip certain tasks or files?
Just found that you can add scenario to the molecule.yml file and overwrite/re-order the test sequence, so that solves the issue I was having, by reordering the sequence so that the syntax check happened after the prepare step.
See molecule.scenario

Store windows.performance Values In Selenium IDE

This is a slight repeat of How to capture page load times in Selenium-IDE using the app.telemetry page speed monitor
However, the answer in that post does not seem to work (or doesnt anymore), possibly because the storeEval command in Selenium IDE doesnt seem to exist anymore.
I'm trying to retrieve certain windows.performance values for webpages as Selenium IDE moves through them.
I have tried:
Command 'open' > Target 'www.url.com'
Command 'store value' > Target window.performance.timing['navigationStart'] > Value 'result'
Command 'echo' > Target ${result}
But I get:
Warning implicit locators are deprecated, please change the locator to id=window.performance.timing['navigationStart']
The above doesn't work, as obviously its not an id.
Am I using the wrong Command? Or have to enter additional target details? Or can it be done at all?
Thanks!
Use execute script instead:
Command Target Value
open http://www.example.com/
execute script return window.performance.timing['navigationStart'] result
echo ${result}

SCIP write best feasible solution in automated test

Based on steps in http://scip.zib.de/doc/html/TEST.php, I have managed to set up an automated test using SCIP. However, I'd like to write the solution (best feasible solution) to a file, instead of just getting the objective value. Is there anyway to do it in the automated test?
I did a hack in check.sh by replacing
OPTCOMMAND=optimize; write solution myfilename.sol;
But too bad, it doesn't seem to work, when I tried to make TEST=mytest test, this line is observed from the output
bash ./check.sh mytest bin/scip-3.1.0.linux.x86_64.gnu.opt.spx default scip-3.1.0.linux.x86_64.gnu.opt.spx 3600 2100000000 6144 1 default 10000 false false 3.1.0 spx false /tmp optimize;
write: solution is not logged in on myfilename.sol
I know it is possible to write the solution via interactive shell, but I am trying to automate the test in order to retrieve both solution and obj value. Any help or clarification will be much appreciated!
You are getting an error because with the syntax you are using, you try to invoke a bash command called "write" because of the semicolon:
The write utility allows you to communicate with other users, by
copying lines from your terminal to theirs.
Just try without semicolon ;)
The cleaner solution would be to modify the file "check/configuration_tmpfile_setup_scip.sh"
and add the line
echo write solution /absolute/path/to/solutions/${INSTANCE}.sol >> $TMPFILE
before the quit command. This configuration file sets up a batch file to feed SCIP with all commands that the interactive shell should execute, and you can model arbitrary user behavior.

Zsh trouble when using echo with color/formatting characters

I'm just switch to zsh and now adapting the alias in which was printing some text (in color) along with a command.
I have been trying to use the $fg array var, but there is a side effect, all the command is printed before being executed.
The same occur if i'm just testing a echo with a color code in the terminal:
echo $fg_bold[blue] "test"
]2;echo "test" test #the test is in the right color
Why the command print itself before to do what it's supposed to do ? (I precise this doesn't happen when just printing whithout any wariable command)
Have I to set a specific option to zsh, use echo with a special parameter to get ride of that?
Execute the command first (keep its output somewhere), and then issue echo. The easiest way I can think of doing that would be:
echo $fg[red] `ls`
Edit: Ok, so your trouble is some trash before the actual output of echo. You have some funny configuration that is causing you trouble.
What to do (other than inspecting your configuration):
start a shell with zsh -f (it will skip any configuration), and then re-try the echo command: autoload colors; colors; echo $fg_bold[red] foo (this should show you that the problem is in your configuration).
Most likely your configuration defines a precmd function that gets executed before every command (which is failing in some way). Try which precmd. If that is not defined, try echo $precmd_functions (precmd_functions is an array of functions that get executed before every command). Knowing which is the code being executed would help you search for it in your configuration (which I assume you just took from someone else).
If I had to guess, I'd say you are using oh-my-zsh without knowing exactly what you turned on (which is an endless source of troubles like this).
I don't replicate your issue, which I think indicates that it's either an option (that I've set), or it's a zsh version issue:
$ echo $fg_bold[red] test
test
Because I can't replicate it, I'm sure there's an option to stop it happening for you. I do not know what that option is (I'm using heavily modified oh-my-zsh, and still haven't finished learning what all the zsh options do or are).
My suggestions:
You could try using print:
$ print $fg_bold[red] test
test
The print builtin has many more options than echo (see man zshbuiltins).
You should also:
Check what version zsh you're using.
Check what options (setopt) are enabled.
Check your ~/.zshrc (and other loaded files) to see what, if any, options and functions are being run.
This question may suggest checking what TERM you're using, but reading your question it sounds like you're only seeing this behaviour (echoing of the command after entry) when you're using aliases...?