0
votes

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 ;)

1
Are you able to open the URL manually? The connection timed out could be due to your application/network issue. Also, can you provide your code in your question description?Mukesh Takhtani
I've edited the post adding the code.. Yes, I am able to open the URL manually.pingwin850
Are you using a proxy when you open it manually?Mukesh Takhtani
I'm using system proxy settings.pingwin850
ok, I found the solution.. I had to create new folder called 'ff_profile', add a new variable ${FF_PROFILE and} and in keyword Open Browser do sth like that: ff_profile_dir=${FF_PROFILE}pingwin850

1 Answers

0
votes

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}