Passing a variable in codeception through command prompt - codeception

As like we pass the browser name and other details from command prompt in codecetion, can we pass any variable which can be used within the script from command prompt?

I didn't find any way to do it in documentation and other feeds.
I add pull request for this ability use params from console in tests
When it will be merged in master you can run tests like this:
php codecept run -p "site-id: 123456, group: admin" -p "duty: free"
You can find more information in PR.

Related

Is there any way to customize the JMeter report?

I have my JMeter scripts (.jmx) ready to run a performance test.
The script works fine and the HTML reports are generated, but the report does NOT have any information on which environment(ST/ET/QA) the tests was run against .
Is there any way to add environment/custom information to the report?
Command:
Jmeter -n -t -Jenv="ST" test.jmx -l output.jtl -e -o Dashboard
test.jmx = script which is auto-generated
output.jtl = user defined file for output
Dashboard = user defined directory to store HTML dashboards
I believe you're looking for the jmeter.reportgenerator.report_title property so if you run the report generation as:
Jmeter -n -t -Jenv="ST" -Jjmeter.reportgenerator.report_title=ST -l output.jtl -e -o Dashboard
More information:
Overriding Properties Via The Command Line
Apache JMeter Properties Customization Guide
#Dmitri T shared the right link. One thing I want to add that you can choose what info to write to the logs through the Results tree settings. See the screenshot
here

How to Use Command Line Parameters by using JMeter?

I'm using Jmeter for testing APIs and I want to parametrize the project's path from the terminal and then I want to use this parameter in JMeter. I set testurl = test.com in basic terminal and i want to get this url by using testurl. The parameter that I've sent via Command Line : ./jmeter -n -t your_script.jmx -l -Jurl=$testurl in homebrew terminal. The parameter that I've used in httpsRequest --> Server name or IP; ${__P(url)}. But when I run my automation in the homebrew terminal, my test scripts are not going to URL that's been defined. Please help me!! Thanks.
From first impression it seems what you are trying should work, but devil is in the detail. I would suggest you try:
Verify if the environment variable is set correctly use export testurl=test.com (removed spaces). Try verify using echo $testurl
Try debug sampler which should help you verify if JMeter is picking up the var correctly: https://www.blazemeter.com/blog/how-debug-your-apache-jmeter-script/
Hope this helps.

SSH command step not working for one command - in Jmeter

I have a unique problem using jmeter SSH command.
I use this step to run spark jobs.
the problem is that one of the commands not working, to clarify it connects and not get response and just wait and wait for hours, and nothing displayed on screen.
I know how to work with the tool, and this behavior is special for this script alone.
All other script worked, I duplicate one that worked for example
sudo /run_stg.sh this command worked
sudo /run_off2-stg.sh this command not worked
if I run the job manually via jenkins it worked
if I entered to command line and use plik ssh it worked,
the problem is just Jmeter, that is waiting and waiting and I can not understand for what?
the job is about 3 minutes, and I wait for response in Jmeter for 4 hours and nothing Jmeter just waiting.
in the console log I set to trace level and nothing, absolutely no idea how to start handle this issue in Jmeter.
an anyone please assists how to make Jmeter to write what happened?
or just to know if he connect or anything
since this behavior all the test can not be performed
Most probably you are as usual misconfiguring the SSH Command sampler.
The idea is not to run the script per se, you need to delegate the script execution to the Unix Shell, for example Bash this way you will be able to combine several commands together, see the output, amend debugging level, etc.
So I would recommend setting your command to something like /bin/bash -c -x /your/script.sh
Another guess, given you use sudo it might be the case that the sudo command simply waits for the password (which JMeter never provides), if this is the case try amending your script permissions using chmod command and allowing your user its execution without root privileges.
And finally, given you're able to run your command using "plik ssh" (whatever it is) you can run it using OS Process Sampler
More information: How to Run External Commands and Programs Locally and Remotely from JMeter

How to run a shell script on another server from kettle job at one server?

Using Pentaho, I want to execute a shell script lying on another server in Kettle Job (.kjb) file using "Execute a Shell script" component. I was successful to run the script locally by giving script file name in that component. But I am not getting how to run a remote script.
Here is how my simple kjb looks like:
Any ideas?
that is pretty straightforward using the shell step from a pentaho job:
1) on General tab check "insert script"
2) on Script tab now you are able to add this inline script:
ssh user#remotemachine 'ls -l'
this will execute ls -l on the remote server via ssh
make sure the ssh user is allowed to login with ssh keys, not asking for password.

How to pass argument to another jenkins build step

In Jenkins job i need to execute shell on jenkins machine. I use Execute shell step from there i get value, which have to be used in another step Execute shell script on remote host using ssh. I can't find way to pass that value...
Here is my jenkins job configuration:
I appreciate any help.
Content of the file which constains the script:
echo "VERSION=`/data/...`"> env.properties
Path of the properties file:
env.properties
In shell script using ssh:
echo"... $VERSION"
Something like this works for the build, maybe here works too.