Single browser session

524 views
Skip to first unread message

Al

unread,
Oct 4, 2013, 6:25:29 AM10/4/13
to co...@googlegroups.com
Hi

We have automated UI tests running via teamcity and as the number of tests grows they are running ever slower. That also create a problem that double clicks are slow they are in fact treated as two single clicks.There may be other causes for this behaviour which is another story altogether.

 I have been looking at the ways to improve the performance, one place I have been looking at is a hook class that glues Specflow and Coypu together. We are using BeforeScenario event to create new browser session. That means that for each scenario there is new browser/browser session created. It seems to me that most efficient way would be to run all the tests in a single browser session.

I have looked at the various event handlers and experimented but I have not managed to come up with a good solution. Is there any way to run the tests in a single browser session?

Your input will be greatly appreciated.

Adrian Longley

unread,
Oct 4, 2013, 6:42:03 AM10/4/13
to co...@googlegroups.com
On Fri, Oct 4, 2013 at 11:25 AM, Al <bego...@gmail.com> wrote:
Hi

We have automated UI tests running via teamcity and as the number of tests grows they are running ever slower. That also create a problem that double clicks are slow they are in fact treated as two single clicks.There may be other causes for this behaviour which is another story altogether.

There is an example of calling Selenium's doubleclick behaviour directly from coypu down the bottom of this thread. It might help. I didn't think it was that common, but if you create a github issue for adding this to the coypu API I'll try and look at making it a first class method. Meanwhile:

 

 I have been looking at the ways to improve the performance, one place I have been looking at is a hook class that glues Specflow and Coypu together. We are using BeforeScenario event to create new browser session. That means that for each scenario there is new browser/browser session created. It seems to me that most efficient way would be to run all the tests in a single browser session.

I have looked at the various event handlers and experimented but I have not managed to come up with a good solution. Is there any way to run the tests in a single browser session?

If you want all your tests to run in a single session then you will need a static instance of BrowserSession that lives for the duration of your test run. You could simply make your browser session variable static and create the instance lazily the first time it is accessed, or perhaps using the BeforeTestRun attribute.
 
Your input will be greatly appreciated.

--
You received this message because you are subscribed to the Google Groups "Coypu" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coypu+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Al

unread,
Oct 4, 2013, 7:03:58 AM10/4/13
to co...@googlegroups.com
Thank you for your input 

Yep I have been using native double click, we have some javascript interactions that require it. Everything works fine untill deployed on the build server where it slows down. 

Regarding the single browser issue - been through your suggestion I made variables static, and moved the initialization to the BeforeTestRun  event handler. First scenario runs OK, the next one looses the session settings - reverses AppHost to localhost and FireFox defaults.

There is now way to access SessionBrowser properties in order to fix this (or at least I have not found the way to do it), SessionBrowser is passed as a constructor argument.


Adrian Longley

unread,
Oct 4, 2013, 7:19:42 AM10/4/13
to co...@googlegroups.com
I'd have to see your code, can you share what you have for initialising the browser session please?


ravnica1 .

unread,
Oct 4, 2013, 7:39:17 AM10/4/13
to co...@googlegroups.com
I reverted everything to the repository, I was just playing with it. :-) 

I will do it during weekend or Monday and post it here.

Thank you Adrian

Richard Wilde

unread,
Oct 28, 2013, 9:49:38 AM10/28/13
to co...@googlegroups.com
Hi did you get anywhere with this?

I have tried without success to create a single session FOR all my tests but have failed miserably!

Thanks
Rippo

cykelka...@gmail.com

unread,
Nov 1, 2013, 2:49:33 PM11/1/13
to co...@googlegroups.com
I'm too using SpecFlow and for time saving reasons use the same Browser through the test suite. My coypu setup looks something like this:


I'm using a page object pattern for the actual specflow tests but basically they just access BrowserServer.BrowserSession.

(And sorry Liskov for the webdriver casting but I didn' find any coypu native way to remove all cookies)

Hope that helps.
Reply all
Reply to author
Forward
0 new messages