I have this these test and it opens up appium but fail to perform the test in getStartedPage . I would appreciate if someone could help out with this.
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.remote.MobileCapabilityType;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;
public class baseSetup {
public static void main (String [] args) throws MalformedURLException {
DesiredCapabilities cap=new DesiredCapabilities();
cap.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
cap.setCapability(MobileCapabilityType.DEVICE_NAME,"d8528de2");
cap.setCapability("app", "C:\\Users\\Tutu\\Downloads\\tutuApps\\base.apk");
AndroidDriver driver = new<WebElement> AndroidDriver (new URL("http://127.0.0.1:4723/wd/hub"),cap);
driver.manage().timeouts().implicitlyWait(100, TimeUnit.SECONDS);
}
}
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.pagefactory.AndroidFindBy;
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.PageFactory;
import java.util.concurrent.TimeUnit;
public class getStarted extends testPage
{
AndroidDriver<WebElement>driver;
public getStarted (AppiumDriver<WebElement>driver)
{
PageFactory.initElements(new AppiumFieldDecorator(driver, 100, TimeUnit.SECONDS), this);
}
@AndroidFindBy(id = "phone_number_edit_text")
public MobileElement enterPhone;
@AndroidFindBy(uiAutomator = "new UiSelector().text(\"Submit\")")
public WebElement submitPhone;
public WebElement enterPhone (){
return enterPhone;
}
public WebElement submitPhone() {
return submitPhone;
}
}
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.android.AndroidDriver;
import org.junit.After;
import org.junit.BeforeClass;
import org.openqa.selenium.WebElement;
public class testPage extends baseSetup {
AndroidDriver<WebElement> driver;
@BeforeClass
public static void baseSetup ()
{
baseSetup();
}
public void getStartedPage (AppiumDriver driver) {
getStarted getStarted = new getStarted(driver);
getStarted.enterPhone().click();
getStarted.submitPhone().sendKeys("078000000000");
}
@After
public void quitDriver ()
{
driver.quit();
}
}