Some browsers like IE fail to close when calling webdriver.quit() if they a modal javascript alert is displayed at the time of closing.
Does Selenium2/Webdriver have a way of killing the browser off in such cases? If such an occurrence happens, it messes up all subsequent tests on that browser.
Regards,
Mark
For IE, I've found it necessary to call RemoteWebDriver.Close() before RemoteWebDriver.Dispose(). I use webdriver from C# against Chrome, IE and FF, locally and remotely. While calling close before dispose is only necessary for IE, it doesn't do any harm with the other browsers.
You can also just kill the process:
Windows:
taskkill /f /im iexplore.exe
taskkill /f /im firefox.exe
Related
I am trying to run functional tests with intern for Chrome and Firefox.
First, Chromedriver would not wait long enough for the page to load and element transitions to end and become visible, so I added sleep()'s in a few places and used pollUntil() to wait for the initial page load. None of this was necessary for Firefox.
I am able to run my tests on either Firefox, which all pass, or Chrome, which all pass half the time. But if I list both browsers in my Intern configuration, Chrome will fail all tests, the Chrome window will be frozen, and the chrome and chromedriver processes will remain running, detached from selenium webdriver process when I stop the webdriver from command line. The error I usually get from webdriver if I wait long enough is
Exception: timeout: Timed out receiving message from renderer: 600.000
I am running local selenium-server-standalone-2.45.0.jar and chromedriver v2.16 (Chrome v44, up to date) with Intern 3.0, on Windows7 64.
From what I've read, Chrome has issues with getting the active window, and when Firefox pops up, the Chrome processes are lost. I don't know if that would be an issue with the Firefox window or just other Chrome windows, though. Maybe it's bugging out when get() happens. Or just not loading all the way.
Is there anything I can do to run them together? Or will I have to run each browser separately until/if the chromedriver issues are taken care of? Any other suggestions? Thank you.
How can i execute a command prompt command from ie9?
I know that this:
file:///c:\windows\system32\cmd.exe
loads it up but how to add a command to that?
The IE is not actually execute the command, is just transfer it to the windows shell - meaning that Microsoft have merge IE with Windows Shell to make the user interface more friendly - so calling this from the url, you are not actually do something with the browser.
This commands may execute only interactivity on the browser url and can not be call them programmatically for obvious reasons... like that:
file:///c:\windows\system32\cmd.exe del c:\*.*
I have currently found a way to place the currently installation of Internet Explorer into kiosk mode using asp.net and VB
System.Diagnostics.Process.Start("iexplore", "-k " & "http://www.google.co.uk")
the "-k" parameter is the command that puts the browser into kiosk mode, however, other browsers such as chrome will only put the new instance of the page into another tab and firefox just opens the browser without loading the window.
I need to know what commands to pass so that chrome and firefox will respond in the same way as IE.
Many thanks
Chrome browser can do KIOSK mode with this command.
chrome.exe --chrome-frame -kiosk "your web page".
The good thing with Chrome is that you can build apps that can use the webkit animation and they look great for a KIOSK type applications.
It sounds like you might be interested in Windows Steady State, it's discontinued and doesn't run on win 7, but if you have XP or vista, it will let you lock down the PC nice and tight. This way you can restrict the use of programs to browsers you want (if you can't lock down chrome and ff) and on a reboot, it will clear any changes to the PC, basically returning you to a clean state status
Read more here: http://en.wikipedia.org/wiki/Windows_SteadyState
im encoutaring some wierd behaviuor with the ChromeDriver on Selenium 2.0.
i have a test suite that consists of about 20 tests.
when i run the test individualy, they all work fine. both on firefox and chrome.
though when i run the entire suite on chrome i get a JVM Bind Exception telling me the address is already in use.
the thing is that the first 2-3 tests pass, and it only happens after them.
maybe OS is having trouble recycling processes?
the suite works perfectly on firefox...
any ideas?
i use window xp 32bit OS.
thanks
try calling "webDriver.quit()" method after the end of each test. Selenium 2 is known to have this bug of exhausting the ephemeral ports, and the above piece of code should get some relief. I tried it, and it does close some ports.
Thanks,
Prakash.
I create a asp.net page and test the code in debug mode step by step.
I always think that the code will stop running after I click "stopping debugging" in VS2008 when I test it in IE because the IE closes immediately.
Today, I use Firefox to test it. I find that the code still executes continuously after I click "stop debugging".
I want the code stop running immediately even in FF.
What should I do?
this happens in vs2010 also.
solution is to goto: Debug menu and choose Terminate All
Stop the web server from the task bar, assuming you are using Cassini. It will stop the debugger and the web site itself.
I imagine you are, with IE, just 'running' the project, and IE opens immediately? And with Firefox, you open firefox manually, and navigate to the appropriate site?
The difference is that with running it, Visual Studio will close the browser when you stop debugging. In Firefox, because Visual Studio didn't open the browser, it won't close it.
Does that make sense?
Either way, the code still "exists" in both cases, and only runs when it's executed.