Selenium library: "Wait Until Page Contains"-command not working

1,218 views
Skip to first unread message

JP

unread,
Jun 12, 2009, 3:17:43 AM6/12/09
to robotframework-users
Hi,

We have problem with Selenium library.
"Wait Until Page Contains"-command is not working. Robot won't
actually *wait* anything, it just FAILs instantly.

Command is here:
"Wait Until Page Contains" "Foo" "100"

And result is here:
Foo-step | FAIL |
Text 'Foo' did not appear in '1 minute 40 seconds'

Selenium-servers logs error:
02:35.019 INFO - Command request: waitForCondition[window.find('Foo'),
100000.0] on session d6f79043fa5245459ae3a1e7da2f3cd4
02:35.097 INFO - Got result: Component returned failure code:
0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMJSWindow.find] on session
d6f79043ce52567459ae3a1e8da2f3cd3


We are running tests against WebLogic Portal.
Nevertheless, we tried same test against www.google.com and it worked
correctly.


Any help?
Thanx, JP

Teme

unread,
Jun 12, 2009, 4:52:34 AM6/12/09
to robotframework-users
This is IE and Firefox 2 related problem with Selenium. (Or at least I
think so because I had one test working at FF3.)

Workaround is to do polling in your test with 'Wait Until Keyword
Success' -keyword.

| Wait Until Keyword Success | 5min | 10s | Page Should Contain | Foo
Bar |

5 min is timeout, 10s is how often the polling is done.

Teme
> Nevertheless, we tried same test againstwww.google.comand it worked

JP

unread,
Jun 12, 2009, 6:19:28 AM6/12/09
to robotframework-users
Great, it worked fine!

Btw: There was typo in your command, correct one is: "Wait Until
Keyword Succeeds"

Thanx, JP

rajiv joseph

unread,
Jun 15, 2009, 1:46:52 PM6/15/09
to janne.a....@gmail.com, robotframework-users
Rajiv:

I guess you need to wait until the page gets successfully loaded, and
then verify the existence of the element or content in the page.

I too faced the issue and incorporated the following fix :

1. You may achieve this by giving a huge wait or sleep to wait for the
page to get loaded
successfully.But the page can get loaded before the wait ends and
you need to wait
uselessly. So we can go with the second option.

2. Create new keyword (e.g my_wait_for_page_and_verify(elementName,
maxTimeToWait))
in '_init_.py' which should call :
a. self._wait_for_page_to_load(..).
This will wait either until the page
loads sucessfully or either the
maxTimeToload limit crosses.You can give
a max time in this case as it
will skip the wait once the page get
loaded successfully.
b. page_should_contain(elementName)
Cal this keyword after the above keyword
in the new
keyword (my_wait_for_page(...))


If you require the new keyword i have created, please feel free to
contact me back.

rajiv...@gmail.com

unread,
Jun 15, 2009, 1:51:46 PM6/15/09
to robotframework-users
Reply all
Reply to author
Forward
0 new messages