November 01 2013

PHPUnit Selenium get url parameter

Tagged Under : ,

Just now I wrote PHPUnit test case to try get the url parameter with Selenium. In PHP use $_GET function, you can get all the URL parameter. But it doesn’t work in PHPUnit with Selenium.

To solve it was simple, used “$this->getLocation()” function to get current url and then used PHP “parse_url()” and “parse_str()” to get the parameter.