- when running test in local, use selenium webdriver to communicate with browser directly
- when running test remotely (grid or cloud), use DesiredCapabilites + RemoteWebDriver
- start selenium server as hub and node, single hub, multiple nodes, node register to hub
- distribute test over different platform, different browsers in parallel
- hub receive 'test' request with 'browser' and 'platform' information, and assign to node that has such capability
2. install selenium grid
- java -jar selenium-server-standalone-2.44.0.jar -role hub (install hub)
- java -jar selenium-server-standalone-2.31.0.jar -role node -hub http://localhost:4444/grid/register -maxSession 15 -browser browserName="chrome",version=ANY,platform=WINDOWS,maxInstances=15 -Dwebdriver.chrome.driver=lib\chromedriver.exe (install node)
3. maxInstance vs maxSession
- maxInstance (5 firefox and 5 ie in remote machine)
-browser browserName=InternetExplorer,version=9.0,maxInstances=5,platform=LINUX
- maxSession = 8 (any given time, total 8 sessions, 5ff3ie, 4ff4ie etc)
4. change test script and xml to add 'RemoteWebDriver', 'DesiredCapabilities', 'parallel', 'thread-count' etc
5. suggestions
- on node machine, at least 1GB memory for each browser instance
- driver instance quit after each test
- use the same version of 'selenium-server' on hub and node
6. advantage to run selenium testing on the cloud
- save time, tests run in parallel
- covers all platforms, all browsers and versions
- no need to scale-up
7. run selenium on Sauce Labs
- install Sauce Labs Jenkins plugin
- configure Sauce Labs username/access key
- configure a Jenkins job
8. bridged network, NAT, host-only network in virtual machine
- NAT: vm and host system in within the same NAT
- bridged: create another node in external physical network and vm receive its ip address
- host-only: create a new LAN within host system, only accessible within host

reference
1. selenium grid showing WebDriverException error
2. how to speed up test execution using selenium grid
3. setting up grid2 and working with it
4. selenium jenkins - how to do it yourself and the Sauce Labs advantage
5. configuring the jenkins Sauce OnDemand plugin
6. selenium grid 2
7. host-only, NAT and bridged network
No comments:
Post a Comment