UA Testing with Selenium and PHPUnit DPC 2013
-
Upload
michelangelo-van-dam -
Category
Technology
-
view
112 -
download
0
description
Transcript of UA Testing with Selenium and PHPUnit DPC 2013
![Page 1: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/1.jpg)
UA Tes'ng withSelenium and PHPUnitDutch PHP Conference 2013, Amsterdam
![Page 2: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/2.jpg)
2
• PHP Consultant• President PHPBenelux• Conference speaker
Michelangelo van Dam
![Page 3: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/3.jpg)
3
![Page 4: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/4.jpg)
Today’s goal
• Set up and use Selenium IDE• Record UA tests• Convert to PHPUnit• Run con'nuously•Mul' browser support
4
![Page 5: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/5.jpg)
5
⚠DISCLAIMERS E L E N I U M T E S T S A R E N OT A REPLACEMENT FOR REGULAR UNIT TESTING. THEY ONLY PROVIDE AN ADDITIONAL SET OF TESTS FOCUSED ON USER ACCEPTANCE AND USER EXPERIENCE TESTING.
For more information about unit testing, please see my other material on www.slideshare.net and www.speakerdeck.com. Search for “dragonbe”!
![Page 6: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/6.jpg)
User Acceptance
6
![Page 7: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/7.jpg)
7
“Acceptance testing is a test conducted to determine if the requirements of a specification or contract are met.”
-- source: wikipedia
![Page 8: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/8.jpg)
Checklist for web applica'ons
8
![Page 9: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/9.jpg)
9
Func'onal tes'ng
• Test func'onal requirements-‐ e.g. no access to profile without authen'ca'on
• Test UI elements on the web interface-‐ e.g. buQons, form elements, AJAX controls, …
![Page 10: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/10.jpg)
A word of cau'on!
10
• UA tests only test generated output-‐ not a replacement for unit tes'ng
• UA tests are heavily depending on DOM-‐ changes to the DOM might lead to failing UAT
![Page 11: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/11.jpg)
Browser support
11
![Page 12: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/12.jpg)
Selenium to the rescue
12
![Page 13: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/13.jpg)
Plugin for firefox
13
![Page 14: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/14.jpg)
Get the plugin (demo)
14
![Page 15: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/15.jpg)
![Page 16: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/16.jpg)
Let’s get started
16
![Page 17: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/17.jpg)
Pick a test case
17
![Page 18: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/18.jpg)
Issue #7
18
![Page 19: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/19.jpg)
Verify this issue on PROD
19
![Page 20: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/20.jpg)
20
![Page 21: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/21.jpg)
Fix the issue
21
![Page 22: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/22.jpg)
Run test to see it’s fixed
22
![Page 23: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/23.jpg)
23
![Page 24: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/24.jpg)
24
Save your test as .html
![Page 25: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/25.jpg)
It’s that easy!
25
![Page 26: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/26.jpg)
Automated Tes'ng
26
![Page 27: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/27.jpg)
PHPUnit to the rescue
27
![Page 28: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/28.jpg)
Export to PHPUnit
28
![Page 29: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/29.jpg)
The PHPUnit TestCase
29
<?phpclass Example extends PHPUnit_Extensions_SeleniumTestCase{ protected function setUp() { $this->setBrowser("*chrome"); $this->setBrowserUrl("http://www.theialive.com/"); }
public function testMyTestCase() { $this->open("/"); $this->click("link=login"); $this->waitForPageToLoad("30000"); $this->type("id=email", "[email protected]"); $this->type("id=password", "test1234"); $this->click("id=signin"); $this->waitForPageToLoad("30000"); $this->click("link=Test demo"); $this->waitForPageToLoad("30000"); $this->assertEquals("Done", $this->getText("xpath=//th[5]")); $this->click("link=[EDIT]"); $this->waitForPageToLoad("30000"); $this->assertTrue($this->isElementPresent("id=done")); $this->click("link=sign off"); $this->waitForPageToLoad("30000"); }}?>
![Page 30: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/30.jpg)
Change class name
30
<?phpclass Example extends PHPUnit_Extensions_SeleniumTestCase{ protected function setUp() { $this->setBrowser("*chrome"); $this->setBrowserUrl("http://www.theialive.com/"); }
public function testMyTestCase() { $this->open("/"); $this->click("link=login"); $this->waitForPageToLoad("30000"); $this->type("id=email", "[email protected]"); $this->type("id=password", "test1234"); $this->click("id=signin"); $this->waitForPageToLoad("30000"); $this->click("link=Test demo"); $this->waitForPageToLoad("30000"); $this->assertEquals("Done", $this->getText("xpath=//th[5]")); $this->click("link=[EDIT]"); $this->waitForPageToLoad("30000"); $this->assertTrue($this->isElementPresent("id=done")); $this->click("link=sign off"); $this->waitForPageToLoad("30000"); }}?>
class MarkTaskDoneTest extends PHPUnit_Extensions_SeleniumTestCase
![Page 31: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/31.jpg)
The PHPUnit TestCase
31
<?phpclass MarkTaskDoneTest extends PHPUnit_Extensions_SeleniumTestCase{ protected function setUp() { $this->setBrowser("*chrome"); $this->setBrowserUrl("http://www.theialive.com/"); }
public function testMyTestCase() { $this->open("/"); $this->click("link=login"); $this->waitForPageToLoad("30000"); $this->type("id=email", "[email protected]"); $this->type("id=password", "test1234"); $this->click("id=signin"); $this->waitForPageToLoad("30000"); $this->click("link=Test demo"); $this->waitForPageToLoad("30000"); $this->assertEquals("Done", $this->getText("xpath=//th[5]")); $this->click("link=[EDIT]"); $this->waitForPageToLoad("30000"); $this->assertTrue($this->isElementPresent("id=done")); $this->click("link=sign off"); $this->waitForPageToLoad("30000"); }}?>
protected function setUp() { $this->setBrowser("*iexplore"); $this->setBrowserUrl("http://www.theialive.com/"); $this->setHost('192.168.56.101'); $this->setPort(12666); }
![Page 32: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/32.jpg)
Meaningful method name<?phpclass MarkTaskDoneTest extends PHPUnit_Extensions_SeleniumTestCase{ protected function setUp() { $this->setBrowser("*iexplore"); $this->setBrowserUrl("http://www.theialive.com/"); $this->setHost('192.168.56.101'); $this->setPort(12666); }
public function testMyTestCase() { $this->open("/"); $this->click("link=login"); $this->waitForPageToLoad("30000"); $this->type("id=email", "[email protected]"); $this->type("id=password", "test1234"); $this->click("id=signin"); $this->waitForPageToLoad("30000"); $this->click("link=Test demo"); $this->waitForPageToLoad("30000"); $this->assertEquals("Done", $this->getText("xpath=//th[5]")); $this->click("link=[EDIT]"); $this->waitForPageToLoad("30000"); $this->assertTrue($this->isElementPresent("id=done")); $this->click("link=sign off"); $this->waitForPageToLoad("30000"); }}?>
32
public function testMarkTestAsDone()
![Page 33: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/33.jpg)
startSeleniumStandAlone.BAT
33
"C:\Program Files\Java\jre7\bin\java.exe" -jar "C:\Jar\selenium-server-standalone-2.28.0.jar" -port 12666
![Page 34: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/34.jpg)
Now run your tests
34
![Page 35: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/35.jpg)
![Page 36: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/36.jpg)
How it runs on the node
36
![Page 37: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/37.jpg)
![Page 38: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/38.jpg)
Advantages
38
• You can start tes'ng immediately• Even test “hard to test” kind of situa'ons•More nodes for parallel tes'ng• Tes'ng different browsers and placorms• Con'nuous Integra'on possible
![Page 39: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/39.jpg)
Next Steps
39
![Page 40: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/40.jpg)
Mul' Browser support
40
![Page 41: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/41.jpg)
Base TestCase
41
<?php
require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
class TestCase extends PHPUnit_Extensions_SeleniumTestCase{ //const TEST_HUB = '217.21.179.192'; const TEST_HUB = '192.168.56.101'; const TEST_PORT = 12666;
const USERNAME = '[email protected]'; const PASSWORD = 'test1234'; const BASURL = 'http://www.theialive.com';
public static $browsers = array ( array ( 'name' => 'Internet Explorer 8 on Windows 7', 'browser' => '*iexplore', 'host' => self::TEST_HUB, 'port' => self::TEST_PORT, ), array ( 'name' => 'Firefox on Windows 7', 'browser' => '*firefox', 'host' => self::TEST_HUB, 'port' => self::TEST_PORT, ), array ( 'name' => 'Google Chrome on Windows 7', 'browser' => '*googlechrome', 'host' => self::TEST_HUB, 'port' => self::TEST_PORT, ), );
protected function setUp() { $this->setBrowserUrl(self::BASURL); }}
![Page 42: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/42.jpg)
Base TestCase
42
<?php
require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
class TestCase extends PHPUnit_Extensions_SeleniumTestCase{ //const TEST_HUB = '217.21.179.192'; const TEST_HUB = '192.168.56.101'; const TEST_PORT = 12666;
const USERNAME = '[email protected]'; const PASSWORD = 'test1234'; const BASURL = 'http://www.theialive.com';
public static $browsers = array ( array ( 'name' => 'Internet Explorer 8 on Windows 7', 'browser' => '*iexplore', 'host' => self::TEST_HUB, 'port' => self::TEST_PORT, ), array ( 'name' => 'Firefox on Windows 7', 'browser' => '*firefox', 'host' => self::TEST_HUB, 'port' => self::TEST_PORT, ), array ( 'name' => 'Google Chrome on Windows 7', 'browser' => '*googlechrome', 'host' => self::TEST_HUB, 'port' => self::TEST_PORT, ), );
protected function setUp() { $this->setBrowserUrl(self::BASURL); }}
array ( 'name' => 'Internet Explorer 8 on Windows 7', 'browser' => '*iexplore', 'host' => self::TEST_HUB, 'port' => self::TEST_PORT,),
![Page 43: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/43.jpg)
Base TestCase
43
<?php
require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
class TestCase extends PHPUnit_Extensions_SeleniumTestCase{ //const TEST_HUB = '217.21.179.192'; const TEST_HUB = '192.168.56.101'; const TEST_PORT = 12666;
const USERNAME = '[email protected]'; const PASSWORD = 'test1234'; const BASURL = 'http://www.theialive.com';
public static $browsers = array ( array ( 'name' => 'Internet Explorer 8 on Windows 7', 'browser' => '*iexplore', 'host' => self::TEST_HUB, 'port' => self::TEST_PORT, ), array ( 'name' => 'Firefox on Windows 7', 'browser' => '*firefox', 'host' => self::TEST_HUB, 'port' => self::TEST_PORT, ), array ( 'name' => 'Google Chrome on Windows 7', 'browser' => '*googlechrome', 'host' => self::TEST_HUB, 'port' => self::TEST_PORT, ), );
protected function setUp() { $this->setBrowserUrl(self::BASURL); }}
array ( 'name' => 'Firefox on Windows 7', 'browser' => '*firefox', 'host' => self::TEST_HUB, 'port' => self::TEST_PORT,),
![Page 44: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/44.jpg)
Base TestCase
44
<?php
require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
class TestCase extends PHPUnit_Extensions_SeleniumTestCase{ //const TEST_HUB = '217.21.179.192'; const TEST_HUB = '192.168.56.101'; const TEST_PORT = 12666;
const USERNAME = '[email protected]'; const PASSWORD = 'test1234'; const BASURL = 'http://www.theialive.com';
public static $browsers = array ( array ( 'name' => 'Internet Explorer 8 on Windows 7', 'browser' => '*iexplore', 'host' => self::TEST_HUB, 'port' => self::TEST_PORT, ), array ( 'name' => 'Firefox on Windows 7', 'browser' => '*firefox', 'host' => self::TEST_HUB, 'port' => self::TEST_PORT, ), array ( 'name' => 'Google Chrome on Windows 7', 'browser' => '*googlechrome', 'host' => self::TEST_HUB, 'port' => self::TEST_PORT, ), );
protected function setUp() { $this->setBrowserUrl(self::BASURL); }}
array ( 'name' => 'Google Chrome on Windows 7', 'browser' => '*googlechrome', 'host' => self::TEST_HUB, 'port' => self::TEST_PORT,),
![Page 45: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/45.jpg)
Modify MarkTaskDoneTest <?php/** * Class MarkTaskDoneTest * * @group Selenium */require_once 'TestCase.php';class MarkTaskDoneTest extends TestCase{ public function testMarkTestAsDone() { $this->open("/"); $this->click("link=login"); $this->waitForPageToLoad("30000"); $this->type("id=email", TestCase::USERNAME); $this->type("id=password", TestCase::PASSWORD); $this->click("id=signin"); $this->waitForPageToLoad("30000"); $this->click("link=Test demo"); $this->waitForPageToLoad("30000"); $this->assertEquals("Done", $this->getText("xpath=//th[5]")); $this->click("link=[EDIT]"); $this->waitForPageToLoad("30000"); $this->assertTrue($this->isElementPresent("id=done")); $this->click("link=sign off"); $this->waitForPageToLoad("30000"); }}
45
Require the TestCaseand extend it
![Page 46: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/46.jpg)
Running test
46
![Page 47: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/47.jpg)
47
![Page 48: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/48.jpg)
Benefits
• run your tests on mul'ple browsers• detect flaws in specific browsers (e.g. IE6)-‐ adapt your apps to solve these flaws
48
![Page 49: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/49.jpg)
Mul'ple Node Setup
49
![Page 50: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/50.jpg)
The GRID
50
• Procedure-‐ centralized server (HUB)
-‐ commands clients (nodes) registered
-‐ and executes the tests
• Goal-‐ allow for automa'on
-‐ adding clients as you go
![Page 51: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/51.jpg)
Selenium Grid Setup
51
Selenium Testing
CI Server Windows"HUB"
Linux client"NODE"
CI executes tests
Windows HUB launchesSelenium node clients to execute tests
Windows Server collectsfeedback from the Citrixclient nodes and reportsback to CI Server
Windows client"NODE"
Mac OS X client"NODE"
Continuous User Acceptance Testing
![Page 52: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/52.jpg)
Star'ng the server [HUB]
52
"C:\Program Files\Java\jre7\bin\java.exe" -jar "C:\Jar\selenium-server-standalone-2.28.0.jar" -role hub -port 12666
![Page 53: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/53.jpg)
Star'ng the client [NODE]
53
"C:\Program Files\Java\jre7\bin\java.exe" -jar "C:\Jar\selenium-server-standalone-2.28.0.jar" -role node -host 192.168.56.103 -port 13666 -hub http://192.168.56.101:12666/grid/register
![Page 54: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/54.jpg)
Mul'ple nodes
54
![Page 55: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/55.jpg)
Problem
55
![Page 56: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/56.jpg)
Modify Base TestCase
56
<?php
require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
class TestCase extends PHPUnit_Extensions_SeleniumTestCase{ //const TEST_HUB = '217.21.179.192'; const TEST_HUB_WIN = '192.168.56.101'; const TEST_HUB_MAC = '192.168.56.1'; const TEST_HUB_LINUX = '192.168.56.102'; const TEST_PORT = 13666;
const USERNAME = '[email protected]'; const PASSWORD = 'test1234'; const BASURL = 'http://www.theialive.com';
public static $browsers = array ( array ( 'name' => 'Internet Explorer 8 on Windows 7', 'browser' => '*iexplore', 'host' => self::TEST_HUB_WIN, 'port' => self::TEST_PORT, ), array ( 'name' => 'Firefox on Mac OS X', 'browser' => '*firefox', 'host' => self::TEST_HUB_MAC, 'port' => self::TEST_PORT, ), array ( 'name' => 'Google Chrome on Linux', 'browser' => '*googlechrome', 'host' => self::TEST_HUB_LINUX, 'port' => self::TEST_PORT, ), );
protected function setUp() { $this->setBrowserUrl(self::BASURL); }}
![Page 57: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/57.jpg)
More informa'on
57
![Page 58: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/58.jpg)
seleniumhq.org
58
![Page 59: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/59.jpg)
phpunit.de
59
http://www.phpunit.de/manual/3.5/en/selenium.html
![Page 60: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/60.jpg)
Credits
60
• apple store: hQp://www.flickr.com/photos/jtjdt/3571748777• checklist: hQp://www.flickr.com/photos/alancleaver/
4439276478• flat 're: hQp://www.flickr.com/photos/anijdam/2468493546/• first place: hQp://www.flickr.com/photos/evelynishere/
3417340248/• gears: hQp://www.flickr.com/photos/wwarby/4782904694• steps: hQp://www.flickr.com/photos/ben_salter/1407168763• browsers: hQp://www.flickr.com/photos/richoz/3791167457• informa'on: hQp://www.flickr.com/photos/twicepix/
2650241408/• elephpant: hQp://www.flickr.com/photos/drewm/3191872515
![Page 61: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/61.jpg)
Contact
61
Michelangelo van DamZend Certified Engineer
email: [email protected]: michelangelovandamtwitter: @DragonBe
tel EU: +32 15 34 52 90tel US: 202 559-7401
www.in2it.be
facebook.com/in2itvof | @in2itvof
Contact us forConsultancy - Training - QA - Webdesign
![Page 63: UA Testing with Selenium and PHPUnit DPC 2013](https://reader038.fdocuments.in/reader038/viewer/2022102900/54c93dee4a795909448b4576/html5/thumbnails/63.jpg)
Thank you
63