Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to catch Exceptions? #63

Open
Eddcapone opened this issue Jul 16, 2018 · 1 comment
Open

How to catch Exceptions? #63

Eddcapone opened this issue Jul 16, 2018 · 1 comment

Comments

@Eddcapone
Copy link

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.

@Eddcapone
Copy link
Author

I had to use "PHPWebDriver_UnhandledWebDriverError" instead of "UnhandledWebDriverError "

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant