Does Selenium Test in Internet Explorer Always Expire?

I am trying to run a basic test in Internet Explorer via Selenium-RC / PHPUnit and it always returns with

# phpunit c:\googletest.php
PHPUnit 3.4.15 by Sebastian Bergmann.

E

Time: 35 seconds, Memory: 4.75Mb

There was 1 error:

1) Example::testMyTestCase
PHPUnit_Framework_Exception: Response from Selenium RC server for testComplete()
.
Timed out after 30000ms.


C:\googletest.php:17

FAILURES!
Tests: 1, Assertions: 0, Errors: 1.

Paul@PAUL-TS-LAPTOP C:\xampp
#

The last command in command history is waitForPageToLoad (30000). The same test works fine and exits in firefox. How can I run this test in Internet Explorer?

thank

+3
source share
4 answers

There is an open error in selenium that causes waitForPageToLoad for sometimes a timeout in IE.

http://jira.openqa.org/browse/SRC-552

It is flagged as on IE6, but I am experiencing the same error, at least in IE9.

, , DOM- , waitForPageToLoad. : waitForVisible ('css = # header')

+3

" " "". -.

+1

, , .

+1

, Python :

def open(self):
    timeout = self.get_eval('this.defaultTimeout')
    self.set_timeout(0)
    self.do_command("open", [url,ignoreResponseCode])
    self.set_timeout(timeout)
    self.wait_for_page_to_load(timeout)

def wait_for_page_to_load(self,timeout):
    # self.do_command("waitForPageToLoad", [timeout,])
    import time
    end = time.time() + int(float(timeout) / 1000)
    while time.time() < end:
        if self.get_eval('window.document.readyState') == 'complete': return
        time.sleep(2)
    raise Exception('Time out after %sms' % timeout)

DOM document.readyState, , .

IE 9+ -, , .

+1

Source: https://habr.com/ru/post/1757363/


All Articles