Android Tests. You can use the childSelector() method to nest multiple UiSelector instances. For example, the following

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Android Tests. You can use the childSelector() method to nest multiple UiSelector instances. For example, the following

Post by answerhappygod »

Android Tests. You can use the childSelector() method to nest multiple UiSelector instances. For example, the following code example shows how your test might specify a search to find the first ListView in the currently displayed UI, then search within that ListView to find a UI element with the text property Apps. What is the correct sample?

A. val appItem: UiObject = device.findObject( UiSelector().className(ListView.class) .instance(1) .childSelector( UiSelector().text("Apps") ) )
B. val appItem: UiObject = device.findObject( UiSelector().className("android.widget.ListView") .instance(0) .childSelector( UiSelector().text("Apps") ) )
C. val appItem: UiObject = device.findObject( UiSelector().className("android.widget.ListView") .instance( UiSelector().text("Apps") ) )
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!

This topic has 1 reply

You must be a registered member and logged in to view the replies in this topic.


Register Login
 
Post Reply