Selenium RC runs pages through a proxy which partly circumvents the same origin issue however support for
switching domains is currently experimental.
Having written our test we are almost ready to run it, however since it relies on the Selenium RC Server
that needs to be downloaded from http://www.openqa.org/selenium-rc/download.action and started using:
java -jar /path/to/server/selenium-server.jar
Once the server is running successfully, we are ready to run our test
Licensed to Menshu You
Zend Framework in Action (Ch01) Manning Publications Co. 13
Figure 10.6 Running our Selenium example unit test
Great! It passed. Now that our selenium test is written as a PHPUnit unit test we can continue adding tests
and incorporating them as part of an overall test suite that can be run from a single command.
10.3.3 Functional testing with Zend_Http
As the manual states "Zend_Http_Client provides an easy interface for performing Hyper-Text Transfer
Protocol (HTTP) requests." At its most basic level that is what a web browser like Firefox is and with that in
mind listing 10.10 shows an example of the tests we did with Selenium rewritten to use Zend_Http_Client.
Listing 10.10 Our Selenium test rewritten to use Zend_Http
set_include_path(get_include_path() .
Pages:
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300