简体   繁体   English

Selenium Webdriver IE9事件未触发

[英]Selenium webdriver IE9 event not firing

I am using nodejs, Soda with selenium 我正在使用nodejs,苏打水和硒

I am hitting problems trying to get the javascript to fire events like on entry of data. 我遇到了尝试使JavaScript触发事件(如数据输入)的问题。 Script can't even get through the creation of client flow on IE. 脚本甚至无法通过在IE上创建客户端流来完成。 Only worried about IE 9+ btw. 只担心IE 9+。

Am I missing anything ? 我有什么想念的吗? This works fine in latest FF. 在最新的FF中可以正常工作。 Below posting sample code using for FF 下面发布用于FF的示例代码

var soda = require('soda');
var assert = require('assert');
var browser = soda.createClient({
  url: 'http://192.168.12.1/', // localhost website
  port:5555,
  host:'192.168.1.3', //grid ip
  browser: 'firefox',
  browserTimeout:5
});

var testname = 'Nits' + parseInt(Math.random() * 100000000); //create unique name for new person.
console.log('randome name: ' + testname);

browser 
    .chain
    .session()  
    .setSpeed(speed)
    .setTimeout(20000)
    .open('/')
    .and(login('dev@dev.com', 'x1212GQtpS'))
    .and(killClient(killAtEnd))
    .end(function(err){
        console.log('done');
        if(err){
            console.log(err);
        }else{
            console.log("We're Good");
        }
        if (closeAtEnd){
            browser.testComplete(function() {
                console.log('killing browser');
            });
        }
    });

function login(user, pass) {
  return function(browser) {
    browser
    .click('css=a#loginButton')
    .type('css=input.input-medium.email',user)
    .type('css=input.input.pwd',pass)
    .clickAndWait('css=a.btn.login')
    .assertTextPresent('Clients',function(){ console.log('logged in ok')})
  }
}

Can you be more specific about exactly where the script stops, fails, or throws an error? 您能否更确切地说明脚本停止,失败或引发错误的确切位置? I suspect that IE can't handle the way you put your css selector together (ie the classname combinators such as 'input.input.pwd' ). 我怀疑IE无法处理将CSS选择器放在一起的方式(即类名组合器,例如'input.input.pwd')。 I would recommend trying a different selector or rewrite/simplify your existing selector until you get it working. 我建议尝试使用其他选择器,或者重写/简化现有选择器,直到您可以使用为止。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM