I am using find children activity where I want to iterate through the H4 tag and get the value from it. While iterate through for each using get attribute I am getting blank data also. So is there any vb.net expression or way where I can declare if the value is blank then ignore the other should be written in excel.
@Saahil08
With A LINQ Statement it is easy to filter out the empty ones from the List returned from find children.
Lets assume text is in the text attribute:
Assign Activity:
Value: YourFindChildrenOutputVar.Where(Function (uie) not String.IsNullOrEmpty(uie.Get(“text”).ToString)).ToList
To: Variable of e.g. List(Of uielement)
Kindly Note: With this approach you dont need for each activity
Hi, I am unable to understand your code it looks little complicated. And I am using for each activity where I am iterating through a find children output and trying to get the content from a page using get attribute.
@Saahil08
Can you post a screenshot from your for each, would be helpfully for further guidance.
In for each yout can retrive the value from H4 via:
get attribute acitvity (text property)
or via Assign Activity uielementVarFromIteration.Get(“text”).toString
so you can check if H4 is blank by eg
String.IsNullOrEmpty(uie.Get(“text”).ToString)
or String.IsNullOrEmpty(YourH4TextVariable)
My statement from above is filtering for all non blank items in a oneliner and doesn’t need a foreach. Later you can process the filtered list in a foreach again and eg get content from a page