简体   繁体   中英

How to highlight webelement in selenium webdriver not using javascriptExecutor

I want to highlight web element using selenium web driver but i don't want to use JavaScript Executor for the same. if i am using java script executor my DOM is getting change. that is the reason i don't want to use it. is there any alternate way to highlight web element? please suggest me a way to do this. Thanks in advance

Please try this, I don't know whether this will change your DOM and framework.

          `JavascriptExecutor js = (JavascriptExecutor)driver;
            js.executeScript("arguments[0].style.color='red'", webElement);
            Thread.sleep(5000);
            js.executeScript("arguments[0].style.color='grey'", webElement);`

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM