3

Since the version of Selenium that we're currently using with PHPUnit does not appear to be compatible with versions of Firefox beyond version 42, we need to be able to have our tests check the version of the installed Firefox in case someone upgraded it and have it let us know that that's the issue as to why the tests failed.

Does anyone know how we can get the browser version? (Note: This is not a duplicate of this question, as we have do do it within the PHPUnit framework, and that question is about a Python solution that works directly with Selenium.)

6
  • what output do you get using this to work : print $web_driver->getBrowser(); ? Commented May 18, 2016 at 19:56
  • We don't have a variable called $web_driver defined. Our code is based on a class called PHPUnit_Extensions_Selenium2TestCase, and when I set the return value of $this->getBrowser() to a variable and debug it, the variable contains 'firefox'. No version number, just the browser name. Commented May 18, 2016 at 20:47
  • there are two ways stated here : groups.google.com/forum/… does any help? Commented May 19, 2016 at 4:32
  • could give this a try, $this->capabilities->getVersion() seems relevant Commented May 19, 2016 at 4:34
  • No can do. capabilities doesn't seem to be a member of $this. There's a method called getDesiredCapabilities(), but that just seems to return an empty string. Commented May 19, 2016 at 15:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.