Selenium Functional Testing Keypressnative Method Not Working Properly/consistently

Hi All,

Good day!

Setup Details:

Netbeans: 7.3.1

phpunit: 3.7.28

selenium-server: 1.0.3

google-chrome: Version 31.0.1650.57

OS: Ubuntu 13.04

I am using the method $this->keyPressNative(“88”) that should type “x” on the textfield, sometimes it is working but sometimes it doesn’t work. Below is the part of the code that does not work. I am using this keypressnative method to simulate user typing in search textfield, where the textfield has javascript keydown event.




        if ($this->isTextPresent('Search'))

            $this->click('link=Search');

        $this->waitForTextPresent('Find a');

        //find record that does not exist "x"

        //$this->waitForTextPresent('Find a');

        //while ($this->waitForTextPresent('No results found.')) {

        $this->type('name=keyword', '');

        $this->focus("//input[@id='keyword']");

        $this->keyPressNative("88");

        $this->waitForTextPresent('No results found.');



If you guys have any idea or any work around to fix this issue, that would be great. Thanks!