Source:
- What is the optimal method to temporarily disable CSS transition effects?
When testing JavaScript, I typically utilize JavascriptExecutor
, however, none of the aforementioned blogs shed light on how this can be achieved.
I attempted:
js.executeScript(".notransition {
-webkit-transition: none !important;
-moz-transition: none !important;
-o-transition: none !important;
-ms-transition: none !important;
transition: none !important;
}");
Unfortunately, this did not yield desired results for me.
Update:
Following the guidance provided by @AmerllicA, I tried the following:
public void turnOffCss () {
navigate("https://www.bureauofdigital.com");
js.executeScript("*, *:before, *:after {
-webkit-transition: none !important;
-moz-transition: none !important;
-ms-transition: none !important;
-o-transition: none !important;
transition: none !important;
-webkit-transform: none !important;
-moz-transform: none !important;
-ms-transform: none !important;
-o-transform: none !important;
transform: none !important;
}");
}