robotframework / SeleniumLibrary

Web testing library for Robot Framework
Apache License 2.0
1.39k stars 765 forks source link

re: IE browser open via robot framework through selenium2 library #227

Closed suryamaya closed 10 years ago

suryamaya commented 11 years ago

Selenium2LibraryFatalException: java.lang.IllegalStateException: The path to th driver executable must be set by the webdriver.ie.driver system property; for ore information, see http://code.google.com/p/selenium/wiki/InternetExplorerDri er. The latest version can be downloaded from http://code.google.com/p/selenium

downloads/list

Chrome | FAIL | 1 critical test, 0 passed, 1 failed

1 test total, 0 passed, 1 failed

Output: C:\robotfinal\output.xml Log: C:\robotfinal\log.html Report: C:\robotfinal\report.html pls tell me the steps to open ie browser via robot framework through selenium2library

HelioGuilherme66 commented 11 years ago

Download IE webdriver if you use 32bit is IEDriverServer_Win32_2.33.0.zip. (you should download both 32 and 64bit) Extract to a location in the PATH. (to test if OK, you can open a CMD window and start the Webdriver by its name; IEDriverServer.exe)

This will make selenium2library find IE browser.

On Tue, Aug 13, 2013 at 8:32 PM, suryamaya notifications@github.com wrote:

Selenium2LibraryFatalException: java.lang.IllegalStateException: The path to th driver executable must be set by the webdriver.ie.driver system property; for ore information, see http://code.google.com/p/selenium/wiki/InternetExplorerDri er. The latest version can be downloaded from http://code.google.com/p/selenium downloads/list

Chrome | FAIL | 1 critical test, 0 passed, 1 failed 1 test total, 0 passed, 1 failed

Output: C:\robotfinal\output.xml Log: C:\robotfinal\log.html Report: C:\robotfinal\report.html pls tell me the steps to open ie browser via robot framework through selenium2library

— Reply to this email directly or view it on GitHubhttps://github.com/rtomac/robotframework-selenium2library/issues/227 .

MohamedAshraf commented 11 years ago

Hi Helio,

I have tried with 32bit as well as 64bit and also set path in environment variable/System variable. But still facing the same issue as below

* Settings * Library Selenium2Library

* Variables * ${BROWSER} ie ${DELAY} 0 ${WEBAPPURL} http://www.google.co.in/webhp?hl=en&tab=ww

* Test Cases * Set Environment Variable webdriver.ie.driver E:\Automation\RoboFramework\Jars\IEDriverServer.exe Open1 Open Browser ${WEBAPPURL} ${BROWSER}

Open1 | FAIL | Selenium2LibraryFatalException: java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.ie.driver system property; for m ore information, see http://code.google.com/p/selenium/wiki/InternetExplorerDriv er. The latest version can be downloaded from http://code.google.com/p/selenium/ downloads/list

ombre42 commented 11 years ago

I do not use the Selenium2Library Java port, but the Selenium docs indicate that you do not have to set webdriver.ie.driver if IEDriverServer.exe is on the PATH. Do not forget that if you change PATH, it does not affect existing processes (e.g. RIDE or Eclipse).

Get Environment Variable will retrieve a Java System property if it exists, but Set Envrironment Variable does not set Java System properties. jybot does not have a way to set system properties via arguments AFAIK, but if you invoke RF via jython, you can:

jython -Dwebdriver.ie.driver=C:\path\to\IEDriverServer.exe C:\Python27\Lib\site-packages\robot\run.py ...

The JavaTools library in Javalib-core has a Set System Property keyword, but I have never used it.

HelioGuilherme66 commented 11 years ago

Well, I don't know if it makes a difference but I always set the BROWSER to IE (allcaps).

Remove or comment the line: Set Environment Variable webdriver.ie.driver E:\Automation\RoboFramework\Jars\IEDriverServer.exe


Before calling pybot (or even opening RIDE), set the PATH variable to find the driver:

set PATH=%PATH%;E:\Automation\RoboFramework\Jars (or system wide in Windows Environment vars)

Did you performed my proposed test?: Extract to a location in the PATH. (to test if OK, you can open a CMD window and start the Webdriver by its name; IEDriverServer.exe)

On Wed, Aug 14, 2013 at 1:17 PM, MohamedAshraf notifications@github.comwrote:

Hi Helio,

