Communication Exception – Error in connecting to leanft runtime engine
Category:
Question ID: 109957
1
0

Hi Friends,

I am new to leanft. i just installed UFT along with leanft plugin. when i try to start the leanft engine thru code

it says ” Communication Exception – Error in connecting to leanft runtime engine”.

 when i double click the LFTruntime.exe in this path  C:\Pgmfiles(x86)\HP\bin, leanft icon is shown in the system tray which means leanft engine is started….  after that when i run the code, it says “Communication Exception – Error in connecting to leanft runtime engine”.

 

Kindly help me how to start the leanft engine thru JAVA code by using leanft API

Marked as spam
Posted by (Questions: 2, Answers: 2)
Asked on November 7, 2020 10:44 am
812 views
Answers (2)
1
Private answer

Can you please clarify what you mean by you "try to start the leanft engine thru code"? What code are you using to try to start LeanFT (UFT Developer)? Please provide a sample. See this link for Instructions to start LeanFT Runtime Engine.

Also, make sure port 5095 is open. UFT Developer needs this port open to work properly. You can see information on the port at this link.

Marked as spam
Posted by (Questions: 17, Answers: 807)
Answered on November 9, 2020 6:49 pm
0
Private answer

I tried to launch Internet explorer  by using the below program.

package edu.aspire.test;

import java.io.File;
import java.net.InetAddress;
import java.net.URI;
import com.hp.lft.report.Reporter;
import com.hp.lft.sdk.ModifiableSDKConfiguration;
import com.hp.lft.sdk.SDK;
import com.hp.lft.sdk.web.Browser;
import com.hp.lft.sdk.web.Browser.BrowserFacotry;
import com.hp.lft.sdk.web.Browser.BrowserType;

public class IElaunchTest {
static Browser browser=null;
public static void main(String args[])
{
InetAddress idAddr=InetAddress.getLocalHost();
Runtime.getRuntime().exec("C:\Pgmfiles(x86)\HP\unified functional Testing\bin\LFTRuntime.exe",null
,new File("C:\ProgramFiles(x86)\HP\Unified Functional Testing\bin\"));
Thread.sleep(1000);
ModifiableSDKConfiguration config=new ModifiableSDKConfiguration();
config.setServerAddress (new URI("ws://"+idAddr.getHostAddress()+":5095"));
Thread.sleep(500);
SDK.init(config);
Reporter.init();
browser=BrowserFactory.launch(BrowserType.INTERNET.EXPLORER);
System.out.println("IE is launched");

}

}

==========

Softwares I have in my PC: UFT along with leanft plugin( version 12.54.2159), Windows, JAVA 8 , eclipse Mars 2 release (4.5.2)

When i run the above program i am gettng below error

com.hp.lft.sdk.internal.communication.CommunicationException.

Error in connecting to leanft runtime engine on ws:<ipaddress>:5095 at com.hp.lft.sdk.internal.communication.DefultSockerConnection.connect(DefaultSocketConnection.java:72)

 

Marked as spam
Posted by (Questions: 2, Answers: 2)
Answered on December 4, 2020 1:12 am
0
Also when i run the above program. Leanft engine is started in system tray. but IE is not launched and getting communicationException.
( at December 4, 2020 1:14 am)
EyeOnTesting

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

X
Scroll to Top