Skip to content

Failed to get_keyword_names! #177

@nouhab

Description

@nouhab

hi Team,
I try to run skuliLibrary framework under a docker file.
The scenarios is as follow:
1.Create a docker file

FROM node:14-alpine

RUN apk update \

  && apk add build-base python3

RUN mkdir /.npm \
  && chmod 777 /.npm

RUN apk add --update  py3-pip
RUN apk add openjdk11
# CHROME
RUN apk --no-cache upgrade && apk add --no-cache chromium chromium-chromedriver
RUN apk add libexif udev

# ROBOT + LIBRARIES
RUN pip3 install robotframework && pip3 install robotframework-selenium2library  && pip3 install robotframework-jsonlibrary && pip3 install robotframework-jsonlibrary &&  pip3 install robotframework-SikuliLibrary

RUN apk update && apk add bash

ENTRYPOINT ["/bin/terraform"]
  1. docker build to build the image
  2. docker run -it -d -P robotfram ==>-P option to forword all ports to the host machine which is a windows machine
  3. docker cp "C:\Users\nboujelben\Downloads\test" sleepy_goodall:/home==>copy the test folder from local to my container
  4. my test file named robot.test and it contains a simple example:
*** Settings ***
Documentation     Sikuli Library Demo
Library           Selenium2Library
Library           SikuliLibrary
Test Setup        Run Keywords      Start Sikuli Process    AND  Initialize all images
Test Teardown     Stop Remote Server



*** Keywords *** 
Initialize all images
    Add Image Path      ${CURDIR}\\img
Login to Browser with download preferences
    [Documentation]   This one is without specifying download location
    
    Open Browser  https://www.docdroid.net/   chrome    #options=add_argument("--no-sandbox");add_argument("--headless");add_argument("--disable-dev-shm-usage")
    Maximize Browser Window
    Click Element   id=select
    SikuliLibrary.Input Text      path.png    ${CURDIR}\\img\\signature.jpeg
    Press Special Key   ENTER
    
*** Test cases  ***
Sikuli tests
    Log ToConsole   ${CURDIR}
    Login to Browser with download preferences

6.docker exec -it 2305c31c6cd7 /bin/sh ==>i connect to my container
7.export DISPLAY=127.0.0.1:10.0 ==>create an env variable named DISPLAY
8. apk add opencv-dev
apk add tesseract-ocr
8. run a test as folow robot test.robot
9. I get this erreur:

  /home/test # robot test.robot
==============================================================================
Test :: Sikuli Library Demo
==============================================================================
[ WARN ] Test get_keyword_names failed! Connecting remote server at http://127.0.0.1:55781/ failed: <Fault 0: 'Failed to invoke method get_keyword_names in class org.robotframework.remoteserver.servlet.ServerMethods: java.lang.RuntimeException'>
[ WARN ] Test get_keyword_names failed! Connecting remote server at http://127.0.0.1:55781/ failed: <Fault 0: 'Failed to invoke method get_keyword_names in class org.robotframework.remoteserver.servlet.ServerMethods: java.lang.RuntimeException'>
Sikuli tests                                                          | FAIL |
Setup failed:
Failed to get_keyword_names!

Also teardown failed:
AttributeError: 'NoneType' object has no attribute 'run_keyword'
------------------------------------------------------------------------------
Test :: Sikuli Library Demo                                           | FAIL |
1 test, 0 passed, 1 failed
==============================================================================
Output:  /home/test/output.xml
Log:     /home/test/log.html
Report:  /home/test/report.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions