0

I'm having a problem while I'm trying to open a browser. I'm writing tests in RIDE and when I run the test, the browser opens but doesn't display the page...

The browser only displays a message: "the connection has timed out"

Did anyone face this problem?

Here's the code:

    *** 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 the firefox version: 31.0 selenium version: 2.53.6 selenium2Library version: 1.7.4

Any solution? Thanks in advance ;)

pingwin850
  • 299
  • 1
  • 7
  • 24

1 Answers1

0

Here's working code:

*** 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}
pingwin850
  • 299
  • 1
  • 7
  • 24