Is there way to find if the test is invoked from command line or from UI
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2021
11:24 PM
06-24-2021
11:24 PM
Is there way to find if the test is invoked from command line or from UI
Hello,
Trying a different solution in relation to the following thread
Here, using Load Script at Project level.
Reading some arguments from java system properties in the solution.
def setArugmentsFromCommandLine = { arguments.keySet().each { arguments[it] = System.properties[it] } }
This is OK if test are executed from command line.
But for those using UI, there is problem as users neither they invoke the UI tool with system arguments, nor they set values for these properties.
In order to handle the case, need to know in the script of Load Script whether tests invoked from UI or not. So, it can be handled conditionally.
Any help is appreciated!
Regards,
Rao.
Labels:
- Labels:
-
Scripting
1 REPLY 1
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2021
02:01 AM
06-25-2021
02:01 AM
It is easy to pass the java system properties for some one who is executing from command line. So thought of the solution in this line.
Even though one can identify if it is run from command line or not in the Load Script, there is no elegant way for the user in UI mode to set the java system properties unless one is hands on the scripting / coding and to the solution i was trying.
Used project properties approach, so that UI users can set the values for project properties easily and command line users as well.
But still the answer to this question is interesting to me.
Regards,
Rao.
Even though one can identify if it is run from command line or not in the Load Script, there is no elegant way for the user in UI mode to set the java system properties unless one is hands on the scripting / coding and to the solution i was trying.
Used project properties approach, so that UI users can set the values for project properties easily and command line users as well.
But still the answer to this question is interesting to me.
Regards,
Rao.
