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.)

Community
  • 1
  • 1
RobH
  • 1,607
  • 2
  • 24
  • 44
  • what output do you get using this to work : `print $web_driver->getBrowser();` ? – Naman May 18 '16 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. – RobH May 18 '16 at 20:47
  • there are two ways stated here : https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/selenium-users/nbSujBSc6q8/ttujUbwrnlQJ does any help? – Naman May 19 '16 at 04:32
  • could give this a try, `$this->capabilities->getVersion()` seems relevant – Naman May 19 '16 at 04: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. – RobH May 19 '16 at 15:55
  • Can you please add the version of Seleneium and PHPUnit to your question? Maybe at the end as details. And also some code examples of what you already tried and which didn't work for you. – hakre May 21 '16 at 22:12

0 Answers0