Automating tests that require switching apps on iOS

I’m automating tests in iOS real devices using, but right now i’m stuck.
I need to:

  • open my app
  • do some work
  • launch safari
  • navigate to a website

I’ve been reading about to do this and so far i’ve only read that it can’t be done on iOS because of a limitation on apple’s framework, although most of the posts i’ve read are a bit old.

Does anyone have a way to handle this? Or can redirect me to a post in case this has already been answered :stuck_out_tongue:

This is what came up when I was looking for a solution for this. I couldn’t use it because it reset the session (and I needed the session), hope it does the job for you

	DesiredCapabilities newCapabilities = capabilities; //old capabilities
	newCapabilities.setCapability("bundleId","com.apple.AppStore");
	
	driver = new IOSDriver<>(new URL(hubURL), newCapabilities);
	driver.closeApp();

@tmateus do you need launch browser on phone? or maybe you can launch on machine where tests are running and check e.g. some email and took data from it?

@Aleksei It has to be launch on the iphone. :frowning:

If it resets the session it probably won’t work for me either. But i’ll give it a go. :slight_smile: