Skip to content

How to catch Exceptions? #63

Description

@Eddcapone

I tried to load an element by class, but it was not found and I get

PHPWebDriver_UnhandledWebDriverError in WebDriverBase.php line 50:
Cannot find matching element locator to: class

How can I even catch this error and do something?

I tried it like this:

use PHPWebDriver_WebDriver;
use PHPWebDriver_WebDriverException;
use PHPWebDriver_UnhandledWebDriverError;

...

    try {
        return $this->driver->element($using, $value);

    } catch(UnhandledWebDriverError $exception) {
            exit("UnhandledWebDriverError: $exception");
    }

But the catch is not executed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions