groovy - WebDriver: running tests in parallel -
i have system web-interface has login/password authorization. need come automated test involves running 100 tests simultenously. each test going use different username/userpassword pair. example, user1/password1, user2/password2, ..., user100/password100. after login, user supposed same operation.
due reasons, can't use system api , unit tests here. need come ui-based tests. type of browser (ff, ie, chrome) doesn't matter.
so want use webdriver. say, groovy. have no problems automating login , executing operation. , can parametrize them use different users/passwords. i'm wondering how organize running 100 tests simultaneously on same machine?. doable? there strategy/methodologies kind of thing proved successful? ideas?
thanks, racoon
i'm not providing answers here as ideas thinking on can done.
first, won't able run test locally. think happen if opened 100 tabs in chrome. system crash. set selenium hub & node system (called grid) can support 100 remotewebdriver instances. grid controller provides available drivers held nodes it's aware of. sauce labs 1 way of doing that.
now hard part comes creating tests spawn off many threads. here pseudo-code show easy way. i'm not sure kind of limitations there threads though. though want many, create 10 or threads @ 1 time won't work.
public void test() { threads (100) execute { try { spawn new remote web driver instance run test } { quit driver instance //in block since want driver close //even on assert fails or exceptions } } } if box can handle it, here linux/cygwin way of executing 100 or scripts @ same time. can write test if 1 test execute 100 times in parallel.
Comments
Post a Comment