Contributions
Re: Project Load Script executed before the command line arguments are used.
In another post I raised, a better solution was provided. https://community.smartbear.com/t5/SoapUI-Open-Source/can-I-know-in-the-project-load-Script-if-the-soapUI-project/m-p/179221#M28347 In short, the project properites are set from the command line after project load scirpt is executed. But the system properties are set before. So they can be used. testrunner.bas <options to execute the project> -DIS_INVOKED_COMMANDLINE=true if ('true' == System.getProperty('IS_INVOKED_COMMANDLINE')) { //You business logic here }2.1KViews0likes0CommentsRe: can I know in the project load Script if the soapUI project executed from from command line
Thanks, this seems to work and this properties are set before the project once. One more thing. As I`m calling extenal jar from the project load script and passing both possible variablse in this context which are project and log. Is it possible to get the system properties from the project object?2KViews0likes1CommentRe: can I know in the project load Script if the soapUI project executed from from command line
What do you mean by jvm arguments? I know that if I pass project level properties to be set from the command line, they are initiated after the project script is executed. Can you please share an example so I can test if this behaves diffrently. I would assume that there is some indication who is executin the project without something spesific, but seems that this is not the case.2KViews0likes3Commentscan I know in the project load Script if the soapUI project executed from from command line
I would like to control the flow in project load script and do something only if its executed from the command line. Is there anything on the Project varible that I have in this context that can indicate how the project was triggered.Solved2KViews0likes5CommentsProject Load Script executed before the command line arguments are used.
Hi I`m using the option to execute the soapUI project from command line and using the P argument to pass project level properites. <Quote> P: Specifies a value of a project property for the test run. The specified value will override the variable's value during the run. Usage: -P<variable>=<value>. If the value includes spaces, enclose the entire argument in quotes. To override several variable values, specify the -P argument several times. <EndQuote> In the Project Load Script I want to load project level properties from previously saved property file using the ENV_NAME property which is passed in the command line arguments. The problem that I`ve encountered is that the Project Load Script is executed before the argument from the command line is used to set the ENV_NAME property. As a work around I have added a new testSuite which will run the script instead of the Project Script. But this seems patchy and also reflects in the test report. Can someone explain the logic why to run the Project Load Script before the command line arguments were used? Is there some other way to pass an argument to the project which can be used in the Project Load Script?Solved2.7KViews0likes4CommentsRe: Use the calling step name in the called test case
After more digging around I found the solution. In the called test case you can the calling step name, or the test case name with this code: if(context.hasProperty("#CallingRunTestCaseStep#")){ log.info context.getProperty("#CallingRunTestCaseStep#").getLabel(); log.info context.getProperty("#CallingRunTestCaseStep#").getTestCase().getLabel(); } Using this params the trace will be much more readble865Views0likes0CommentsUse the calling step name in the called test case
Hi I`m new to this forum Have been using soapUI for several months. I have created a generic project where all the test cases are being used as functions, and with them the user can create almost any functional test just using call to test, and without the need to write any code (sort of frameWork for writing tests for our product, where the main goal is reuse and redability) In wach called test case I try to write to the log as much as possible for easy debuging. What I wanted to add to all the called test cases is to write the testCase name which called them. But if I`m using "log.info testRunner.testCase.getName()" It writes the called test case name and not the calling. I`ve looked in the API`s and could not find nothing on how to refrence to the calling test case object. Thanks in advance.1.5KViews0likes1Comment