HP LoadRunner (wlrun) exit with status 1
Question ID: 107294
0
0

I am trying to run HP LoadRunner (wlrun.exe) command from Java Program and check the status at the exit of wlrun.exe command.

Sample Java Code:

public class LRTest
{
private static int exitValue = -1;
private class WlRunExecution extends Thread
{
Process p;
String command = new String();

public WlRunExecution(String command)
{
this.command = command;
}

public void run()
{
LRTest.exitValue = -1;
try
{
this.p = Runtime.getRuntime().exec(this.command);
while (IsLoadRunnerRunning())
{
Thread.sleep(1000L);
}
}
catch (Exception e)
{
System.out.println(e);
}
}

public boolean IsLoadRunnerRunning()
{
boolean IsLoadRunnerRunning = false;
try
{
LRTest.exitValue = this.p.exitValue();
}
catch (IllegalThreadStateException e)
{
IsLoadRunnerRunning = true;
}
return IsLoadRunnerRunning;
}
}

public static void main(String[] arg)
{
LRTest test = new LRTest();
test.runTest();
}

public void runTest()
{
WlRunExecution process = null;
String command = "\\"C:\\\\Program Files (x86)\\\\HP\\\\LoadRunner\\\\bin\\\\Wlrun.exe\\" -Run -TestPath \\"C:\\\\Test\\\\LoadRunner\\\\TestBing\\\\ScenarioBing.lrs\\" -ResultName \\"C:\\\\Test\\\\LoadRunner\\\\TestBing\\\\LRResult\\"";
//String command = "\\"C:\\\\Program Files (x86)\\\\HP\\\\LoadRunner\\\\bin\\\\Wlrun.exe\\"";
try
{
process = new WlRunExecution(command);
Thread t = new Thread(process);
t.start();
t.join();
System.out.println("Process Exit code : " + exitValue);
}
catch (Exception e)
{
System.out.println(e.getMessage() + e);
}
}
}

On running the program, **Process Exit Code is always 1** which means wlrun process is exited with some error. Even if I run "wlrun" without any argument and manually close the LoadRunner Controller after launch, still process exit code is 1. If I replace "wlrun.exe" with any other command (notepad,exe or AnalysisUI.exe or VuGen.exe) then Process Exit Code is 0.

On debugging, I observed following error in Application Event Logs (Control Panel -> Administrator Tools -> Computer Management -> Event Viewer -> Windows Logs -> Application). Everytime I run HP LoadRunner Controller, this warning is logged in application event log.

> **HP.LT.Logger configuration failed creating context provider of the type:
> HP.PC.Security.SSO.AppContextLoggingProvider,
> HP.PC.Security.SSO**

Please help.

Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on December 6, 2016 10:28 am
192 views
Answers (2)
1
Private answer

Hello Itsvikasjindal ,

The Controller (wlrun.exe) standard exit code is 1. I recommend you try adding an if statement to the end of your code

If exit code = 1 then change it = 0

Additional be sure at you turn off (exit) the controller program completely before running again as you can only run One(1) instance of wlrun.exe at a time on any one machine. It can take 1-10 minutes to exits, after the exit program (shut down) command is given.

Marked as spam
Posted by (Questions: 12, Answers: 384)
Answered on December 13, 2016 4:01 pm
0
Private answer

Thanks @DavidMofOSI

Marked as spam
Posted by (Questions: 1, Answers: 1)
Answered on December 14, 2016 2:35 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top