Hello.
I'm testing a native app and currently I'm trying to press a button which opens a link in a google chrome window. What I want to do with this is make a simple getCurrentUrl and make a assertEquals and make sure the correct URL is opened.
From what I have understood I have to switch to the new webpage activity, I did it like this
//Clicking the link which redirects me to the webpage
WebPageLink.click();
//get the currentactivity when I open the link,
String activity = driver.currentActivity();
driver.startActivity(appPackage, activity);
String URL=driver.getCurrentUrl();
Assert.assertEquals(URL, "theCorrectUrl.com/example/test");
When I run this code I get Unable to launch the app: Error: Permission to start activity denied.
Maybe this isn't so strange because the startActivity isn't really the "startactivity" when you start chrome, but at the same time. I want to assert the current URL when I click the link and not when I start google chrome. Hope I made myself clear.
If I just make getCurrentUrl after clicking the link and dont change the startactivity I get "Not yet implemented. Please help us: http://appium.io/get-involved.html" .
So I'm kinda stuck, would appreciate all help. Cheers
Appium v1.4.16 , Java client 4.1.2, Android.