user3017853
user3017853

Reputation: 21

IE browser nor working with robot framework

I have an issue with robot framework running on IE 8 64 bit browser. I am trying to run the tests on IE, the scripts are failing because it gives an error. Please find the error in a report. Is this because of security settings in IE? And if I make it common security level zones then the browser behaviour is different. As like it minimises and maximises the browser and fails the particular test. Here is the link for the screenshot. And as I know it also depends on the xpaths/ css / javascript properties. It runs fine with other two browsers chrome/firefox. So please suggest to me, what the problem could be and please find the cmd error messages.

Upvotes: 2

Views: 7293

Answers (5)

Ryan M
Ryan M

Reputation: 37

Try keeping the same value for each zone in the Protected Mode settings.

To set the Protected Mode settings, choose "Internet Options" from the Tools menu, and click on the “Security” tab. For each zone, there will be a check box at the bottom of the tab labeled "Enable Protected Mode". This checkbox should be checked or unchecked for each zone.

This value can be enabled or disabled as long as it is the same for every zone – Internet, Local Intranet, Trusted sites, Restricted sites. Recommend it to be kept as enabled since unchecking it would put your computer at risk.

This above solution worked for us.

Reason - Seems like the browser was detecting the 2nd window or its URL as a potential Security Threat and was running the Internet Explorer process with greatly restricted privileges. Because of which RobotFramework (Selenium2Library) was not able to detect the 2nd window.

Thanks and Regards,

Ryan M

Upvotes: -1

Yorga Babuscan
Yorga Babuscan

Reputation: 119

I had the same issue because my network environment is quite "hostile" and I have to deal with NTLM proxy and limited access policies.

To solve this, no_proxy and webdriver.ie.driver environment variables must be properly setted:

Set Environment Variable    no_proxy    127.0.0.1
Set Environment Variable    webdriver.ie.driver    ${local_ie_driver}

... before you call for IE to open, like in this little example:

*** Settings ***
Library           Selenium2Library
Library           OperatingSystem

*** Variables ***
${url_google}     http://www.google.com/
${local_ie_driver}    D:${/}PortableApps${/}SeleniumIEWebDriver${/}IEDriverServer.exe

*** Test Cases ***
Google for macarronada using IE
    Set Environment Variable    no_proxy    127.0.0.1
    Set Environment Variable    webdriver.ie.driver    ${local_ie_driver}
    Open Browser    ${url_google}    ie
    Wait Until Page Contains    Google
    Input Text    id=lst-ib    macarronada
    Click Button    name=btnG
    Wait Until Page Contains    macarronada
    Close Browser

Hope it can help you.

Upvotes: 1

saching
saching

Reputation: 1

You should change your iedriver name to (IEDriverServer.exe) same for Chrome (chromedriver.exe)

Upvotes: 0

Bryan Oakley
Bryan Oakley

Reputation: 386342

The error message is telling you what the problem is, and what the fix is:

Protected Mode settings are not the same for all zones. Protected Mode must be set to the same value (enabled or disabled) for all zones

To fix this you will have to change the security settings so that either all zones have protected mode on, or they all have it off. Go to the Internet Options control panel, select the security tab, and then make sure the checkbox for "Enable Protected Mode" is the same for all zones.

This is documented on the IE driver github page here: https://code.google.com/p/selenium/wiki/InternetExplorerDriver#Required_Configuration

Upvotes: 0

adbarads
adbarads

Reputation: 1303

Ensure the IE Security settings level are the same. For example: slider is set to medium and all 3 sliders. I found this issue too, and set them the same setting and it appeared to be working again.

I am assuming you are using selenium with robot framework?

Upvotes: 1

Related Questions