-
Notifications
You must be signed in to change notification settings - Fork 10
Browser Testing
With testUI you can test browsers in mobile devices and computers just by changing the boolean value of a single variable:
Configuration.automationType = Configuration.IOS_PLATFORM|ANDROID_PLATFORM|DESKTOP_PLATFORM;
And then using:
open("url");
With this you will be able to open a web page in a computer device and navigate to the indicated url. By default it uses chrome but you can change that by setting:
Configuration.browser = "firefox", "safari", "edge", "ie"...
You just have to make sure your computer has these browsers installed.
In case you want to use a remote browser such as selenium grid, you just have to specify the url to this grid as follows:
Configuration.remote = "http://grid:4444/hub/wd"
testUI uses Selenide for computer browser automation, so you can check their methods in the official page Here. In case you don't need mobile automation, you should use Selenide framwork instead, since it is a less heavy framework and the methods are the native ones.
For mobile browsers, android only has chrome for automation and iOS devices only has safari. So in these cases there is no point on specifying which browser to use, they will always take one of them.
Then for Android you will call:
Configuration.automationType = Configuration.ANDROID_PLATFORM;
open("url");
And for iOS:
Configuration.automationType = Configuration.IOS_PLATFORM;
Configuration.iOSversion = "12.2";
Configuration.iOSDevice = "iPhone 6";
open("url");