Reputation: 39250
I npm installed the selenium-webdriver. Downloaded the IE component and put it in my path (using Windows 8).
Opened IE and set all security zones to high, they need to be the same but since "Restricted sites" does not allow me to set it to anyting but high I have to change all the others to high.
Then ran a modified version of the \node_modules\selenium-webdriver\example\google_search.js:
var webdriver = require('..'),
By = webdriver.By,
until = webdriver.until;
var driver = new webdriver.Builder()
.forBrowser('ie')
.build();
driver.get('https://www.google.com/?gws_rd=ssl');//no redirect
driver.findElement(By.name('q')).sendKeys('webdriver');
driver.findElement(By.name('btnG')).click();
driver.wait(until.titleIs('webdriver - Google Search'), 1000);
driver.quit();
IE starts and opens google and then I get the following error:
NoSuchElementError: Unable to find element with css selector == *[name="q"]
I'm pretty sure the element is on the page since "view source" gives me
<input class="lst lst-tbb sbibps" id="lst-ib" maxlength="2048" name="q"
This may actually be an issue with IE because document.body.querySelector("*[name=\"q\"]")
returns undefined in IE 11 when on google.com but that would mean it is not possible to use selenium with IE.
[UPDATE]
When changing the security levels back to default settings the query selector works but then selenium crashes on:
WebDriverError: Unexpected error launching Internet Explorer. Protected Mode set tings are not the same for all zones. Enable Protected Mode must be set to the s ame value (enabled or disabled) for all zones.
Upvotes: 2
Views: 365
Reputation: 986
A few people have similar problems with IE, and one'Issue is due to testing url added as exception to by pass proxy settings.
1.In Internet Explorer, Go to 2.Tools->Internet Options->Connections->LAN Settings 3.In Proxy server, click Advanced button 4.In Exceptions, check whether the testing url for which proxy server has to be bypassed is included. If so remove it and execute the test case.This resolves me the issue. I tested in both IE 7 and IE 8 and it works for me.'
I believe this can help you? https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/3032 - This link suggest a number of solutions, let me know if any work for you.
[UPDATE] You need to set the checkbox titled "Enable Protected Mode" the same for every zone under internet options => security. Not the security level slider.
Another problem you may experience is that typing is very solow. Using the 32bit driver can solve this.
Upvotes: 1