Selenium windows remain open after test failure.

336 views
Skip to first unread message

tko...@pictage.com

unread,
Sep 20, 2011, 4:21:52 PM9/20/11
to Fitnium
So I've encountered the following problem. Recently one of the guys
in my department setup Fitnesse in a VM and on a server the department
can use. Previously I was just trying it on my local machine. Well
one problem with doing this is when tests run and fail, a selenium
window is left open on the VM. After a few weeks of running one of
the guys logged into the VM and noticed there was a ton of Firefox
windows open.

Is there a way to configure selenium RC to close the windows on a test
failure? When running locally (which is where I run and debug tests
so I can see the selenium window) it's helpful to leave the window
open when an error occurs. But when running on a server the
department is using it would really help to have | close the browser
| still execute after a test failure. Is this possible through
Fitnium or is this there some config that has to be done to Selenium
RC?

-Tom

Keith Sterling

unread,
Sep 21, 2011, 3:45:11 AM9/21/11
to Fitnium
Interesting, are you calling | close the browser | at the end of the
script to clean up ?

What is the cause of the fail is it validation fail or a selenium/
fitnesse exception

Fitnesse validation doesn't stop the script running, so I am guessing
you are getting some sort of exception

tko...@pictage.com

unread,
Sep 21, 2011, 11:49:04 AM9/21/11
to Fitnium
Yes, that is exactly what's happening. For example... if a element
isn't found on a page the test will fail with an exception. This isn't
an assertion. It's just something like a "click element" command. I
run into this a lot while trying to stabilize my tests. Specifically
the pages with AJAX calls. Most times they seem to run ok on my local
box. But only after a week of running in our CI setup do we find that
they aren't 100% reliable. Our site really isn't set up to play nice
with Selenium. =) Anyway, It never continues the rest of the commands
in the Fitnesse page and never hits the last command, close the
browser. I guess what I'm asking is if there is a way to have it run
a teardown of everything even when an exception occurs.

Enix Shen

unread,
Sep 21, 2011, 4:08:34 AM9/21/11
to fit...@googlegroups.com
you need call |close the browser| in tearDown, which means browser will be closed whatever tests fail or pass

--
You received this message because you are subscribed to the Google
Groups "Fitnium" group.
To post to this group, send email to fit...@googlegroups.com
To unsubscribe from this group, send email to
fitnium+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/fitnium?hl=en

Fitnium is hosted at http://www.magneticreason.com/tools/fitnium/fitnium.html

Enix Shen

unread,
Sep 22, 2011, 12:36:17 AM9/22/11
to fit...@googlegroups.com

Keith Sterling

unread,
Sep 22, 2011, 3:44:27 AM9/22/11
to Fitnium
Yes that would be the best solution, call | close the browser | in the
TearDown fixture

Might be time to update the documentation with some common patterns

On Sep 22, 5:36 am, Enix Shen <enix12e...@gmail.com> wrote:
> Here is the answer to your question.
>
> http://fitnesse.org/FitNesse.SuiteAcceptanceTests.SuiteResponderTests...

tko...@pictage.com

unread,
Sep 22, 2011, 10:18:06 AM9/22/11
to Fitnium
Ok. That's got to be the problem. I don't have tests set up with a
page header or footer right now. My close browser call is just at the
end of each individual test page. I briefly looked over headers and
footers when trying to learn all this but thought I wouldn't need
them. Looks like I will after all.

-Tom

Enix Shen

unread,
Sep 22, 2011, 10:44:08 PM9/22/11
to fit...@googlegroups.com
If you don't have tests set up with a page header or footer, another solution is  adding |close the browser| at the end of your tests , and using |set stop on error|false| at the beginning of  tests.


-Tom

Reply all
Reply to author
Forward
0 new messages