protected void validate ( WebElement element , SeleniumBrowser browser , TestContext context ) { validateElementProperty ( "tag-name" , tagName , element . getTagName ( ) , context ) ; validateElementProperty ( "text" , text , element . getText ( ) , context ) ; Assert . isTrue ( displayed == element . isDisplayed ( ) , String . format ( "Selenium web element validation failed, " + "property 'displayed' expected '%s', but was '%s'" , displayed , element . isDisplayed ( ) ) ) ; Assert . isTrue ( enabled == element . isEnabled ( ) , String . format ( "Selenium web element validation failed, " + "property 'enabled' expected '%s', but was '%s'" , enabled , element . isEnabled ( ) ) ) ; for ( Map . Entry < String , String > attributeEntry : attributes . entrySet ( ) ) { validateElementProperty ( String . format ( "attribute '%s'" , attributeEntry . getKey ( ) ) , attributeEntry . getValue ( ) , element . getAttribute ( attributeEntry . getKey ( ) ) , context ) ; } for ( Map . Entry < String , String > styleEntry : styles . entrySet ( ) ) { validateElementProperty ( String . format ( "css style '%s'" , styleEntry . getKey ( ) ) , styleEntry . getValue ( ) , element . getCssValue ( styleEntry . getKey ( ) ) , context ) ; } }
Validates found web element with expected content .