我遇到了用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的協議,但我不知道