我遇到了用Selenium2测试IE6的问题。我用Perl绑定(Selenium::Remote::Driver),但我将不胜感激任何建议,即使他们将是谁与硒经验的Java等人是否可以使用Selenium2测试IE6以及如何使用“seleniumProtocol”:“Selenium”?
的问题是,当我尝试这样做:
my %opt = (
browser_name => 'internet explorer',
version => '6',
platform => 'WINDOWS',
proxy => {
proxyType => 'direct',
}
);
my $driver = Selenium::Remote::Driver->new(%opt);
$driver->get('http://www.google.com');
my $elem = $driver->find_element('gs_htif0', 'id');
$elem->send_keys('fooooooo');
浏览器打开,但随后的测试与消息An element could not be located on the page using the given search parameters: gs_htif0,id at ...
死亡,而在IE7一切工作正常,和文档到IE司机说,IE6测试
之后,我试图启动一个节点与"seleniumProtocol": "Selenium"
,我认为这是测试任何浏览器的选项这里是没有驱动程序,所以它可以在用户的行动“的JavaScript仿真”的老路上进行测试,但后来的浏览器根本不启动,测试死于与消息java.lang.NullPointerException: sessionId should not be null; has this session been started yet?
我的轮毂配置为:
{
"host": null,
"port": 4444,
"newSessionWaitTimeout": -1,
"servlets" : [],
"prioritizer": null,
"capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher",
"throwOnCapabilityNotPresent": true,
"nodePolling": 5000,
"cleanUpCycle": 5000,
"timeout": 300000,
"browserTimeout": 0,
"maxSession": 5
}
我的节点配置为:
{
"capabilities":
[
{
"platform": "WINDOWS",
"browserName": "internet explorer",
"version": "6",
"seleniumProtocol": "WebDriver",
"ensureCleanSession": true
}
],
"configuration":
{
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession": 1,
"port": 5555,
"host": "192.168.1.6",
"register": true,
"registerCycle": 5000,
"hubPort": 4444,
"hubHost": "192.168.1.34"
}
}
开始节点的命令是java -jar selenium-server-standalone-2.29.0.jar -role node -nodeConfig node_ie6_conf.json -Dwebdriver.ie.driver="IEDriverServer_2.29x32.exe" > nul
开始毂命令是java -jar selenium-server-standalone-2.29.0.jar -role hub -hubConfig hub_conf.json &> dev/null
任何人都可以帮助我吗?我的赞赏。
更新 我的问题的第二部分,我想,硒::远程::驱动程序仅适用于webdriver的协议,但我不知道