robotframework-SikuliLibrary icon indicating copy to clipboard operation
robotframework-SikuliLibrary copied to clipboard

[WinError 10061] No connection could be made because the target machine actively refused it

Open gigi199596 opened this issue 6 years ago • 6 comments

Hello,

With all my tests I have a .bat script that calls robot: SET "LST_PATH=%HOMEDRIVE%\Program Files (x86)\Atlas Copco\LinuxSupportTool 2.0.0.8\LinuxSupportTool.exe" robot --include open_close LST2.0.0.0/

And in my code I call:

*** Settings ***
Documentation     LinuxSupportTool test simple open close.
Library           SikuliLibrary
Resource          ${CURDIR}/resources/shared_var.resource

*** Variables ***
${IMAGE_DIR}      ${CURDIR}\\img

*** Test Cases ***
LST Open Close
    [Documentation]    Open close LST.
    [Tags]             LST    not_ready   open_close
    Start App
    Close App

*** Keywords ***
Start App
    Run Keyword If      ${INDIVIDUAL_TESTING} == ${FALSE}    Return From Keyword
    Open Application    %{LST_PATH}
    Sleep               ${APP_LOADING_TIME}

Close App
    Run Keyword If       ${INDIVIDUAL_TESTING} == ${FALSE}    Return From Keyword
    Close Application    ${APP_EXE_NAME}

INDIVIDUAL_TESTING is set to true. I get: connection_broken

What could be the reason for that problem? Thanks a lot for your help :)

gigi199596 avatar Mar 13 '19 10:03 gigi199596

@gigi199596 , could you attach sikuli log here, the console output of java process is stored in log files(not Robot Framework log).

rainmanwy avatar Mar 15 '19 01:03 rainmanwy

Hello @rainmanwy,

Solution for this was to use Process library in my script with:

*** Settings ***
...
Library           Process
...
*** Variables ***
${APP_LOADING_TIME}    5s
#Kill app to close it. If not it takes a while...
${DO_KILL}             ${TRUE}

*** Keywords ***
Start App
    Run Keyword If      ${INDIVIDUAL_TESTING} == ${FALSE}    Return From Keyword
    ${lst_process_handle}=    Start Process    %{LST_PATH}
    Set Global Variable       ${lst_process_handle}
    Sleep               ${APP_LOADING_TIME}

Close App
    Run Keyword If       ${INDIVIDUAL_TESTING} == ${FALSE}    Return From Keyword
    Terminate Process    ${lst_process_handle}    kill=${DO_KILL}

I have this file: Sikuli_java_stdout_1552639191.2049863.txt And the Sikuli_java_stderr_1552639191.2049863.txt is empty...

gigi199596 avatar Mar 15 '19 08:03 gigi199596

I have the same problem.

PauloGoncalvesBH avatar Mar 21 '19 19:03 PauloGoncalvesBH

@gigi199596 , @PauloGoncalvesBH, so this problem only related with "App" related keywords? Or whole library do not work?

rainmanwy avatar Mar 27 '19 06:03 rainmanwy

@gigi199596 , @PauloGoncalvesBH, so this problem only related with "App" related keywords? Or whole library do not work?

Only Open Application and Close Application. Not the whole library 😹 Btw @rainmanwy have a look at my PR 😀

gigi199596 avatar Mar 27 '19 08:03 gigi199596

@gigi199596 , @PauloGoncalvesBH, so this problem only related with "App" related keywords? Or whole library do not work?

With me is occurring with the whole library. The first Sikuli method in my tests is Screen Should Contain.

PauloGoncalvesBH avatar Mar 29 '19 14:03 PauloGoncalvesBH