xpath in htmlunit to access button
I am trying to access the button in the following form using htmlunit.
Since the button does not have a name I guess I have to use xPath in order
to address it. I tried to access it over the class field by writing
page.getByXPath("//input[@class='btn small']");
but unfortunately this does not work.
Does anybody have an idea how to access it?
<form id="login_form" class="login" action="/login" accept-charset="utf-8"
method="post">
<input type="hidden" name="p" value="" id="page_url_p"/> <input
type="hidden" name="dest"
value="" id="page_url_p"/> <label>Email or
Username</label> <input id="user"
class="user" type="text" name="username" value=""/>
<script>$('user').focus();</script>
<label>Password</label> <input id="pass" class="pass"
type="password" name="password"
value="" maxlength="256"/> <a
class="forgot"
href="http://www.mypage.com">Forgot your
password?</a>
<p id="" class="btn small " style="" onmousedown="util.toggleClass(this,
'active')" onmouseup="util.toggleClass(this, 'active')"
onmouseover="util.toggleClass(this, 'hover')"
onmouseout="util.toggleClass(this,
'hover')"><a href="#" id="" class="" style=""
onclick="$('login_form').submit();
return false;" target="" tabindex="">Sign in</a></p></form>
No comments:
Post a Comment