Verify HTML Element within Another Element -- Watir WebDriver -
i'm looking best way validate element within element using watir webdriver. example: want verify span below is found within anchor contains it.
<a id="header-main-menu-home" href="/" class="tracked"> "home" <span class="arrow arrow-up"></span> </a>
i'm using location validation, not think sustainable.
any help much appreciated?
you can do:
browser.link(:id => 'header-main-menu-home').span(:class => 'arrow').present?
this check link contains span. works because locator of span remain within scope of link.
html watir watir-webdriver
No comments:
Post a Comment