Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在阴影dom中验证文本颜色?_Javascript_Html_Selenium_Protractor_Shadow Dom - Fatal编程技术网

Javascript 如何在阴影dom中验证文本颜色?

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) &

我试图验证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) > 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'.

我强烈建议在这里阅读量角器文档,或者在我有多个阴影根的地方快速学习量角器。如何添加多个阴影根?