Forum Discussion

praveenskg's avatar
praveenskg
Contributor
2 months ago

Session Creator commandline arguments goes lenghty

In my current setup to execute tests from CICD on dedicated VDi machine, we are using session creator utility. I am able to run it using powershell command. However when it comes to maintenance the command line to trigger session creator utility with all the arguments it becomes very lengthy and i don't have success in concatenating all the arguments into one and use it in command line. 

& $TC_SessionCreatorPath RunTest /UserName:$TestAccountUser /Password:$TestAccountPassword /UseActiveSession /ScreenResolution:$TC_ScreenResolution /ProjectPath:$TC_ProjectPath /p:$TC_ProjectName /tags:$Tags /arg:/pv:browser=$TC_Browser  /arg:/pv:update_zephyr=$Zephyr_flag /arg:/pv:zephyrscale_token=$Zephyr_Token /AccessKey:$AccessKey

there are still lot more arguments i need to include in the commadline. My ask is how do i put all the arguments into a variable and pass the variable in the command line after 'RunTest'

3 Replies

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Wouldn't your variable then become lengthy!? 

    What other arguments do you need to add?

  • i am ok with variable being lengthy, we have to check the flag(True/false) and accordingly i will either include more arguments or wont include those arguments. If it is in variable i can add those arguments or dont add and finally use that variable in command line after Run test. 

    Other arguments are Jira integration, Jira project key, Jira_token, Confluence pageid and token and etc

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    I still don't quite understand the purpose. However, why not create a batch file or PowerShell script file that has all the required parameters and variables, which you can modify. You can also have variables defined in your CI/CD too.

    It's possible to merge all of these,

    /arg:/pv:browser=$TC_Browser 
    /arg:/pv:update_zephyr=$Zephyr_flag
    /arg:/pv:zephyrscale_token=$Zephyr_Token

    into one variable, but you will then require a function to split this into individual sections.

    Either way, it's going to be lengthy.