I want to check if the value of a style element is greater than a certain value (i.e.> 666px left?), But I cannot get the value.
Here is the HTML of the style I want to capture:
<pre><span id="da2c" style="left: 666px; top: 27px;"></pre>
I use this code to try to print its value, but it does not print:
System.out.print(driver.findElement(By.id("da1c")).findElement(By.cssSelector("span")).getAttribute("style"));
I need something like this:
if ((driver.findElement(By.id("da1c")).findElement(By.cssSelector("span")).getAttribute("style")).value> 700) { System.out.println("value exceeding") }
source share