Issue
I am unable to import the PerfectoLibrary. I get the following error:
[ ERROR ] Error in file 'C:\Pipelines\obrexternal-testautomation\OBRRobotFramework_Mobile\Resources\common\OBRKeywords_Mobile.robot': Importing test library 'PerfectoLibrary' failed: ImportError: cannot import name 'quote_plus' from 'urllib' (C:\Program Files (x86)\Python37-32\lib\urllib\__init__.py)
Traceback (most recent call last):
File "C:\Program Files (x86)\Python37-32\lib\site-packages\PerfectoLibrary\__init__.py", line 4, in <module>
from PerfectoLibrary.keywords import *
File "C:\Program Files (x86)\Python37-32\lib\site-packages\PerfectoLibrary\keywords\__init__.py", line 5, in <module>
from ._rest_acts import _RestKeywords
File "C:\Program Files (x86)\Python37-32\lib\site-packages\PerfectoLibrary\keywords\_rest_acts.py", line 15, in <module>
from urllib import quote_plus
PYTHONPATH:
C:\Pipelines\obrexternal-testautomation\OBRRobotFramework_Mobile\Resources\common
C:\Pipelines\obrexternal-testautomation\OBRRobotFramework_Mobile\Resources\common C:\Pipelines\obrexternal-testautomation\OBRRobotFramework_Mobile C:\Pipelines\EDO-testautomation\RobotFramework C:\Program Files (x86)\Python37-32\python37.zip C:\Program Files (x86)\Python37-32\DLLs C:\Program Files (x86)\Python37-32\lib C:\Program Files (x86)\Python37-32 C:\Users\hawesc\AppData\Roaming\Python\Python37\site-packages C:\Program Files (x86)\Python37-32\lib\site-packages C:\Program Files (x86)\Python37-32\lib\site-packages\win32 C:\Program Files (x86)\Python37-32\lib\site-packages\win32\lib C:\Program Files (x86)\Python37-32\lib\site-packages\Pythonwin
I am trying to run mobile tests through Perfecto:
*** Settings ***
Documentation WARNING! This is a library File.
Library XML
Library String
Library Collections
Library AppiumLibrary
Library SeleniumLibrary
Library DateTime
Library BuiltIn
Library OperatingSystem
Library PythonLibraries/CustomKeywords.py
Library PerfectoLibrary
Variables PythonLibraries/MainListener.py
Variables PythonLibraries/CustomVariables.py
Variables PythonLibraries/Locators.py
Solution
Because of ImportError: cannot import name 'quote_plus' from 'urllib' I assume you use this:
from urllib import quote_plus
replace that line with this:
from urllib.parse import quote_plus
Works fine on me if it doesnt please comment your python version
Answered By - Cem Koçak
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.