문제

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