Using Selenium for testing on multiple browser versions

I was wondering if anyone is familiar with testing different browser versions using selenium. I know that you can specify which browser to check (using * firefox or * iexplore), but what if I had several versions of firefox or IE, and I wanted the test to run a specific version of the web browser, so in one IE7 will work in the test and the other may work against IE8.

Currently, my tests will always work against any version of the default browser that I installed. I understand that if I had selenium running on several machines, each of these boxes could have a different browser version, and that would solve my problem, but I would like to know if what I ask is possible (several browser versions by one machine).

Thank.

+5
source share
3 answers

In fact, you cannot have so many different versions of browsers on the same machine — you cannot have different versions of IE at the same time. IETester is an option, but not as good as having virtual machines with different versions of IE and FF.

- ,

+4

, . , . , . Selenium Grid - . IE6, IE7, IE8, FF Chrome . , .

+1

, :

FF3.6 FF4.1, , Selenium IDE FF4.1, FF3.6.17. :

. Add the environment variable DEFAULT_BROWSER as

  "*custom path/to/firefox 3.6/firefox.exe"

. $TESTS_SELENIUM_BROWSER= getenv('DEFAULT_BROWSER') ? ...

in php code

. write a test class like

class myTests extends  PHPUnit_Extensions_SeleniumTestCase{
 .... 
 protected function setUp()
    {       
        $this->setBrowser($TESTS_SELENIUM_BROWSER);
            ....
    } 

 }

hope this helps :)

+1
source

All Articles