Sikuli keeps getting an error - robotframework

Sorry im a total noob with this. So ive tried integrating Sikuli in my Working RF setup meaning, I have to move from Python to Jython for this to work. my problem now is that im always getting an error.
Error in file 'C:\robot\suites\Test\Test.robot':
Importing test library 'Selenium2Library' failed: ImportError: No module named decorator
Traceback (most recent call last):
File "C:\jython2.7.0\Lib\site-packages\Selenium2Library\__init__.py", line 2, in <module>
from keywords import *
File "C:\jython2.7.0\Lib\site-packages\Selenium2Library\keywords\__init__.py", line 1, in <module>
from _logging import _LoggingKeywords
File "C:\jython2.7.0\Lib\site-packages\Selenium2Library\keywords\_logging.py", line 4, in <module>
from keywordgroup import KeywordGroup
File "C:\jython2.7.0\Lib\site-packages\Selenium2Library\keywords\keywordgroup.py", line 4, in <module>
from decorator import decorator
File "C:\jython2.7.0\Lib\site-packages\Selenium2Library\keywords\keywordgroup.py", line 4, in <module>
from decorator import decorator
PYTHONPATH:
C:\jython2.7.0\bin\jythonsikuli.bat
C:\jython2.7.0\Lib
__classpath__
__pyclasspath__/
C:\jython2.7.0\Lib\site-packages
CLASSPATH:
C:\jython2.7.0\jython.jar
C:\Sikuli\sikulix.jar
20180308 11:23:08.246 ERROR Error in file 'C:\robot\suites\Test\Test.robot':
Getting keyword names from library 'Remote' failed: Calling dynamic method
'get_keyword_names' failed: Connecting remote server at http://localhost:8270 failed:
[Errno 10061] Connection refused

In your error message there are two issues clearly defined:
Importing test library 'Selenium2Library' failed: ImportError: No module named decorator
Which can be solved by installing the relevant Python Module from PIP:
pip install decorator
The second issue is towards the end:
Connecting remote server at http://localhost:8270 failed:
[Errno 10061] Connection refused
This means that Robot Framework is unable to make a connection on port 8720. This is often due to:
Firewalls preventing an opened port to be accessible. In Windows add a FireWall rule allowing for port 8270 to be accessible from the outside.
Try and connect using http://127.0.0.1:8270. Although often a synonym for localhost at a technical level it is not the same.

Related

Form recogniser - Setup Issues

For the Form recognizer sample code provided in the below link, the Python interpreter cannot recognize Azure core API’s.
link
python —version
-Python 3.9.1
pip3 —version
- ip 21.0 from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip (python 3.9)
I receive the following error:
Exception has occurred: ModuleNotFoundError
No module named 'azure'
File "/Users/visiothoughts/Documents/Visiothoughts/Work-Project/AI-Moto/com/ai/Bill-Recogniser/RecogniseFormContent.py", line 5, in <module>
from azure.core.exceptions import ResourceNotFoundError
Can I get some guidance on what is missing?
Looks like the module for Azure-Core has not been installed.
Run
pip install azure-core
Since the error you re receiving is below :
from azure.core.exceptions import ResourceNotFoundError

Jupyter Notebook only opens on base environment (Python 3.7, Windows 10)

