我有Python 2.6和Robot框架。我已經按照下面的鏈接安裝了Selenium2Library: https://github.com/rtomac/robotframework-selenium2library 但是當我嘗試運行這個例子時,它給了我下面的錯誤並且沒有打開firefox窗口。在我的系統上執行硒與Robot Framework的例子時發生錯誤
ERROR: clean-python26-env]$ python testExeJS.py
======================================================================
ERROR: test_exe_javascript (__main__.ExecuteJavascriptTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "testExeJS.py", line 7, in setUp
selenium.setTimeout("60000")
NameError: global name 'selenium' is not defined
----------------------------------------------------------------------
Ran 1 test in 0.000s
FAILED (errors=1)
任何幫助真的apreciated
編輯
我很抱歉,我剛纔看到您的回覆。可能這會幫助你更多地理解我的問題。 示例代碼的鏈接是: `http://www.wallix.org/2011/07/26/how-to-use-robotframework-with-the-selenium-library/
和我跑步的錯誤是:
$ pybot myFirstTest.txt
==============================================================================
myFirstTest :: This is your first test
==============================================================================
[ WARN ] Keyword 'Capture Page Screenshot' could not be run on failure: No browser is open
Go To Google Page [Documentation] Go to google page and search som... | FAIL |
WebDriverException: Message: 'The browser appears to have exited before we could connect. The output was: Error: no display specified\n'
------------------------------------------------------------------------------
[ WARN ] Keyword 'Capture Page Screenshot' could not be run on failure: No browser is open
Open Selenium Page [Documentation] TestCase for open Selenium page | FAIL |
No browser is open
------------------------------------------------------------------------------
myFirstTest :: This is your first test | FAIL |
2 critical tests, 0 passed, 2 failed
2 tests total, 0 passed, 2 failed
==============================================================================
Output: /data/home/sadikhan/ironport/Selenium/output.xml
Log: /data/home/sadikhan/ironport/Selenium/log.html
Report: /data/home/sadikhan/ironport/Selenium/report.html
你可以鏈接到你吃的例子嗎?看看這個頁面,我只能看到[https://github.com/rtomac/robotframework-selenium2library/blob/master/demo/rundemo.py](https://github.com/rtomac/robotframework-selenium2library/blob/ master/demo/rundemo.py) – theheadofabroom 2013-02-16 10:05:02
對不起,我剛剛看到你的評論。可能這會幫助你更好地理解我的問題: – user1512496 2013-02-18 15:22:31
請參閱下面的答案,並留下評論,如果它不能解決您的問題 – theheadofabroom 2013-02-23 09:30:31