Highlighted
Absent Member.
Absent Member.
462 views

HP LoadRunner (wlrun) always exit with status 1

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 in resolving this issue.

0 Likes
1 Reply
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: HP LoadRunner (wlrun) always exit with status 1

Hi,

I doubled check it and it seems like wlrun.exe standard exit code is 1. You can simply ignore it.

The error that appears in the event log is not related and does not have a negative impact on the functionality

Regards,

Shlomi

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.