I'm not sure what changed but similarly to this post:
Jupyter notebook only works in base environment
Jupyter notebook only opens when I activate my base environment, ie:
C:\Users\user\activate base
(base) C:\Users\user\jupyter notebook
This happens on powershell, cmd, and cmder. In the default, unspecified environment, I get this error:
C:\Users\user>jupyter notebook
Traceback (most recent call last):
File "C:\Users\user\anaconda3\Scripts\jupyter-notebook-script.py", line 6, in <module>
from notebook.notebookapp import main
File "C:\Users\user\anaconda3\lib\site-packages\notebook\notebookapp.py", line 62, in <module>
from tornado import httpserver
File "C:\Users\user\anaconda3\lib\site-packages\tornado\httpserver.py", line 29, in <module>
import ssl
File "C:\Users\user\anaconda3\lib\ssl.py", line 98, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: DLL load failed: The specified procedure could not be found.
In the default environment, I can call pip commands but I get this error. It seems to be related to my first issue above.
C:\Users\user>pip install
Could not fetch URL https://pypi.org/simple/pip/: There was a problem
confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org',
port=443): Max retries exceeded with url: /simple/pip/ (Caused by
SSLError("Can't connect to HTTPS URL because the SSL module is not
available.")) - skipping

How to install MongoDBLibrary for Robot Framework

I want to connect to Mongo DB using Robot Framework.
I have read in the following link that we have to pull the source code and install the library. Robot FrameWork - MongoDB-Library
I installed the Library and it is installed in the location
D:\Python27\Lib\site-packages\MongoDBLibrary
When I add 'MongoDBLibrary' library in the RIDE it showing in red (means library is not installed properly),
when i ran the same using eclipse + Maven project i got the following error
[ ERROR ] Error in file 'D:\Robot_WorkSpace\robotFrameWork\src\test\robotframework\acceptance\MongoQuery.txt': Importing test library 'D:\Python27\Lib\site-packages\MongoDBLibrary' failed: ImportError: No module named bson
Traceback (most recent call last):
File "D:\Python27\Lib\site-packages\MongoDBLibrary\__init__.py", line 2, in <module>
from mongoquery import MongoQuery
File "D:\Python27\Lib\site-packages\MongoDBLibrary\mongoquery.py", line 2, in <module>
from bson.objectid import ObjectId
PYTHONPATH:
C:\Users\akurasa\.m2\repository\org\robotframework\robotframework\3.0\Lib
C:\Users\akurasa\.m2\repository\org\robotframework\robotframework\3.0\robotframework-3.0.jar\Lib
__classpath__
__pyclasspath__/
CLASSPATH:
/D:/Sarada/eclipse/configuration/org.eclipse.osgi/bundles/789/1/.cp/jars/plexus-classworlds-2.4.jar
Please any one help me where i did wrong
Make sure you have installed PyMongo (or bson):
pip install pymongo
pip install bson (don't know if still required then)

Robot framework, Sikuli hello_world demo script is failing?

I have installed Robot framework 2.8.7 in a solaris server and added sikuli library to it . when tried to run demo script "Hello world" i'm getting the following error.
bash-3.2# pybot /robot/robotframework-SikuliLibrary-master/demo/hello_world/testsuite_sikuli_demo.txt
*[ WARN ] Test get_keyword_names failed! Connecting remote server at http://127.0.0.1:42821/ failed: <Fault 0: 'Failed to invoke method get_keyword_names in class org.robotframework.remoteserver.servlet.ServerMethods: java.lang.RuntimeException'>
[ ERROR ] Error in file '/robot/robotframework-SikuliLibrary-master/demo/hello_world/testsuite_sikuli_demo.txt': Initializing test library 'SikuliLibrary' with no arguments failed: Failed to get_keyword_names!
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/SikuliLibrary/sikuli.py", line 41, in __init__
self.remote = self._connect_remote_library()
File "/usr/lib/python2.7/site-packages/SikuliLibrary/sikuli.py", line 138, in _connect_remote_library
self._test_get_keyword_names(remote)
File "/usr/lib/python2.7/site-packages/SikuliLibrary/sikuli.py", line 155, in _test_get_keyword_names
raise RuntimeError('Failed to get_keyword_names!')*
I have done the same setup on windows machine and it is working fine. Python version used in solaris is 2.6.Can you let me know how to resolve this?
Thanks

Using serial port within monkeyrunner

I'd like to be able to access serial port from within monkeyrunner script. I've got separate python script that talks via rs232 to a device, and I've got a monkeyrunner script that drives an Android smartphone.
Now. After implementing the python script inside my monkeyrunner script and adding a specific path to the python serial module, the script reutrns the following error msg:
121219 10:40:51.630:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] Script terminated due to an exception
121219 10:40:51.630:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions]Traceback (most recent call last):
File "C:\Android\android-sdk\tools\serial_test.py", line 13, in <module>
import serial
File "c:\Python27\Lib\site-packages\serial\__init__.py", line 23, in <module>
from serialjava import *
File "c:\Python27\Lib\site-packages\serial\serialjava.py", line 35, in <module>
comm = detect_java_comm([
File "c:\Python27\Lib\site-packages\serial\serialjava.py", line 29, in detect_java_comm
raise ImportError("No Java Communications API implementation found")
ImportError: No Java Communications API implementation found
serial_test.py:
import sys
sys.path.append("c:\\Python27\\Lib\\site-packages")
import serial
Google pointed to a number of websites :
From: Java Comm API Package download
through : http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-misc-419423.html
to: http://mho.republika.pl/java/comm/
I've dowlnoaded and installed JavaComm from http://code.google.com/p/smslib/downloads/list
I also tried http://rxtx.qbang.org/wiki/index.php/Using_RXTX
But none of the sites actually had library that simply worked. Unless I messed up the installation but I find it hard to believe as it's just a matter of copying the files (apparently). From what I understand the Java Comms API package is now obsolete and not supported any more. There is contradicting info on the official Oracle FAQ. You can download java_comm_api-30u1-linux.zip and inside you'll find readme saying "We do not provide a linux implementation.
So here's the question: how can I use serial port inside monkeyrunner script ? Where can I find a simple example of using serial port in monkeyrunner/jython ?

Resources