Using the Selenium Server, is there a way to define a constant for the app being tested through Selenium? To be more specific, I’m working with an app built on CakePHP. I would like to have Selenium define a PHP constant for the app to use before the app runs such that this constant will only be defined when the app is being run through Selenium. Is there a way something like this could be achieved? Thank you much!
Share
I ended up just checking to see if the Selenium Server was running from within my program. To do this, I checked if the port the server runs on was open. I did this using the following code:
As long as this is done before you need to check the constant, then it should work fine.
WARNING: If the Selenium Server is not running this will cause the app to stall while attempting to contact the socket.