Page 1 of 1

How to pass multiple values for a single argument when running tests from command line

Posted: Wed Oct 03, 2018 3:06 pm
by ziasim
Hi,

I am trying to run scripts on remote machine using PSEXEC along with passing some arguments. I can successfully pass one value for each argument like /rc:Test1 or /pa:Server_Machine_Name=TestMachine and tests are running OK.

But, I want to send multiple values for a specific type of argument like I would like to send multiple values to set my multiple global parameters. I tried like this

/pa: Server_Machine_Name=TestMachine SQL_UserName=sa (only picks first value, ignores second value)

or

/pa: Server_Machine_Name=TestMachine, SQL_UserName=sa (error occurred)

or

/pa: Server_Machine_Name=TestMachine /pa:SQL_UserName=sa (only picks second value, ignores first parameter)

Nothing is working yet.

Is there a way to pass multiple values for a single argument type while running tests from command line/PSEXEC???

Note- I am running PSEXEC within windows batch command on Jenkins.

Thanks in advance???

Re: How to pass multiple values for a single argument when running tests from command line

Posted: Wed Oct 03, 2018 3:24 pm
by odklizec
Hi,

Since you are using Jenkins, why are you using psexec? The best and most reliable way to run tests on remote machine, is to setup Jenkins slave on target test machine and then simply use Ranorex own Jenkins plugin or Jenkins batch command run step.

BTW, please post complete psexec command you are using.

Re: How to pass multiple values for a single argument when running tests from command line

Posted: Wed Oct 03, 2018 3:49 pm
by ziasim
Since you are using Jenkins, why are you using psexec?
Our setup is like we have Jenkins master/slave setup. We want to use slave to build ranorex test solution after that we will be pushing AUT and RTS(ranorex test solution) to some remote machine to start script execution. That's the reason I am using PSEXEC to start execution on remote VM. We are NOT running tests on Jenkins slave machine.

BTW, please post complete psexec command you are using.
Here is the command I am using to send multiple values for a specific argument

C:\Windows\SysWOW64\PSTools\psexec.exe -i 1 -w \\%NewVMComputerName%\C$\Users\Administrator\Desktop\Ranorex\Debug \\%NewVMComputerName% -u %NewVMComputerName%\Administrator -p <password> -accepteula "C:\Users\Administrator\Desktop\Ranorex\Debug\%BuildProjectName%.exe" /rc:ServerInstallation /rc:ConsoleInstallation /pa:SQL_UserName=sa /pa:To=%BUILD_USER_EMAIL%

Re: How to pass multiple values for a single argument when running tests from command line

Posted: Thu Oct 04, 2018 8:15 am
by Stub
I too use this format for passing multiple parameters to the Ranorex test executable via the command-line:

Code: Select all

/pa: Server_Machine_Name=TestMachine /pa:SQL_UserName=sa
I don't use PSExec, my command-line call is baked into MSBuild. I do put double quotes around my parameter values when they include spaces, though that isn't relevant here given your examples. But perhaps you need the double quotes around the email address component in your latter example?

Re: How to pass multiple values for a single argument when running tests from command line

Posted: Thu Oct 04, 2018 8:21 am
by odklizec
Hi,

Agree with Stub. This way of passing multiple parameters in command line should work just fine. I'm using it too, just not via psexec. And while it should not make a difference, I too would eliminate the space after pa: ;)

Re: How to pass multiple values for a single argument when running tests from command line

Posted: Thu Oct 04, 2018 8:23 am
by Stub
I also noticed the space after I code-d the example above, Pavel, but I think that's probably just a typo from the earlier examples since it's not present in the actual data shown in the subsequent update post. That email address variable looks more suspect to me now.

Re: How to pass multiple values for a single argument when running tests from command line

Posted: Thu Oct 04, 2018 11:21 am
by odklizec
BTW, I still think that starting the test suite via psexec (or another form of remoting) is not as reliable and in fact redundant, in case there is already configured Jenkins? I'm too using certain machines for build and another for tests, but everything is handled from Jenkins jobs. First (build) job simply builds the test on one machine, then in case of successful build, it starts second (test) job, which copies the build artifacts from first machine and starts the test on second machine. All is handled with Jenkins jobs and works quite good. Psexec just adds another level of complexity and possible source of problems so why to bother with it? ;)

Re: How to pass multiple values for a single argument when running tests from command line

Posted: Thu Oct 04, 2018 12:05 pm
by ziasim
After putting parameter values in double quotes and making sure that no space is present after pa:, it is working now.

Just for info, I also tried sending multiple values to one global parameter as part of this testing like /pa:To="%BUILD_USER_EMAIL%, [email protected]" which also worked. I need this thing as I want to send emails to multiple persons using Email module of Ranorex Helper.

Thanks Pavel and Stub for your help :)