I have tried with 32bit as well as 64bit and also set path in environment variable/System variable. But still facing the same issue as below

* Settings * Library Selenium2Library

* Variables * ${BROWSER} ie ${DELAY} 0 ${WEBAPPURL} http://www.google.co.in/webhp?hl=en&tab=ww

* Test Cases * Set Environment Variable webdriver.ie.driver E:\Automation\RoboFramework\Jars\IEDriverServer.exe Open1 Open Browser ${WEBAPPURL} ${BROWSER}

Open1 | FAIL | Selenium2LibraryFatalException: java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.ie.driver system property; for m ore information, see http://code.google.com/p/selenium/wiki/InternetExplorerDriv er. The latest version can be downloaded from http://code.google.com/p/selenium/ downloads/list

— Reply to this email directly or view it on GitHubhttps://github.com/rtomac/robotframework-selenium2library/issues/227#issuecomment-22631338 .

MohamedAshraf commented 11 years ago

Fist of all thanks for your quick reply :)

I have tested with below settings I am using java library / i even tried updating system environment variable, but same error

Eclipse: Argument> -Dwebdriver.ie.driver=E:\Automation\RoboFramework\Jars\IEDriverServer.exe ${resource_loc}

Receiving below error:

Google :: webdriver.ie.driver\=E:\Automation\RoboFramework\Jars\IEDrive...

Search Google [ WARN ] Opening browser 'IE' to base url 'http://www.google.com' failed [ WARN ] Can't take screenshot. No open browser found | FAIL |

Selenium2LibraryFatalException: java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see http://code.google.com/p/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from http://code.google.com/p/selenium/downloads/list

Google :: webdriver.ie.driver=E:\Automation\RoboFramework\Jars\IED... | FAIL |

Please help me on this

HelioGuilherme66 commented 11 years ago

This is a Robot Framework group, my replies are in that context. I cannot help about the Java questions.

What I have said should be still valid if you are running Robot Tests from Jython.

(Have you tried to put IEDriver in a location of the PATH? For example C:\Windows\System32. Then open a new command line Windows and the IEDriver must be possible to run from any directory.)

On Wed, Aug 14, 2013 at 9:13 PM, MohamedAshraf notifications@github.comwrote:

Fist of all thanks for your quick reply :)

I have tested with below settings I am using java library / i even tried updating system environment variable, but same error

Eclipse: Argument> -Dwebdriver.ie.driver=E:\Automation\RoboFramework\Jars\IEDriverServer.exe ${resource_loc}

Receiving below error: Google :: webdriver.ie.driver\=E:\Automation\RoboFramework\Jars\IEDrive...

Search Google [ WARN ] Opening browser 'IE' to base url ' http://www.google.com' failed [ WARN ] Can't take screenshot. No open browser found | FAIL | Selenium2LibraryFatalException: java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see http://code.google.com/p/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from http://code.google.com/p/selenium/downloads/list

Google :: webdriver.ie.driver=E:\Automation\RoboFramework\Jars\IED... | FAIL |

Please help me on this

— Reply to this email directly or view it on GitHubhttps://github.com/rtomac/robotframework-selenium2library/issues/227#issuecomment-22663698 .

ombre42 commented 10 years ago

@HelioGuilherme66 thank you for helping. @MohamedAshraf I think you have a typo. E:\Automation\ Robo Framework... not E:\Automation\ Robot Framework

asitishere commented 9 years ago

I stated using the Java port and found the same problem. The workaround for now is in when you call the keyword "Open Browser" nit calls createLocalWebDriver function inside BrowserManagement.java.

