Hi !
I’m tring to test my multiplatform app (Android,iOS,Windows App) with Appium.
I wrote the test code in java and currently this test work only on Android.
What do you suggest to write a single test that with few changes can works well on iOS,Android and Windows App ?
1- I have to instantiate a different driver in base of the platform under the test
2- I have to find the element on the screen, but on Android I found the element by id, on iOS and WIndows ??? In what way can i set the id on iOS and windows app ?
3- I have to write a different method to switch to webview context in base of the platform under the test
p.s : on windows in what way can I change to webview context ? Currently on UWP I can’t test the webview
Assuming your app looks and feels the same on both platforms, I would recommend adding an abstraction layer between the tests and appium that calls correct library.
If you implement the page/screen object model, you can have the pages objects handle this operation.
As for webview context, verify that your product has setWebContentsDebuggingEnabled set to true
Thanks I’m studying now the page/screen object model
Off topic : are there some tutorial where is explained how to switch to webview context on window uwp ?
@willosser Cuttently when I try to switch to webview context , the server gives to me this error : > WinAppDriver::CommandHandler::Session::HandleCommandAsMidPoint - Command context is not recognized
PageFactoryModel would be a good approach to write same scripts for multiple platforms. There might not be many resources available for windows unfortunately. Also please see that you use proper setup when working with multi pratform testing (example - on Windows machine, you can test only Android. But on Mac, you can test both Android and iOS). Not sure about Windows, as I haven’t worked on it yet.