Please share if anyone used Selenium to get server side errors.
7
-
If you know error behavior in advance then you can specify in webdriver code.So in future if same error occur then your selenium web driver will indicate.Helping Hands– Helping Hands2015-02-25 05:49:52 +00:00Commented Feb 25, 2015 at 5:49
-
Here's the link which gives me php error: selenium.couponapitest.com/page-2.php. Could you please explain how can i handle this with webdriver code?. Thank youlearner– learner2015-02-25 05:55:06 +00:00Commented Feb 25, 2015 at 5:55
-
you define one common element which is in every page and then when load page at that time check that if you are getting that element or not.if not then there is some error on page.Helping Hands– Helping Hands2015-02-25 05:59:35 +00:00Commented Feb 25, 2015 at 5:59
-
But that could not help to find the specific error. E.g.- error could be due to 404 status code, php error etc. How can i be sure that it is a php error?learner– learner2015-02-25 06:05:20 +00:00Commented Feb 25, 2015 at 6:05
-
I do not think you can find specific using selenium.Still wait for other reply.May be some expert can help you.Helping Hands– Helping Hands2015-02-25 06:07:25 +00:00Commented Feb 25, 2015 at 6:07
|
Show 2 more comments
1 Answer
PHPUnit allows to add checks that are run before or after every test function. Just add a assertPreConditions() or assertPostConditions() to your test to see if there are traces of PHP failure.
See http://phpunit.de/manual/3.7/en/fixtures.html for some more details.
1 Comment
RedDragonWebDesign
Selenium is integration tests. PHPUnit is unit tests. I don't think you can use PHPUnit stuff for Selenium.