javascript - Get HTML Source of WebElement in Selenium WebDriverJS -



javascript - Get HTML Source of WebElement in Selenium WebDriverJS -

there similar question out there (an older 1 in python) 1 has js. testing using selenium in nodejs, mocha environment. i'd click on bootstrap dropdown , check html changes. i've tried following:

test.it('should click on header links', function() { var elem = driver.findelement(by.id('profile')); console.log(elem.getattribute('innerhtml')); console.log(elem.getinnerhtml()); });

both calls homecoming same thing.

{ then: [function: then], cancel: [function: cancel], ispending: [function: ispending] }

i plan feed html cheerio can check construction changes. appreciate help on this.

i able retrieve html string doing following.

driver.findelement(by.id('profile')).getattribute("innerhtml").then(function(profile) { console.log(profile); });

javascript selenium selenium-webdriver

Comments