How do I run a PHPUnit Selenium test without having a new browser window run for each function?

前端 未结 5 1832
逝去的感伤
逝去的感伤 2021-01-13 05:06

I am trying to run a selenium test case using PHPUnit. And the first thing I do is trying the login function, this works perfect but then I want to run a function to check i

5条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-13 05:35

    To share browser sessions in Selenium2TestCase, you must set sessionStrategy => 'shared' in your initial browser setup:

    public static $browsers = array(
        array(
            '...
            'browserName' => 'iexplorer',
            'sessionStrategy' => 'shared',
            ...
        )
    );
    

    The alternative (default) is 'isolated'.

提交回复
热议问题