selenium automation test in Linux problem: firefox can't be closed automatically
I am running automation testing for web GUI in Linux by selenium (selenium RC). In fact, I can run selenium automation test in windows, the results are fine and firefox can be closed automatically after test is finished. But when I put selenium test in linux, I found firefox can't be closed automatically after test is finished. I know the test script will call tearDown
function by default, so firefox should be closed. But why in Linux, firefox can't be shutdown automatically?
To dea开发者_运维问答l with this problem: I override the tearDown function like below:
public void tearDown() throws Exception
{
selenium.click("link=Logout");
super.tearDown();
}
But in Linux, firefox still can't be closed.
Could anyone help me with this problem? How to make firefox close itself after test finished? P.S: so far, I haven't found the way to close firefox, and by the way, I use the parameter -firefoxProfileTemplate to launch selenium-server.jar, because my web GUI is https.Problem solved: that is because of my firefox. This is occurring because Selenium wants to start the FireFox binary directly, rather than delegate to the normal launch script. Before checking for "firefox" (which is a script on many installations), it checks for "firefox-bin". But I set my firefox to start by firefox not by firefox-bin. More details could be found at: Selenium not working with Firefox 3.x on linux
Calling the stop()
function should shut down the browser. If it's not, check to see whether you are using -browserSessionReuse
when starting the server.
精彩评论