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

Add possibility to check condition of widget and widget elements if widget not present on screen. #625

Closed
HlebHalkouski opened this issue Apr 17, 2017 · 2 comments

Comments

@HlebHalkouski
Copy link
Contributor

HlebHalkouski commented Apr 17, 2017

Description

In the current implementation when we invoke any method of widget or widget elements, if widget not present on screen, throws NoSuchElementsException.

Environment

  • java client build version or git revision if you use some shapshot: 5.0.0-BETA7

Details

Example: we have class:

public class MobileBlock extends Widget {
    
@AndroidFindBy(id = "main")
public MobileElement element;

    protected MobileBlock(WebElement element) {
        super(element);
    }

    public boolean isDisplayed() {
        return getWrappedElement().isDisplayed();
    }
}

If we try invoke method isDisplayed in MobileBlock class when widget is not present we have NoSuchElementException.
Or try to check visibility of widget element we also have NoSuchElementException.

@mykola-mokhnach
Copy link
Contributor

The similar issue has already been closed as By Design in original Selenium project. Why should Appium change this behaviour?

@HlebHalkouski
Copy link
Contributor Author

@mykola-mokhnach Thank you for information. I agree with you.

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

2 participants