How to test webapp with different versions of IE from single windows machine? - selenium

I need to test a Web application on different versions of IE (IE9, IE8 & IE7).
I found that IE9 provides the compatibility view for IE8 & IE7 so I had installed IE9 in my test system.
There is one header META tag "X-UA-Compatible" by which you can set the compatibility view But in my case we don't have access to the source files.
If some how from selenium or by any other way if we can dynamically set the "X-UA-Compatible" tag then It can resolve my problem. Please let me know if there is any good way to Test the WebApp in different version of IE (7,8 & 9) from Single windows machine/instance.
Any suggestion would be appreciated.
Please do share your experience with this.
Thanks.

For testing your web application on different version of IE you can use online test tools, IETester, IECollection, Microsoft TestDrive
or in IE 8 & 9 press F12 and select IE version from Browser Mode menu

You speak about compatibility mode. Not sure if you know this but if you dont, press F12 in IE 9 to open developer tools. From there, you can set rendering version. This is the way I test on different IE versions.
From the official source:
4 ways tp test...
Another solution, you can try is spoon.net/, which is online simulator for browsers. You can select different browsers & versions there. You could also find other similar online simulator.

Microsoft provide virtual machines for different versions of IE at http://modern.ie . So, on a single machine it is possible to have multiple test versions of IE by running your tests in a virtual machine.

Update Nov 2014: There is now a way to achieve this.
Spoon has a Selenium grid that runs all versions of IE (Chrome and Firefox too) on the same Windows dev machine.
It uses the Spoon virtual machine to achieve this, by virtualizing a selenium setup including all browser nodes.
Its 100% compatible with your existing selenium tests. You don't need to launch the nodes beforehard, they launch on demand when test code requires a specific browser/version via capabilities.
Disclaimer: I work at Spoon and helped build this.

Related

Docker + Selenium Grid: Is it possible to do true cross-platform testing?

I am new to Docker and I am exploring Docker as a way to build a more stable and maintainable Selenium GRID. I have completed the Docker + Selenium Grid course at Udemy, but I still don't know a few things.
My company has a web portal and I am required to verify functionality across browers and OSes:
Recent versions of Chrome on recent versions of Mac, Linux & Windows
Recent versions of Firefox on recent versions of Mac, Linus & Windows
Recent versions of Safari on Mac
Recent versions of IE and Edge on recent versions of Windows
As far as I can tell a Docker container is 'linux-like'. Does that mean it serves only to verify Chrome and Firefox on linux. Is there some way to use Docker to verify these other browser + OS combos?
Please explore the below projects for selenium grid with docker on Linux and Windows .
1)https://github.com/elgalu/docker-selenium/blob/master/README.md
2)https://github.com/SeleniumHQ/docker-selenium
3)https://github.com/zalando/zalenium/blob/master/docs/usage_examples.md
Recent versions of Safari on Mac
-: I am not sure about the safari availability in docker hub , but try putting your question for mac in docker-for-selenium project they will help you .
Recent versions of IE and Edge on recent versions of Windows
-:Yes , their are some challenges while implementing the IE and Edge in windows containers.
please check this thread #https://github.com/MicrosoftDocs/Virtualization-Documentation/issues/214
it is clearly mentioned here , "Windows feature enabling to install the GUI within a windows container" ,So challenges are their to enable GUI for windows container .
But still if you want to go for cross browser testing
with other options available for windows . you can try exploring this # https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/
UPDATES
Copying my answer from https://stackoverflow.com/a/55704955/5449500
Still there is no official approach to run IE/EDGE inside docker as
"No Windows docker images have GUI, so we cannot test IE11, EDGE."
But,We can install virtual-box and make this happen.
This approach adds extra layer of virtualization[Nesting of virtualization] on the top of docker to make the IE/Edge execution happen and I think in near future it may leads to to performance issue for heavy testing.
If Selenium testing is what you are looking for and don't have heavy load , you can give a try to the approach mentioned in the link.
Youtube - Selenium Windows containers in Docker under Linux
Github - Windows Images
Blogpost - selenium-on-windows-docker-revolution

How to force compatibility view

I have IE 11 installed, but I need to run a few tests in IE 8, 9, & 10 as well. How can I force the compatibility mode when running a test.
FYI, I did try F12, and set the mode to 8. It works manually, but not through selenium.
Thanks!
I ran into exact same issue recently. Unfortunately, there is no way unless you change page source. See this. However, I can tell you what I have done. I used VMS of course. Luckily, microsoft also provides trial versions of VMS with different versions of IE. visit this. After getting the VMs ready I installed NUNit Console. I then simply copied and loaded the test dll on that and just run.

