rainmanwy / robotframework-SikuliLibrary

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

FAIL : AttributeError: 'NoneType' object has no attribute 'run_keyword' in windows XP #124

Open wuzw-91 opened 4 years ago

wuzw-91 commented 4 years ago

Dear Wang Yang,

I use robotframework + sikulilibrary for the first time,I encountered a problem When I use the keywords of sikulilibrary, I get the following error: Starting test: Test.Run-Sikulilibrary-Keyword.double click 20200326 15:37:38.609 : FAIL : AttributeError: 'NoneType' object has no attribute 'run_keyword' 20200326 15:37:38.609 : DEBUG : Traceback (most recent call last): File "E:\Python2.7.17\lib\site-packages\SikuliLibrary\sikuli.py", line 255, in run_keyword return self.remote.run_keyword(name, arguments, None) Ending test: Test.Run-Sikulilibrary-Keyword.double click

please help me

EV: Windows XP Professional x86

python -m pip List Package Version


numpy 1.16.6 Pillow 6.2.2 pip 20.0.2 Pygments 2.5.2 PyPubSub 3.3.0 pywin32 227 robotframework 3.1.2 robotframework-ride 1.7.4.1 robotframework-seleniumlibrary 4.3.0 robotframework-SikuliLibrary 1.0.8 selenium 3.141.0 setuptools 41.2.0 six 1.14.0 urllib3 1.25.8 wxPython 4.0.7.post2

wuzw-91 commented 4 years ago

Python version is 2.7.17

Two months ago, this problem also existed on windows 10 using Python3 version.

rainmanwy commented 4 years ago

@wuzw-91 , you may have a try this method

younesselq commented 1 year ago

Hi Mr wang , I'm facing the same problem , I want to test my application with robot Framework and Sikuli on docker . Her is my Dockerfile: " FROM python:3.8-slim-buster

Update packages and install dependencies

RUN apt-get update && apt-get install -y \ wget \ openjdk-11-jre-headless \ && rm -rf /var/lib/apt/lists/*

Install Robot Framework and Sikuli library

RUN pip install robotframework RUN pip install robotframework-SikuliLibrary

Download and install SikuliX

RUN wget https://launchpad.net/sikuli/sikulix/2.0.4/+download/sikulixide-2.0.4.jar -O /root/sikulix.jar

Set environment variables for SikuliX

ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64/ ENV SIKULIX_HOME /root ENV SIKULIX_JAR /root/sikulix.jar

Copy test files into the container

COPY . /tests

Set working directory

WORKDIR /tests

Execute tests with Robot Framework

CMD ["robot", "--outputdir", "results", "test.robot"] "


and here is my test script : " Settings Documentation Test d'IHM par sikuli et robot framework Library SikuliLibrary port=4119 timeout=3.0 mode=REMOTE Library Process Library OperatingSystem Suite Setup Start Sikuli Process
Suite Teardown Run Keywords Close Application ${APP_PATH} AND Stop Remote Server

Variables ${IMAGES_PATH} //tests/SikuliImages ${APP_PATH} //tests/FHF_App.exe

Test Cases Open IHM Open IHM Application Read Images Read Images From Path Navigate IHM Application Buttons Navigate Buttons Keywords Start Sikuli Process ${port}= Set Environment Variable SIKULI_SERVER_PORT 4119 # Port souhaité, par exemple 4119 Run java -jar sikulix.jar -p ${port}
Sleep 3s # Attendre que le processus Sikuli démarre Read Images From Path Add Image Path ${IMAGES_PATH} Open IHM Application Open Application ${APP_PATH} Navigate Buttons

Wait Until Screen Contain     pauseButtonPull.png   timeout=30
Click    pauseButtonPull.png
Wait Until Screen Contain     pausePanel.png    timeout=40 

Click    pauseButtonDown.png
Click    PexpButtonPull.png
Wait Until Screen Contain    PexpPanel.png    timeout=10
Click    PexpButtonDown.png" 

When i run the test i got the following error : "

Test :: Test d'IHM par sikuli et robot framework

Open IHM | FAIL | AttributeError: 'NoneType' object has no attribute 'run_keyword'

Read Images | FAIL | AttributeError: 'NoneType' object has no attribute 'run_keyword'

Navigate IHM Application Buttons | FAIL | AttributeError: 'NoneType' object has no attribute 'run_keyword'

Test :: Test d'IHM par sikuli et robot framework | FAIL | Suite teardown failed: Several failures occurred:

1) AttributeError: 'NoneType' object has no attribute 'run_keyword'

2) AttributeError: 'NoneType' object has no attribute 'run_keyword'

3 tests, 0 passed, 3 failed"

Can help me with that please ?