I am trying to have own customized MobileElement class that i can add more methods. For example I have a class named SamplePage and it contains below mobile element:
@iOSFindBy(accessibility = "Settings")
@AndroidFindBy(id = "Settings")
public MobileElement SettingsButton;
I use it in test case lets say as below:
samplePage.SettingsButton.click();
What I want to have is as below
@iOSFindBy(accessibility = "Settings")
@AndroidFindBy(id = "Settings")
public customisedMobileElement SettingsButton;
A test case with IsVisible() method or CopyText() method I have in customisedMobileElement class:
Assert.isTrue(samplePage.SettingsButton.IsVisible(), "not visible");
samplePage.LoginTextInput.CopyText();
Could you please share your ideas about how to do it?
First define the page as follow:
Then you can use this as following: