Tab key doesn't change focus under Chrome (Chromium)

98 views
Skip to first unread message

piotr.re...@gmail.com

unread,
Jun 30, 2013, 6:35:58 PM6/30/13
to seleniu...@googlegroups.com
Hi,

when I send Tab key to input element in Chrome element doesn't lost its focus. Instead of I see tab key inside of the element.

Sample code from PHP:

$this->_session->open('http://localhost/');

$element = $this->_session->activeElement();
        
$tabKey = new PHPWebDriver_WebDriverKeys('TabKey');
$element->sendKeys($tabKey->key);

$wait = new PHPWebDriver_WebDriverWait($this->_session);
$wait->until(function($session) {
    // belowe statement never gets true on Chrome, works perfectly under Firefox and Opera
    return $session->activeElement()->attribute('name') === 'pwd';
});

$this->assertEquals('pwd', $this->_session->activeElement()->attribute('name'));


Same problem with python driver but python lib doesn't have active_element method so I'm not posting sample code.

My version of Chromium is 28.0.1500.52 (207119) and Selenium: 2.33.0. My os is Arch Linux.

Anybody with similar issue or suggestion how to solve this one?

Best regards,
piotrr

Zhihan Xia

unread,
Apr 29, 2015, 9:27:54 AM4/29/15
to seleniu...@googlegroups.com
Hi, I got a similar issue with running selenium in a Ubuntu 14 Linux box. I was using firefox 37 and selenium JVM 2.45. Have you find a solution for this?

When I have GUI, my tests run smoothly. However, when I use DISPLAY=:0 option to run my test in a ssh session, using Tab to blur the focus in an input field does not work any more. 

I tried JS way:

document.getElementById('my element ID').blur();

It did work either.

Anyone knows any work around for this issue?

Thanks in advance!

在 2013年7月1日星期一 UTC+2上午12:35:58,Piotr Repetowski写道:
Reply all
Reply to author
Forward
0 new messages