!!

Welcome to Selenium Webdriver Forum

As a web user you can read and search through forum content. Once you have registered and signed you can post topics, post replies, set up watch lists, modify forum settings, and use private messaging.

Author Topic: NUnit not a good fit for moving SeIDE to C# and SeServer  (Read 865 times)

Sparky

  • Web User
NUnit not a good fit for moving SeIDE to C# and SeServer
« on: April 01, 2012, 08:25:32 PM »
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

  • Web User
Re: NUnit not a good fit for moving SeIDE to C# and SeServer
« Reply #1 on: April 01, 2012, 08:25:47 PM »
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
 
On Dec 3, 11:57 am, Sparky <sparkyan...@gmail.com> wrote:
 

- Show quoted text -

Ross Patterson

  • Web User
Re: NUnit not a good fit for moving SeIDE to C# and SeServer
« Reply #2 on: April 01, 2012, 08:25:59 PM »
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
 

- Show quoted text -

Selenium Webdriver

Re: NUnit not a good fit for moving SeIDE to C# and SeServer
« Reply #2 on: April 01, 2012, 08:25:59 PM »

Brian Kitchener

  • Web User
Re: NUnit not a good fit for moving SeIDE to C# and SeServer
« Reply #3 on: April 01, 2012, 08:26:10 PM »
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
 
On Dec 3, 9:57 am, Sparky <sparkyan...@gmail.com> wrote:
 

- Show quoted text -

bis

  • Web User
Re: NUnit not a good fit for moving SeIDE to C# and SeServer
« Reply #4 on: April 01, 2012, 08:26:23 PM »
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?
 
On Tue, Dec 6, 2011 at 10:42 AM, Brian Kitchener
 <kitchener.br...@gmail.com>wrote:
 

- Show quoted text -

Sparky

  • Web User
Re: NUnit not a good fit for moving SeIDE to C# and SeServer
« Reply #5 on: April 01, 2012, 08:26:36 PM »
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

  • Web User
Re: NUnit not a good fit for moving SeIDE to C# and SeServer
« Reply #6 on: April 01, 2012, 08:26:49 PM »
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
 

- Show quoted text -

Krishnan Mahadevan

  • Web User
Re: NUnit not a good fit for moving SeIDE to C# and SeServer
« Reply #7 on: April 01, 2012, 08:27:02 PM »
You should be using the language capabilities that are available in
 java/•net to get this done.
 Selenium is for web automation
 

On Sunday, 18 December 2011, Kaustubh Joshi <kashu.jo...@gmail.com> wrote:
 > 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
 > On Wed, Dec 7, 2011 at 5:16 AM, Sparky <sparkyan...@gmail.com> wrote:
 
>> 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
 >> --
 >> 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.
 >> To post to this group, send email to selenium-users@googlegroups.com.
 >> To unsubscribe from this group, send email to
 

selenium-users+unsubscribe@googlegroups.com.
 >> For more options, visit this group at
 

http://groups.google.com/group/selenium-users?hl=en.
 > --
 > You received this message because you are subscribed to the Google Groups
 


"Selenium Users" group.
 > To post to this group, send email to selenium-users@googlegroups.com.
 > To unsubscribe from this group, send email to
 

selenium-users+unsubscribe@googlegroups.com.
 > For more options, visit this group at
 

http://groups.google.com/group/selenium-users?hl=en.
 
- Show quoted text -

 

Related Topics

  Subject / Started by Replies Last post
2 Replies
562 Views
Last post February 23, 2012, 07:25:57 PM
by Athira Kannarambil
16 Replies
1479 Views
Last post April 21, 2012, 01:20:18 AM
by SeleniumWebdriver Admin
3 Replies
727 Views
Last post April 15, 2012, 04:56:58 PM
by Gulshan Saini
2 Replies
362 Views
Last post May 01, 2012, 10:36:56 PM
by shw
1 Replies
778 Views
Last post May 03, 2012, 02:45:36 PM
by Luke Inman-Semerau
1 Replies
375 Views
Last post July 24, 2012, 10:57:46 PM
by SHANMUGAVEL_C
15 Replies
993 Views
Last post July 26, 2012, 04:21:07 PM
by dlai

Review www.seleniumwebdriver.com on alexa.com