Currently, I am in the process of crafting a browser test with selenium-webdriverjs. However, I am facing an issue when executing the code snippet below; it throws back an Error:Error response: 13.
browser.waitForCondition('var element = document.querySelector(".selector"); var style = document.defaultView.getComputedStyle(element,null); style =' + btnColor ,timeout);
My objective here is to wait for a condition where I aim to extract a computed CSS style from an element identified through a CSS selector. Subsequently, I wish to compare this computed CSS style against a variable named btnColor. (Although I recognize that achieving the same outcome can be done using a Webdriver JS API method known as getComputedCss, my interest lies specifically in utilizing waitForCondition for this purpose.)
I seek guidance on the correct usage of waitForCondition to accomplish this task and insight into why the aforementioned code snippet is resulting in an error.
Your assistance is greatly appreciated!