UI web activity question

Hi,
In my “findChildren” activity, how to set the filter for the following css property

Div>table>Thead>tr>th>a>span

This “span” has “colName” which I need to grab, that is all the column names. Not all of them have “colName”

Thanks a lot,

Hi,

Can you share screenshot of UiExplorer for the target element (Span)?

Regards,

@Yoichi
Cannot share. Thank you,

Would appreciate if pointers can be provided.

Hii @A_Learner ,
Can you please give a try by setting “Table” as your target element and in the property panel of the find children activity there is a Property called “Filter” There u provide

image

Can you check this and confirm?

Note : Provide property “Scope” as :- FIND_DESCENDANCE

Cheers,

6 Likes

Thank you @Jithesh_R

I am getting an element List. When I do element.Selector.Text I get similar to below.

html app=‘chrome.exe’ title=‘TestApplication’ />
<webctrl aaname=‘FirstName’ parentid=‘xxx’ tag=‘A’

But when I do getAttribute(“aaname”) is not working, because I need to get column name.

@A_Learner

Try for each ui element and explore the filter options

cheers

Thank you, I do not have this activity. UiAutomation Package v20.10.6

This works to get elements.
Still trying to get attribute aaname.

Thank you

@A_Learner

You can upgrade it …if you are not able to upgrade the. Use the activity from market place which is readily available

Else here is a vbcode for the same which you can use in invoke code

Create one inargument.- in_dt_listTable type- datatable
One out argument - out_str_html_table type - string

out_Str_HTML_Table = "<style>

table, th, td {

border:0.5px solid black; 
border-collapse: collapse;
}
</style>
 <body>"

out_Str_HTML_Table += "<table>" 
out_Str_HTML_Table += "<tr>"

For i As Integer = 0 To in_Dt_ListTable.columns.count -1

out_Str_HTML_Table += "<th>" + System.Web.HttpUtility.HtmlEncode(in_Dt_ListTable.Columns(i).ColumnName)+"</th>"

Next

out_Str_HTML_Table + = "</tr>"

For r As Integer = 0 To in_Dt_ListTable.Rows.count - 1

out_Str_HTML_Table += "<tr>"

For c As Integer = 0 To in_Dt_ListTable.columns.count -1

out_Str_HTML_Table += "<td>" + System.Web.HttpUtility.HtmlEncode(in_Dt_ListTable.Rows(r)(c).ToString) + "</td>"

Next

out_Str_HTML_Table += "</tr>"

Next

out_Str_HTML_Table += "</table>" 
out_Str_HTML_Table += "</body>"```

Hope this helps

Cheers
1 Like

Thank you! This is great!

1 Like

Hii @A_Learner ,
Can you please check the other attributes like “visibleInnerText” or “InnerText” instead of “aaname”

Thanks ,

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.