Hi Team, i have a requirement where i need to verify the spacing of the results is 32PX or not. can you please help how to do it?
Try using Get attribute activity for this.
Type the name of the attribute you want to extract e.g., "class" , "style" , "src"
@Madhups Use get Attribute activity , then select your target element (the green box or outer div).
In Attribute Name, type: “css:padding-top”. Output of this activity will give you value.
You can check as below
OutValue.Trim.ToLower = “32px”
You first indicate it in ui explorer and check if you find any relavant attributes..mostly these are controlled from CSS
cheers
i already tried using get attribute but no value is giving me the padding details
Hi shabbir, green box is highlighted because in the inspect i selected that place. Also i used the get attribute already but nothing is giving me the padding details and this css:padding-top name is resulting me null value
Hi Anil, yeah i checked in UI explorer CSS is not giving me the padding details
In Get attribute activity, can you what all options are present in dropdown, see if anything is related to padding and check.
No shabbir i tried indicating different elements on the page but no result of padding details
we can use the following:
and can retrieve the CSS Properties for an element
If nothing is working, use javascript and extract the field.
You can use inject javascript activity.
(() => {
const el = document.querySelector(“[put-your-selector-here]”);
return el ? getComputedStyle(el).paddingTop : “”;
})();
This should work, give it a try.
