How can I combine Queries?

Andrew Parra 0 Reputation points
2023-06-28T00:20:13.0733333+00:00

I've been struggling with Xamarin ever since I started using it. The queries are very restrictive and when you get to cross platform testing it's getting more and more difficult to manage.

My first question amongst several hundred is how can we build ontop of queries?

Lets say I'm using:

using Query = System.Func<Xamarin.UITest.Queries.AppQuery, Xamarin.UITest.Queries.AppQuery>;

I build a page query:
private readonly Query ElementQuery;

ElementQuery= x => x.Marked("Query");

However, I want to build on it in a method because I have multiple items marked with this tag and I want to search deeper into the it. How do I build on this query?

There is no documentation on this.

Query newQuery = ElementQuery.Marked("");

Query newQuery = x(ElementQuery) => x.Marked("");

Query newQuery = x=> x.Marked("");

Query newQuery = x=> ElementQuery.Invoke(x).Marked("");

What if I already Queried and found something and wanted to build ontop of that like selenium?

var result = app.Query(ElementQuery).First();

And then I wanted to build on that:

var secondResult = app.Query(result.Marked(""));

These would be EXTREMELY helpful if I can figure out how to do these. In Selenium/Appium alot of this was seamless, in Xamarin UITest everything feels very complicated.

Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
349 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.