質問

I am writing selenium tests for input fields with jquery autocomplete. I've got advise to use typeKeys method. But it doesn't work:

var soda = require('soda')
  , assert = require('assert');

var browser = soda.createClient({
    host: 'localhost'
  , port: 4444
  , url: 'http://en.wikipedia.org/wiki/Wikipedia'
  , browser: 'firefox'
});

browser.session(function(err){
  browser.open('/', function(err, body, res){
    browser.typeKeys('searchInput', 'Hello', 
                 function(err, body, res){
      // browser.testComplete(function(){

      // });
    });
  });
});

Nothing appears in searchInput field.

役に立ちましたか?

解決

Firefox 22 and 23 have problems with typeKeys (see this for example).

I reverted to FireFox 21 which works fine. You can download the en-US version here. Alternatively you can use chocolatey and install it with

 cinst Firefox -Version 21.0

Don't forget to turn off automatic updates in the settings.

Alternatively you could try using sendKeys instead.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top