I can’t get any automation working with Appium against the Safari mobile browser on the iOS emulator. In my Java project, Safari will start, but the browser will not even go to the specified website. Can someone tell me what I am doing wrong with my code?
1) Launch the Appium app on my OSX machine. It is configured with the following settings:
IP Address: 127.0.0.1 Port: 4723 Force Device: Checked - iPhone User Mobile Safari: Checked
(Note: when starting my project, no messages are viewed on the Appium application log screen. I used to have complaints about the missing iOS 6.0 library, but when I duplicated the iOS 6.1 library and then renamed it 6.0, the messages were gone.)
2) Launch Eclipse and open the Appium Project
3) Right-click the test code and select "RunAs Junit"
4) iPhone emulator launches - iPhone iOS 6.1
5) Mobile Safari launches ... and then it doesn't go anywhere (should go to cnn.com). I get no errors.
Can I use Appium Java projects to automate Mobile-Safari? I don't see Safari automation examples in the Appium example code repository.
What gives?
Thanks,
Larry
------------------ Java code below -------------------------- - ------------
Eclipse Juno is used to run my Java / Appium project. Here's a simplified text of the Java JUnit project code (which, when modified appropriately and used with iWebDriver and outdated iPhoneDriver (), works great):
import org.junit.Before; import org.junit.After; import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.remote.RemoteWebDriver; public class AppiumiPhoneWebDriverDemo { private String baseUrl; private WebDriver driver; @Before public void setup() throws Exception { WebDriver driver; DesiredCapabilities cap = new DesiredCapabilities();