Appium Java, How to use specific pageFactory requirement

248
January 29, 2018, at 3:18 PM

I have a pageFactory class:

public class screenFactory {
    @AndroidFindBy(id = "itemFilm")
    public List<MobileElement> listMovies;
    @AndroidFindBy(id = "tvTitle")
    public List<MobileElement> listTvTitle;
}

Each itemFilm contains tvTitle (and sometime it doesn't).

Question: how can I check this using only pageFactory?

Lets assume situation1:

screenFactory.listMovies.size() equals 6;
screenFactory.listTvTitles.size() equals 6;

then everything is fine!

Lets assume situation2:

screenFactory.listMovies.size() equals 6;
screenFactory.listTvTitles.size() equals 4;

then we have a problem, how to detect which elements of listMovies contains tvTitles as child and which of them don't ?

In other words, having two List<MobileElement>, is there a way to compare elements as MobileElement for Child/Parent feature ?

Problem comes from requirements not to use By.id("id") or other locators in main function but use screenFactory only !

If I use in screenFactory this:

@HowToUseLocators(androidAutomation = LocatorGroupStrategy.CHAIN)
@AndroidFindBy(id = "itemFilm")
@AndroidFindBy(id = "tvTitle")
public List<MobileElement> listTvTitle;

it doesn't work again, cos in situation#2 from above it will give me the same:

screenFactory.listMovies.size() equals 6;
screenFactory.listTvTitles.size() equals 4;
Rent Charter Buses Company
READ ALSO
Unit test a single processor implementation (java) in Kafka Streams?

Unit test a single processor implementation (java) in Kafka Streams?

The specific problem encountered is mocking context, state stores, and window objects pass into the function process

361
&#39;Google App Engine does not support the use of proxies&#39; error when connecting to Google Compute Engine proxy server

'Google App Engine does not support the use of proxies' error when connecting to Google Compute Engine proxy server

We have a Java 7 Google App Engine instance which we are trying to connect to an external APIBecause the API server requires whitelisted IP addresses for access, we have set up a Google Compute Engine proxy server with Squid installed (a solution proposed...

242
Netbeans Spring Boot Initilizr project: Unable to see jsp content in web browser

Netbeans Spring Boot Initilizr project: Unable to see jsp content in web browser

I am reading Spring in Action, 4th Edition by manning publications and Chapter 5 is about Spring Web AppI am trying to implement textbook example in Netbeans using Maven template Spring Boot Initilizr Project

281
What exactly is the leader used for in DelayQueue?

What exactly is the leader used for in DelayQueue?

I was trying to understand DelayQueue in javautil

185