Selenium scripts fail after newest Windows update

I have a question regarding Selenium and the current Microsoft updates:
I just installed the newest Microsoft patches on a PC and now the Selenium scripts won't work anymore. I'm using the Selenium IE Driver 2.44.0 in the scripts. Maybe something has changed in the Internet Explorer, I'm not sure. Suddenly the scripts can't find any web elements on the page anymore. An InvalidSelectorException is thrown because the findElements methods can't be executed. The IE driver opens up and it navigates to the given URL, but when it tries to find a web element, the script fails. I also tried it out on a PC which hasn't the newest updates installed yet and the scripts are working fine there, there are no problems at all.
Do you have any ideas what to do or what could be the cause?
Thanks a lot!
Yes as I stated here
If you have taken windows update KB3025390 IE will not work as expected. There is currently no resolution to that yet.
Also, Uninstalling the update KB3025390 should make the WebDriver work correctly with Internet Explorer 11. See this answer

How to test LOCALLY an rails application layout on IE7 and IE8 from an MacOSX?

So, I'm developing my rails applications on my mac, thro WEBrick at 0.0.0.0:3000 and I need to test how the layout are showing on PC running Windows with Internet Explorer 7 and IE8.
I have tried to test it thro Wine + Wine Bottler, but I can't access that point.
And now I'm thinking to install VirtualBox to give a try, but before doing this, it will be good to know from others if it will or not work for me in this case.
Any advice?
Thanks!
I use VirtualBox for interface testing. I've had no problems with it at all. I have an external drive with various disk images for firing up various versions of Windows and thus various versions of IE as well as Firefox and Chrome. Works a treat and no complaints.
We have used VirtualBox and a program called IETester:
http://www.my-debugbar.com/wiki/IETester/HomePage
It works well, even for IE6 although there are some very minor differences for IE6.
Makes it very quick to test in all versions of IE as you can have a tab for each.
Give it a go.

Is the new IE9 a standalone browser

Anyone that has installed the new IE9 know if I can keep IE8 installed? I do a lot of web testing and don't want to update to IE9 if I loose IE8.
best way is to install a Virtual Machine
Per Microsoft:
If you are running Windows Vista or
Windows 7 on your computer, you can
install the Internet Explorer 9 Beta
to replace your existing version of
Internet Explorer. After you install
Internet Explorer 9, you can uninstall
it to restore the previously installed
version of Internet Explorer.
So no, it will overwrite IE8 (at least the Beta will. I suppose this is not guaranteed to be the same for the release version).
I use Virtual PC with images of the browsers I need to test, but also and more lately, IETester, http://www.my-debugbar.com/wiki/IETester/HomePage. It allows you to run multiple versions of IE side by side.
If you want to be able to play with the new features of IE9 without installing the entire browser (which will replace IE8) you can install the Platform Preview. The PP is stand-alone, includes the latest features and bug fixes and has been getting updated roughly every 8 weeks. You can get the latest Platform Preview at:
www.ietestdrive.com
FYI: the production IE 9 does not accurately reproduce IE 8. I've got a CSS issue I'm chasing down now because IE 9's IE 8 mode isn't the same as real IE 8.
If you are concerned with testing how your site looks in IE8/7, you can use the Developer Tools (press F12) to switch the Browser modes and Document modes so that IE9 interacts with the web server as a different user agent, and renders the HTML document according to the version rules.
http://msdn.microsoft.com/en-sg/ie/ff468705(en-us).aspx#_New_Dev_Tools
IE9 beta is released as a Windows update, so after installing it and playing around, you can remove it from Programs and Features -> Installed Updates, which will recover IE8.
hit f12 on ie9, it will pop up the debug console. In the menu there is a browser mode option where you can set the browser to display as ie8 and a bunch of other versions too.
Also, if you're mouse focus is on the console and you hit ctrl+r, it will clear your browser cache... This is a feature that all the other browser debuggers lack.. ability to quickly clear cache.... I'm rambling now.
The best way to see your site on old versions of IE is that:
If you have IE9+, open your current version of InternetExplorer, press F12, click on "Browser Mode" tab, then choose the version you want.
see screenshot here:
Works better than IE-tester, and easier than using virtual machine.