2017-03-15 110 views
0

我使用導入「ExtendedAppiumLibrary」失敗(機器人框架)

pip install robotframework-extendedappiumlibrary 

下載後下載ExtendedAppiumLibrary,我試圖導入「ExtendedAppiumLibrary」在我的項目,它給我以下錯誤:

C:\Windows\System32>ride.py 
FAILED ExtendedAppiumLibrary Initializing test library 'ExtendedAppiumLibrary' with no arguments failed: ValueError: Invalid time string 'Capture Page Scre 
enshot'. 
Traceback (most recent call last): 
    File "C:\Python27\Lib\site-packages\robotide\lib\robot\running\testlibraries.py", line 184, in _get_instance 
    return libcode(*self.positional_args, **self.named_args) 
    File "C:\Python27\Lib\site-packages\ExtendedAppiumLibrary\__init__.py", line 78, in __init__ 
    AppiumLibrary.__init__(self, run_on_failure) 
    File "C:\Python27\Lib\site-packages\AppiumLibrary\__init__.py", line 99, in __init__ 
    self.set_appium_timeout(timeout) 
    File "<decorator-gen-36>", line 2, in set_appium_timeout 
    File "C:\Python27\Lib\site-packages\AppiumLibrary\keywords\keywordgroup.py", line 15, in _run_on_failure_decorator 
    return method(*args, **kwargs) 
    File "C:\Python27\Lib\site-packages\AppiumLibrary\keywords\_applicationmanagement.py", line 121, in set_appium_timeout 
    self._timeout_in_secs = robot.utils.timestr_to_secs(seconds) 
    File "C:\Python27\Lib\site-packages\robot\utils\robottime.py", line 48, in timestr_to_secs 
    raise ValueError("Invalid time string '%s'." % timestr) 

enter image description here

+0

如何導入它? – Goralight

+0

在導入庫中的RIDE下>名稱「ExtendedAppiumLibrary」 –

+0

根據其GitHub頁面,該庫處於生命週期結束時間超過一年半的時間;也許你會考慮使用官方的appium庫(https://github.com/serhatbolsu/robotframework-appiumlibrary),看看這會解決它嗎?你也會得到我的社區支持。 – Todor

回答

0

第一個暗示是在RF輸入錯誤:

FAILED ExtendedAppiumLibrary Initializing test library 'ExtendedAppiumLibrary' with no arguments failed: ValueError: Invalid time string 'Capture Page Scre enshot'.

讓我們來看看文檔說,關於初始化/導入LIB到RF套裝:在進口 https://github.com/serhatbolsu/robotframework-appiumlibrary/blob/master/docs/AppiumLibrary.html(所以你需要保存在磁盤上的文件並加載它呈現的HTML看到github上不顯示HTML)

部分:

run_on_failure=Capture Page Screenshot ExtendedAppiumLibrary can be imported with optional arguments.

run_on_failure specifies the name of a keyword (from any available libraries) to execute when a ExtendedAppiumLibrary keyword fails. By default

Capture Page Screenshot will be used to take a screenshot of the current page. Using the value No Operation will disable this feature altogether. See

Register Keyword To Run On Failure keyword for more information about this functionality.

example: Library ExtendedAppiumLibrary run_on_failure=No Operation # Does nothing on failure