Javascript 如何在阴影dom中验证文本颜色?
我试图验证ShadowDOM中元素的文本颜色Javascript 如何在阴影dom中验证文本颜色?,javascript,html,selenium,protractor,shadow-dom,Javascript,Html,Selenium,Protractor,Shadow Dom,我试图验证ShadowDOM中元素的文本颜色 expect(browser.executeScript("return window.getComputedStyle(document.querySelector(\"body > moo-shell > auto-app\").shadowRoot.querySelector(\"section > auto-config\").shadowRoot.querySelector(\"section:nth-child(2) &
expect(browser.executeScript("return window.getComputedStyle(document.querySelector(\"body > moo-shell > auto-app\").shadowRoot.querySelector(\"section > auto-config\").shadowRoot.querySelector(\"section:nth-child(2) > div > div:nth-child(1) > section:nth-child(2) > div > vaadin-format-number-field\").shadowRoot.querySelector(\"#vaadin-format-number-field-label-1\"),':after').getPropertyValue('color')")).equals('rgb(204, 0, 0)');
F[09:37:59] E/launcher - javascript error: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
我强烈建议在这里阅读量角器文档,或者在我有多个阴影根的地方快速学习量角器。如何添加多个阴影根?