Chrome sendKeys not shifting focus

176 views
Skip to first unread message

bpant

unread,
Jan 28, 2011, 2:54:41 PM1/28/11
to webdriver
Hi

In chrome, I am not able to successfully use sendKeys on a password
field which follows a name field in a html form. it works if I add a
passwordField.click() before sendKeys(). This indicates a focus shift
problem


According to this,

http://code.google.com/p/selenium/wiki/FrequentlyAskedQuestions#Q:_The_%22onchange%22_event_doesn%27t_fire_after_a_call

sendKeys() leaves focus on the element it was just used on, but it
does not say if it steals focus from another one which currently has
focus. Is this a bug in Chrome driver? It works fine for IE and
Firefox.

Version: selenium 2.0b1
OS: win7 enterprise 64-bit
java 1.6



HTML fragment

<form id="login_form" name="loginForm" method="post" action="/
security_check">

<div class="form_element email">
<label for="email">E-mail:</label>
<input type="text" name="username" id="email"
class="textfield" />
</div>
<div class="form_element password">
<label for="password">Password:</label>
<input type="password" name="password"
id="password" class="textfield" />
<p class="field_note"><a
href="forgotPassword.do">Forgot password?</a></p>
</div>
<div class="submit_module">
<input type="submit" name="submit" id="submit"
value="Log In" class="submit" />
</div>
</form>



bp

unread,
Jan 28, 2011, 4:31:37 PM1/28/11
to webd...@googlegroups.com
Ok, here is a far simpler reproduction info, just two textbox elements, and a simple java test snippet

See attached.

the getValue() asserts pass only if I use the click() calls. this only happens for chrome


chrome_sendkeys.html
chrome_sendkeys.java

bp

unread,
Jan 28, 2011, 4:38:05 PM1/28/11
to webdriver
Just saw that an open issue exists for this.
http://code.google.com/p/selenium/issues/detail?id=440

Sorry for not checking earlier.
>  chrome_sendkeys.html
> < 1KViewDownload
>
>  chrome_sendkeys.java
> < 1KViewDownload
Reply all
Reply to author
Forward
0 new messages