NUnit not a good fit for moving SeIDE to C# and SeServer

39 views
Skip to first unread message

Sparky

unread,
Dec 3, 2011, 11:57:39 AM12/3/11
to Selenium Users
Currently using: SeIDE 1.13.0, SeServer 2.10.0, NUnit 2.5.10, VS 2010.

I've used SeIDE for almost two years and am now migrating tests to C#.
NUnit, C# and VS are new for me. I used to convert IDE to PERL and run
through SeServer but the Se folks have discontinued support for PERL.

SeIDE offers both assert and verify to check on screen elements. An
assert error will gen a message and stop the test. A verify error will
gen a message and continue in most cases. For example, if an element
is expectantly not found, verify will also halt the test. That is a
distinction that the Se folks coded into the IDE. (There may be good
reason for that but since there is no control logic in the IDE, a
better solution might have been to provide an optional/additional
command not to halt the test.)

The IDE can convert its html into C# to run via the SeServer and
NUnit. Unfortunately there isn't a one to one mapping of SeIDE
commands to C# & Se libs but it still does this modestly well. And
there is enough documentation and generous users available to share
their knowledge so that even a newbie like me can get it to work.
(Thanx :-)

The misfit between Se and NU is that NU isn't designed to handle long
tests with many Se asserts and verify's. NU will stop and fail the
test on the first assert that it sees and then move on to the next
test. Because of the way Se verify is converted in C#, NU will blindly
pass failing verify’s leaving the user to peruse the log for errors.

After converting the first 100 SeIDE tests, I've realized that NU's
Pass/Fail display can't be relied on to accurately reflect the SeIDE
flow. If I have to read the log after each run, then there isn't much
gain in using NUnit for this environment.

Note that I'm not maligning NUnit. It's just not a good fit with Se
tests.

Thinking out loud, Sparky

David T

unread,
Dec 3, 2011, 11:59:25 PM12/3/11
to Selenium Users
Hey Sparky,

Maybe one thing you could consider is using verifies, but persisting
any that failed until the end of the test where you could then fail
the test which would result in a more reliable indication from nunit.
Just a thought.

David

Ross Patterson

unread,
Dec 5, 2011, 8:54:15 AM12/5/11
to seleniu...@googlegroups.com
We write our Selenium tests in C# using the NUnit annotations and runner, and it works really well. I suspect the problems you're finding are really the fault of the Selenium IDE code that exports tests in C#+NUnit form. But rather than launch into a critique of that code and your comments, I'd like to suggest that you not even go there. For someone who's coming from a Perl background and who has no previous experience in C# and Visual Studio, I think you've chosen a path that offers you too many obstacles and not enough advantages.

Python would be a much better choice of a new environment, and the Python support in the Selenium Project is first-class.

Ross

Brian Kitchener

unread,
Dec 6, 2011, 1:42:18 PM12/6/11
to Selenium Users
I ran into a similar issue. The best solution was to develop my own
verification functionality and code it myself. However, this means
your tests won't be directly exportable from IDE format. You will
need to "fix" them. However, given the state of code that gets
generated it's really a good thing that you have to fix it, as it's
not very readable, or reliable.

Also, I would recommend Gallio/MbUnit has a far superior alternative
to nUnit. It offers many more features, such as the ability to record
and embed screenshots/video, advanced data driven testing features,
and the ability to mark a test as inconclusive.

You will save much time if you develop yourself a basic framework to
help resolve some of these issues. let me know if you need support or
help developing one.

Brian

bis

unread,
Dec 6, 2011, 2:00:54 PM12/6/11
to seleniu...@googlegroups.com
my question is why do you need to have steps in your tests that check on more than one thing? I think that when i write a test im not writing it to check on if an element on my way to get what i need to done or not is there or has the right text. i would write a test for that
1 test 1 assertion kind of thinking. 

I guess I don't understand why you need to have a bunch of verify and asserts. can someone explain this to me?



--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.


Sparky

unread,
Dec 6, 2011, 6:46:46 PM12/6/11
to seleniu...@googlegroups.com
Thanks to all that responded. My intent with the original post was more a statement of frustration than anything else. The issue in this particular situation is that I'm applying the wrong tool for the task at hand. I'm not unit testing. I'm doing end to end testing - browser ui -> db and back. Our app has many sections and there is one or more SeIDE test for each section. Each section has many user interactions. For instance, a user enters their customer's name and retrieves a customer profile. Each element in the profile must be checked, etc. Then there's profile editing, creation, delete, etc - the usual stuff.
SeIDE has worked well testing most aspects of our application. The use of PERL and C# are attempts to add control logic making the tests less brittle, more complete and even more automated. After support for PERL was dropped, C# was next in line because we have a .net application (aka I have devs to help :) and it's supported by Se. There are hundreds of SeIDE tests and I was hoping to easily convert them using Se's suggested practices and gain a nice GUI front end to run them all - NUnit. The conversion went smoothly. The results were a failure as described in the original post - passing failed tests.
So the search is back on. I'll try the suggestions mentioned.
Thanx, Sparky

Kaustubh Joshi

unread,
Dec 18, 2011, 5:20:03 AM12/18/11
to seleniu...@googlegroups.com, simon.m.stewart
Hi,

Can web driver or selenium RC supports fetching the data from the dbase instead of excel sheet?? dbase like Oracle....so that i can dynamically create new data and then can delete the same data..any idea?I m using Junit framework.
 
Regards,
K

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/FMtzS6rVW5wJ.

Krishnan Mahadevan

unread,
Dec 18, 2011, 9:50:54 PM12/18/11
to seleniu...@googlegroups.com, simon.m.stewart
You should be using the language capabilities that are available in java/•net to get this done.
Selenium is for web automation
Reply all
Reply to author
Forward
0 new messages