1

In my test suite, I open a single browser instance, run the test and close the instance. Open a new browser instance and repeat the same process.

While running in Opera -

  • If I use, driver.Close(), the testcase runs in 6 seconds but it still keeps a browser instance opened.
  • If I just use driver.Quit() or driver.Dispose(), it takes 31 seconds to run the same test case but it closes all the browser instances.

Why is that using Dispose?() or Quit() take such a long time. Is there a way where I can make it quicker and reduce the overall the time to run my test suite.

This drastic time difference can be seen only in Opera.

I'm using Opera V 40 with selenium 3.

Thanks.

Sudeepthi
  • 494
  • 4
  • 20

1 Answers1

1

Apparently, there are some bugs with the Opera Quit() method. Do you need to save this time for each test? Because Otherwise I'd suggest to tolerate the 25 seconds difference.

Anyways, to reduce this time you can Close() and then kill the Opera processes. This is not a good practice due to objects not being disposed and can cause the AppData folder to fill the hard drive. See here for details.

Community
  • 1
  • 1
Moshisho
  • 2,781
  • 1
  • 23
  • 39
  • I just mentioned that test case as an example. I have nearly 100 test cases, which in turn increases the time the test suite by 30mins. So I just wanted to find out is there a way or a workaround to make it work like all the other browsers. Thanks for the reply and giving some information regarding Opera. – Sudeepthi Dec 06 '16 at 09:44
  • How many times do you need to call quit() during that test suit? – Moshisho Dec 06 '16 at 12:25
  • I mentioned Quit() in TestCleanup(), so it calls after running every single test case. – Sudeepthi Dec 06 '16 at 15:17
  • Can't you use the quit in ClassCleanup instead? – Moshisho Dec 06 '16 at 18:07
  • Even I thought that might reduce a lot of time but I'll have more instances opened till the end.. Will try that and see how it works and will update here. Thanks – Sudeepthi Dec 07 '16 at 10:06
  • I tried with one class that has 5 testcases. In ClassCleanup(), I added both Quit() and dispose(). When I did a debug, it only closes the last session and I still have remaining 4 browsers opened after that. Don't know the reason but I still have browser sessions opened. – Sudeepthi Dec 07 '16 at 10:58
  • Why do you need to open a new browser for each test? Can't you run 1 by 1 on the same browser? – Moshisho Dec 07 '16 at 12:49
  • I tried like that but for some reason if a test stucks all the test cases failed. So I changed it back. – Sudeepthi Dec 07 '16 at 16:18