What should we use instead of getInnerHtml () and getOutterHtml () in Selenium?

So selenium is deprecated getInnerHtml () and getOutterHtml (), and in 3.0 beta they plan to completely remove functions. I have a check for this markup. So what should we use in their place? Why are they deleted? I am using transractor / webdriver.js with selenium.

+4
source share
1 answer

.getInnerHTML()and .getOuterHTML()can be replaced by .getAttribute("innerHTML")and, .getAttribute("outerHTML")respectively, and, I believe, for this reason they are out of date. It makes no sense to use special methods for these cases, while they can be easily obtained using the "get attribute" call.

Please note that getInnerHTML()and are getOuterHTML()no longer part of the Protractor public API .

FYI, here getInnerHTML()and getOuterHTML()methods of implementation - mainly extracting attribute values innerHTML, and outerHTML(although "outerHTML" there is a special case of treatment - when there is no attribute outerHTML).

, , getInnerHTML() getOuterHTML(), no-get-inner-outer-html ESLint eslint-plugin-protractor ( ).

+5

Source: https://habr.com/ru/post/1653336/


All Articles