How to return value of a Property in a query

Dear All,

Could you please enlighten me, how can I return the value of a single property within my query?

app.Query (c => c.Id ("list-of-items").Child().Child().Child(2).Child().Child().Child(0).Child(4));

... gave 1 results.
[
[0] {
Id => null,
Description => ">",
Rect => {
Width => 222,
Height => 99.9,
X => 22,
Y => 1,
CenterX => 1,
CenterY => 1
},
Label => "Abc",
Text => "Abc",
Class => "UILabel",
Enabled => true
}
]

I am struggling to pull out the "Abc" from here.
app.Query (c => c.Id ("list-of-items").Child().Child().Child(2).Child().Child().Child(0).Child(4).Marked("Abc"));
does the trick, but
1) There might be anything as a value, so I need my test to be able to pull it out on it's own, without any hard coded strings. So ideally I want it to search for a first (and only in this case) "Label" within this Child.
2) I need just the value "Abc" as a String that my query returns. I will want to save it as variable and use for asserts later on

Many thanks if someone can guide me in the right direction!

Best Answer

Answers

  • AigarsAigars USMember

    Thank you a lot!

Sign In or Register to comment.