我正在尝试打开浏览器时遇到问题。我在RIDE中编写测试,当我运行测试时,浏览器会打开,但不显示页面......
浏览器仅显示一条消息:“连接已超时”
有没有人遇到这个问题?
以下是代码:
*** Settings ***
Library Selenium2Library
*** Variables ***
${Username} student2
${Password} Testing1
${SiteUrl} http://demo.mahara.org
${DashboardTitle} Dashboard - Mahara
${Delay} 5s
*** Test Cases ***
Test2
Open Browser to the Login Page
Enter User Name
Enter Password
Click Login
sleep $(Delay)
Assert Dashboard Title
[Teardown] Close Browser
*** Keywords ***
Open Browser to the Login Page
Open Browser http://demo.mahara.org
Enter User Name
Input Text login_login_username ${Username}
Enter Password
Input Text login_login_password ${Password}
Click Login
Click Button login_submit
Assert Dashboard Title
Title Should Be ${DashboardTitle}
btw firefox版本:31.0 硒版:2.53.6 selenium2Library版本:1.7.4
任何解决方案?在此先感谢;)
答案 0 :(得分:0)
此处的工作代码:
*** Settings ***
Library Selenium2Library
*** Variables ***
${Username} student2
${Password} Testing1
${SiteUrl} http://demo.mahara.org
${DashboardTitle} Dashboard - Mahara
${Delay} 5s
${FF_PROFILE} C:\\ff_profile
*** Test Cases ***
Test2
Open Browser to the Login Page
Enter User Name
Enter Password
Click Login
Sleep ${Delay}
Assert Dashboard Title
[Teardown] Close Browser
Test3
*** Keywords ***
Open Browser to the Login Page
Open Browser http://demo.mahara.org firefox ff_profile_dir=${FF_PROFILE}
Enter User Name
Input Text login_login_username ${Username}
Enter Password
Input Text login_login_password ${Password}
Click Login
Click Button login_submit
Assert Dashboard Title
Title Should Be ${DashboardTitle}