2

My question might sound very odd to you all but just wondering if this is possible for us.

Okay so I have written 10 cases for my login page in selenium using C# .net. But they take quite a lot of time to run one by one . SO I was wondering of there is a way that I can run few cases like 3-4 or may be more cases together . Like As I click on Run Selected Test it runs 3 cases together and then 3 and 3 and so on cause right now I have these 10 only but in future these cases might go upto 150 or something. SO just wondering if this is possible.

Any help will be much appreciated.

  • Rather than running multiple testcases at once, it might be possible to speed them up. If you have any sleep() calls, replace those with explicit waits to cut down on waiting time; and try running it in a headless browser to make it go faster; I recomment PhantomJS. – Vince Bowdren Apr 16 '15 at 16:38
  • Hey Vincebowdren , thanks a lot for replying I have used sleep only where my test were failing cause I was validating some messages rest everywhere else have used implicity wait ....Though thanks for recommending the Browser Idea will definitely give it a try. – piyush jolly Apr 16 '15 at 17:01
  • Good luck with that - but definitely replace those sleeps with explicit waits. They'll do the job more reliably, and never waste any time when the browser runs quickly. – Vince Bowdren Apr 16 '15 at 17:02
  • Cool just replacing that only ....thanks for the suggestions buddy..... – piyush jolly Apr 16 '15 at 17:08
1

Most test runners support running tests in parallel. I am not really into C#, but have a look at these posts:

Seems other SO users have had good experience with the Gallio test runner for .Net: https://stackoverflow.com/questions/3840028/parallel-testing-with-selenium-grid-using-c-sharp-unit-tests

Although it should be possible to run more then one test on a single machine. After you are getting more and more tests, you will want to run them for each check-in with a continuous integration / build server against a Selenium Grid or a cloud grid like SauceLabs to speed up things even more.

  • Hey Niels thanks for replying . Will definitely give a try to your suggestion. Lets see which one works for me.... – piyush jolly Apr 17 '15 at 12:58
1

I used NUnit originally when I wrote my C# cases. Turns out NUnit did Not support parallel running of cases.

There is however PNUnit which does do what you want(now integrated into the latest NUnit but is still documented as PNUnit). There is some documentation and examples here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.