Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPUnit Selenium, clickAndWait() function doesn't work in Opera

Tags:

I have problem with PHPUnit_Selenium in Opera. If I have clicked on element in my test code, the page will not load. In other browsers such as Firefox, IE, Chrome and Safari, it works correctly.

Code:

$browser->clickAndWait(link);

It's next steps from SELENIUM REMOTE CONTROL:

click(link)
waitForPageToLoad(120000)

After timeout, if I click on link in browser the page is reloaded.

I have Selenium RC v. 2.31.0 and Opera version 12.41, but i test also on Opera 11.50.

Do you have any idea what is wrong?

like image 467
Szymon Avatar asked Mar 11 '13 08:03

Szymon


1 Answers

I was having this issue in FF as well, this was the solution that I came up with:

def wait_for_element_by_id(eid):
   "Wait for an element to be present"
   element = WebDriverWait(driver, 10).until(
       EC.presence_of_element_located((By.ID, eid))
   )
   return []
like image 74
Ashton Honnecke Avatar answered Oct 21 '22 03:10

Ashton Honnecke