Sikuli wrapper for .NET Unable to connect to the remote server



  • I am using a Sikuli wrapper for .NET (Sikuli4Net). Using an embedded jetty server, it exposes the core functionality of Sikuli for use within .NET projects. However, in Visual Studio, when I try to run a WebDriver test script in which I included Sikuli4Net commands, as soon as the first Sikuli4Net command executes, the test fails with the following error message: Test Name: TheBusinessRulesAndProjectsOptionalActionsTest Test FullName: BatteryCorp.Test.UI.IterationChinese.BusinessRulesAndProjectsOptionalActions.TheBusinessRulesAndProjectsOptionalActionsTest Test Source: c:\BCApps\Main\Src\AutomatedTesting_Solution\BatteryCorp.Test.UI\IterationChinese\BusinessRulesAndProjectsOptionalActions.cs : line 51 Test Outcome: Failed Test Duration: 0:00:28.397 Result Message: System.Net.WebException : Unable to connect to the remote server ----> System.Net.Sockets.SocketException : No connection could be made because the target machine actively refused it 127.0.0.1:8080 Result StackTrace: at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context) at System.Net.HttpWebRequest.GetRequestStream() at Sikuli4Net.sikuli_REST.Screen.MakeRequest(String requestURLExtension, String jsonObject) at Sikuli4Net.sikuli_REST.Screen.Find(Pattern pattern, Boolean highlight) at Something.Test.UI.Something2.Something3.TheSomethingTest() in c:\BCApps\Something.cs:line 79 --SocketException at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) Result StandardOutput: --Log for this test run can be found at: C:\BCApps\Something\Sikuli4Net.Client.Logs\log.8182014449 PM.txt-- :::Making Request to Service: http://localhost:8080/sikuli/api/find POST: {"jPattern":{"imagePath":"C:/BCApps/Something/PatternImages/CDrive.png","offset_x":0,"offset_y":0,"similar":0.7},"highlight":false}:::



  • Try following code to start server: APILauncher launcher = new APILauncher(true); launcher.Start();



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2