Skip to content

How to catch Exceptions? #63

@Eddcapone

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions