Horje
Wait until an animation finishes - Selenium, Java Code Example
Wait until an animation finishes - Selenium, Java
public static ExpectedCondition<WebElement> steadinessOfElementLocated(final By locator) {
    return new ExpectedCondition<WebElement>() {

        private WebElement _element = null;
        private Point _location = null;

        @Override
        public WebElement apply(WebDriver driver) {
            if(_element == null) {
                try {
                    _element = driver.findElement(locator);
                } catch (NoSuchElementException e) {
                    return null;
                }
            }

            try {
                if(_element.isDisplayed()){
                    Point location = _element.getLocation();
                    if(location.equals(_location) && isOnTop(_element)) {
                        return _element;
                    }
                    _location = location;
                }
            } catch (StaleElementReferenceException e) {
                _element = null;
            }

            return null;
        }

        @Override
        public String toString() {
            return "steadiness of element located by " + locator;
        }
    };
}




C

Related
C first digit of integer Code Example C first digit of integer Code Example
allocating memory for 1Mb text file in C Code Example allocating memory for 1Mb text file in C Code Example
eliminare file in c Code Example eliminare file in c Code Example
With which of the following can you run code without provisioning or managing servers and pay only for the compute time consumed (there is no charge when the code is not running)? Code Exampl With which of the following can you run code without provisioning or managing servers and pay only for the compute time consumed (there is no charge when the code is not running)? Code Exampl
obby übersetzung Code Example obby übersetzung Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9