I have downloaded the chrome or ie driver exe as per you system ( 32 or 64 bit) then copy to any location and point it in code

} else if ("gc".equals(browserName) || "chrome".equals(browserName) || "googlechrome".equals(browserName)) {

        System.setProperty("webdriver.chrome.driver", "c:/chromedriver.exe");
        return new ChromeDriver(desiredCapabilities);

You can set as Env path to get rid of full path in the code.

then u have to compile the code and run it will solve your problem

sachinGirish commented 9 years ago

put yours ie and crome in script folders ............. then set path .............it will work f9

GLMeece commented 8 years ago

FWIW, here's a modified excerpt from our repo's README about IE that I wrote:

Configure Environment

  1. Download the appropriate browser drivers:
    • For Google Chrome - the latest Chromedriver executable can be found here. As of this writing, it was version 2.21. The file will always be named chromedriver_win32.zip.
    • For Microsoft Internet Explorer, you may select the appropriate bit version for your workstation (almost certainly the 64-bit version) from the Selenium HQ site. As of this writing, the latest 64-bit version was 2.53.1. However, there is a known bug that causes sending keys (to emulate a user typing) to be extremely slow. Therefore, as of this writing, it is recommended you use the 32-bit version of the driver (version 2.53.1 here)
    • Mozilla Firefox does not require an external driver - it comes with Selenium "hooks" built in.
  2. Unzip the file(s) and place the executable(s) (chromedriver.exe and/or IEDriverServer.exe) somewhere that it makes sense to put in your Path system variable. Here are instructions on how to add a path so that is accessible system-wide. The author's recommendation is to create a directory named bin at the root of the C drive. This allows you to add other simple executables in the same directory, which can be invoked from then on (once you add this directory to the Path).

Special Instructions for Internet Explorer

Assuming you have already set up the driver for Internet Explorer (see above), there are two additional steps you need to take in order to have IE function as a web client for testing:

  1. You must launch Internet Explorer and verify that the zoom level is set to exactly 100%. For instructions on how to verify that, see this page.
  2. You must have Protected Settings enabled for all security zones. An article here will explain in more detail, but the salient setting is depicted in this picture:

Internet Options Security Settings

emanlove commented 8 years ago

For Microsoft Internet Explorer, you may select the appropriate bit version for your workstation (almost certainly the 64-bit version) from the Selenium HQ site.

@GLMeece Are saying the bit-ness or bit version one should choose is based upon the bit version of the OS you are running under? If so that is incorrect. The bit version of the IEDriver depends upon the bit version of IE that one intends to run as per the SeleniumHQ documentation. Most versions of Windows have the 32 bit version of IE as the default and most of the time by default people are running 32-bit version of IE. There are several sources [6] that talk about 32 bit IE as the default but still looking for ones that back up my claim the 32 bit version has the majority of usage. I best as I can recall the reason for this is all the supporting legacy software and legacy software within the IE ecosystem was for 32 bit IE and thus Microsoft, with their long standing attempt not to break backward compatibility, never forced users/developers to upgrade and left the 32 bit version as default. Again I am looking for a good source to back this claim up but the majority of people are running 32-bit IE and not 64-bit.

So when you say "appropriate bit version for your workstation" I hear that as saying "the bit version for your operating system" which is incorrect.

A few more resources

  1. A description of the differences between 32-bit versions of Windows Vista and 64-bit versions of Windows Vista
  2. Differences between the 32-bit and 64-bit versions of Internet Explorer that are included in the x64-based versions of Windows Server 2003 and in Windows XP Professional x64 Edition
  3. Version of IE 32 bit or 64 bit? - How can I tell which version I am using?
  4. WebDriver for Internet Explorer (Windows)
  5. Microsoft Edge: WebDriver
  6. I have Windows 7 64-bit and need to use Internet Explorer 32-bit
GLMeece commented 8 years ago

Hey, @emanlove - your assumption about my intent and understanding is not correct. I fully realize one may run both 32-bit as well as 64-bit versions of any executable on Windows. The point of that snippet from my repo's README was that, in general, it is considered "best practice" to use a 64-bit executable if you are running a 64-bit OS. Having said that - yes, 32-bit IE almost certainly has the highest deployment/usage.

If you'll notice the second bullet about IE, I say one may (vs. must or should) choose the 64-bit Webdriver to run the 64-bit version of IE. However, I refer to the fact that the 64-bit IE and its correspondent Webdriver has a known bug that causes the sendKeys function to be extremely slow. Thus, I was recommending testing against the 32-bit version of IE, along with the (required) 32-bit version of the Webdriver unless there was a compelling reason to do otherwise.

Bear in mind, what I copied and pasted above is from a larger README, and was originally intended for my company's internal use. If I had taken the time to re-write this for a general audience, I might have taken a more expansive coverage of this topic.

Thanks for your time and concern! :smiley:

emanlove commented 8 years ago

@GLMeece - sorry for coming across so strong. I see now where you mention this was for internal use. My concern is that others would search out solutions for how to use IEDriver and be presented that a lot of how-tos instructions, etc that all differ and seem equally informed thus providing more confusion than clarity.