Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

findElement error handling? #485

@mavdi

Description

@mavdi

How would I go about clicking a button if it exists and ignoring it if it doesn't?

this.ptor.findElement(this.by.linkText('/logout'))
     .then(function(element) {
      element.click().then(callback);
     })

isElementPresent won't do it for me, because I want to handle a case where the element is not present. Almost like

this.ptor.isElementNotPresent(someElement).then(callback);

Any sort of error handling on the promise? Any other way of doing this?

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