As there are a lot of us facing issues with Safari browser automation, I wanted to document the steps that
help the members to do the browser automation.
Pre-requisites:
a. Xcode installed on Mac OS X.
b. Device added to Apple developer program
c. Get SafariLauncher.app(https://github.com/budhash/SafariLauncher1.9k)
d. Launch the SafariLauncher.app on connected device from Xcode.
e. Install appium (IDE)
f. Download appium from github (https://github.com/appium/appium380)
g. Install ios-webkit-debug-proxy … use below command from terminal.
Install brew install ios-webkit-debug-proxya. Connect the device to your mac and verify the device is shown under Xcode
b. Launch the app on device from xcodeOpen appium IDE, add your device details as mentioned in the below screen.
launch ios_webkit_debug_proxy from terminal
Open new terminal window and navigate to your cloned appium source and
run the command ./bin/ios-webkit-debug-proxy-launcher.js -cUDID -d (This is workaround for dubug proxy crash)
Launch the appium from IDE
You are all set to run your test now.
Below is the standalone TestNG/java file to open google home page.
package vin.automation;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.ios.IOSDriver;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class VinWebTest {
AppiumDriver driver;
DesiredCapabilities capabilities = new DesiredCapabilities();
@BeforeClass()
public void init() throws MalformedURLException {
capabilities.setCapability("platformName", "iOS");
capabilities.setCapability("deviceName", "iPhone 5s");
capabilities.setCapability("browser", "safari");
driver = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"),
capabilities);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}
@Test
public void googleTest() {
driver.get("http://www.google.com");
}
}
Please let me know if you face any issues, Happy coding.
Thanks,
Amarnath Rayudu
- Hi all, Am planning to use Appium to test my application in mobile. As am very new to this can any plz guide how to select the framework and which one is best for my application. And how do i design it?75
- Unable to launch safari browser even in Simulator: error: Could not prepare mobile safari: Error: Couldn't find built in app in its home or temp dir!55
- Error Message: A new session could not be created. (Original error: Please provide the 'app' or 'browserName' capability or start appium with the --app or --browser-name argument. Alternatively, you may provide the 'bundleId' and 'udid' capabilities for a47
- Unable to launch safari on real device using appium25
- Fruitstrap quit unexpectedly when I tried to launch safari on real device5
created
Jun '15
last reply
Feb '19
- 44
replies
- 44.1k
views
- 34
users
- 11
likes
- 11
links
There are 44 replies with an estimated read time of 11 minutes.