I really wanted to open one instance of IE in my NUnit TestFixture and use that for the duration. This would save the huge huge cost of opening and disposing of WatiN's IE browser. As a sidenote it was a lot quicker in FireFox but since most users use IE best stick to that!
There were a couple of hurdles to jump to enable me to use just one IE browser for all my NUnit TestFixture's WatiN tests though.
1. Initialise and Dispose of IE at either end of the TestFixture
This is fairly obvious if you are familiar with NUnit. You just need to utilise the TestFixtureSetUp and TestFixtureTearDown attributes to initialise and dispose of your IE browser like so:[TestFixture] public class MyTests : IDisposable { IE Browser; [TestFixtureSetUp] public void Init() { Browser = new IE(); } [TestFixtureTearDown] public void Dispose() { if (Browser != null) { Browser.Dispose(); } } ...
TestFixtureTearDown
will run regardless of any fails in Assert
ions or even Exceptions so you can be confident that the browser will close on any unmaned CI machines.2. Solving the weird STA problem (in NUnit)
You need to add to your app.config to ensure the tests run in an single thread apartment (STA) so that the non thread safe Internet Explorer browser can run safely.I have written separately about how to solve the STA threading problem in Internet Explorer for WatiN.
The overhead of opening and closing the Internet Explorer browser should now be reduced to a one off. I have seen tests times of my NUnit powered WatiN tests reduce from 12 mins down to just 51 secs!
With nUnit you also have the SetupFixture if you have more than one class.
ReplyDeleteThanks. Great info Will T
DeleteThe overhead of opening and closing the Internet Explorer browser should now be reduced to a one off. heart internet coupons
ReplyDeleteMotifz Designer Lawn. 1, 2 & 3 Piece Unstitched Premium Embroidered Lawn 2019, Premium embroidered Lawn, Premium lawn, Premium lawn 2019, Motifz, Premium lawn in Pakistan. Shipping worldwide. Stitching option available.
ReplyDelete
ReplyDeleteشركة شحن عفش من المدينة لمصر شركة شحن عفش من المدينة لمصر
Its really great article..Thanks for sharing this useful information..
شركة شحن عفش من الرياض الى مصر
شركة شحن عفش من الدمام الى مصر
شركة ديكورات بالرياض
شركة دهانات في الرياض
I really like using Gmail but I can't solve my trouble without www.Gmail.com, I think this website are gonna be helpful to you.
ReplyDeleteBuy online wholesale printed candle boxes and packaging at easy prices and shipping worldwide, with 24/7 customer support. Get a free custom quote now!!
ReplyDeleteBuy online wholesale printed custom candle boxes and packaging at easy prices and shipping worldwide, with 24/7 customer support. Get a free custom quote now!!
ReplyDeleteBlackbird packaging provide you with any size, shape design, custom bath bomb boxes wholesale sooner than any other packaging competitor in the market
ReplyDeleteMake your daily life passionately amazing with Guwahati escort and call girl services.
ReplyDeleteRomance is not a simple factor that you can bargain with.
Escorts in Guwahati
Escort service in Guwahati
Explore the profiles of guwahati escorts, guwahati call girls, call girls in guwahati
ReplyDeleteand escorts in guwahati for female companionship in top rated hotels.
Get affordable escort services in guwahati hotels now.
College escorts in Guwahati |
Housewife escorts in Guwahati |
Assamese call girls in Guwahati |
Nepali call girls in Guwahati |
High profile escorts in Guwahati |
Russian escorts in Guwahati |
College call girls in Guwahati |
Call girl service in Guwahati |
Independent call girls in Guwahati
Independent escorts in Guwahati
Guwahati Escorts or call girls in Guwahati are those call girl who are rocking and
ReplyDeleteamazing in terms of better-quality sexual performance for the customer.
Guwahati escort
Guwahati escort service
Diya Roy is a premier escort agency in Guwahati that provides call girl services or
ReplyDeleteescort services in Guwahati hotels at cheap and affordable fixed rates
Assamese call girls in Guwahati
College call girls in Guwahati
Housewife escorts in Guwahati
Russian escorts in Guwahati
Model escorts in Guwahati
Nepali call girls in Guwahati
VIP escorts in Guwahati
Female Escorts in Guwahati
Independent Escorts in Guwahati
If you are frustrated in your life and looking for some changes, then it's high time.Make a plan and travel to Guwahati escort
ReplyDeleteand choose here Guwahati call girl service. It will remove your tension from life and make your life smooth.
Assamese call girls in Guwahati
College escorts in Guwahati
Housewife escorts in Guwahati
Nepali escorts in Guwahati
Escort services in Guwahati
We at Al-Fatah have perfected the floor care with the right variety of Vacuum Cleaners available under one roof. Al-Fatah is a One-Stop Shop for all your home appliances buying needs. Buy best variety of Vacuum Cleaners in Pakistan at Al-Fatah. Shop Vacuum Cleaners of Top & Genuine Brands in Pakistan at Al-Fatah now!
ReplyDeleteBlackbird packaging provide you with any size, shape design, wholesale cookie boxes sooner than any other packaging competitor in the market
ReplyDeleteBlackbird packaging provide you with any size, shape design, essential oil packaging boxes sooner than any other packaging competitor in the market
ReplyDeletePackaging town is a one stop solution for the short-run custom apparel boxes needs and supplies. At affordable prices. Request a free quote now.
ReplyDeleteBlackbird packaging provide you with any size, shape design, custom bottle neckers wholesale sooner than any other packaging competitor in the market
ReplyDeleteBuy women tracksuits online from ndure at easy prices delivered at your doorstep. Get free shipping
ReplyDeleteBuy t shirt for men online from Dshred at best prices delivered at your doorstep. Get free shipping
ReplyDeleteBuy toys online from Al-Fatah at best prices delivered at your doorstep. Get free shipping
ReplyDeleteBuy online toys in Pakistan from Al-Fatah at best prices delivered at your doorstep. Get free shipping.
ReplyDeleteYour blogs are amazing. Keep sharing. I love them Are you also searching for coursework help? we are the best solution for you. We are best known for delivering the best urgent assignment help.
ReplyDelete