diff --git a/lib/helper/WebDriver.js b/lib/helper/WebDriver.js index 573bad4a3..a4809f90d 100644 --- a/lib/helper/WebDriver.js +++ b/lib/helper/WebDriver.js @@ -777,10 +777,9 @@ class WebDriver extends Helper { * * *Appium*: supported only for web testing */ async grabHTMLFrom(locator) { - const res = await this._locate(locator, true); - assertElementExists(res, locator); - const elem = usingFirstElement(res); - const html = await elem.getHTML(); + const elems = await this._locate(locator, true); + assertElementExists(elems, locator); + const html = Promise.all(elems.map(async elem => elem.getHTML(false))); this.debugSection('Grab', html); return html; } diff --git a/test/helper/WebDriver_test.js b/test/helper/WebDriver_test.js index ea8ba3000..2f5d6be95 100644 --- a/test/helper/WebDriver_test.js +++ b/test/helper/WebDriver_test.js @@ -167,13 +167,13 @@ describe('WebDriver', function () { .then(() => wd.grabSource()) .then(source => assert.notEqual(source.indexOf('