Hi,
In my application, when i launch the application(starts with SplashActivity), and if the user is not signed in, it will take to login page, once logged in takes to home page(HomePageActivity).
For this what i am doing is, i am manually logging into the application, and in script i am trying to start HomePageActivity like
driver.startActivity(“my app pkg name”,“HomePageActivity”).
When i run my script the application starting from scratch(starting from login) it always taking to “SplashActivity”.
Following is the code:
AndroidDriver driver;
String strPackageName="pkg name";
String strActivityName=".Activityname";
String strApkFilePath="app path";
public void launch360App()
{
File objFile=new File(strApkFilePath);
DesiredCapabilities capabilities=new DesiredCapabilities();
capabilities.setCapability("deviceName", "Testing");
capabilities.setCapability("app", objFile.getAbsolutePath());
try
{
AndroidDriver driver=new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);
startActivity(strActivityName);
}
catch(Exception e)
{
e.printStackTrace();
}
}
public void startActivity(String strActivityName)
{
driver.startActivity(strPackageName, strActivityName);
}
Where i am doing wrong? How to overcome it?
Thanks in advance,
Uday