Reputation: 875
I need to find the border color of a button the HTML properties of the button is like follow
<input class="BUTTON" type="button" title="Add Link" value="Add Link" name="ADD_LINK"/>
and CSS properties are as follow
background-color: transparent;
border: 0 solid #EACCAE;
border-radius: 2px 2px 2px 2px;
height: auto;
padding-bottom: 1px;
vertical-align: text-top;
I am using following code for getting border
property
String sColor = driver.findElement(By.xpath("//input[@value='Add Link' and @type='button']")).getCssValue("border");
but its not returning any value. At the same place when I am trying to get the background-color property with code
String sColor = driver.findElement(By.xpath("//input[@value='Add Link' and @type='button']")).getCssValue("background-color");
it's returning transparent.
Can anyone will please suggest me why I am not getting border property
or provide me solution for this.
Thanks
Upvotes: 1
Views: 3676