Selenium: How to click buttons that use onclick window.location?

Posted by Andrew on Stack Overflow See other posts from Stack Overflow or by Andrew
Published on 2010-06-01T22:58:05Z Indexed on 2010/06/01 23:03 UTC
Read the original article Hit count: 240

I have a button (outside of a form) that redirects to another page using the onclick attribute that calls window.location to redirect the user to another page. This time I can't change the HTML. I am using Safari 4 for testing. How can I click a button that uses the onclick attribute and window.location to redirect using Safari 4 and Selenium RC PHPUnit Extension?

Here's my HTML:

<input type="button" onclick="window.location='/registrations/new'" value="Start a new registration" id="create">

© Stack Overflow or respective owner

Related posts about button

Related posts about safari