| || |
Problem in running test using arguments
I have a java file with a constructor which takes a String as a parameter. Using this constructor as OUT for creating a test case for a method. The OUT description is
return new Hierarchy((String)SP.Notepad.get("param"));
While running the test I am using the Option "Run test With Args" and specifying argument string as
-Dparam = "Name"
The test runs but its not using "Name" anywhere in the test. And test fails.
If i run this java program standalone and pass "Name" as
argument it works perfectly.
Let me know the proper usage of this option.
Thanks in advance.
Re: Problem in running test using arguments
I get the same problem (a null pointer exception).
Try -Dparam=Name (no double-quotes)
Unfortunately, it only reads the string in from the '=' sign to the first space, so if you try to
enter a parameter like -Dparam=Abhijit Gharde, it only reads "Abhijit".
Hope this helps.