Can anybody help me about how to use these two functions to get value of any CSS property.
If have a particular <img> tag as below
<img title="Title" alt="myTitle" src="A/B/C/xyz.png">
driver.getElement(By.tagName("img")).getAttribute("src") will get you the src attribute of this tag. Result - A/B/C/xyz.png
Similarly, you can get the values of attributes such as title, alt etc.
Similarly you can get CSS properties of any tag by using getCssValue("some propety")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With