rainmanwy / robotframework-SikuliLibrary

Sikuli Robot Framework Library provide keywords for Robot Framework to test UI through Sikuli.
Apache License 2.0
144 stars 61 forks source link

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

Open gigi199596 opened 5 years ago

gigi199596 commented 5 years ago

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 :)

rainmanwy commented 5 years ago

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

gigi199596 commented 5 years ago

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...

PauloGoncalvesBH commented 5 years ago

I have the same problem.

rainmanwy commented 5 years ago

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

gigi199596 commented 5 years ago

@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 😀

PauloGoncalvesBH commented 5 years ago

@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.