mra419
mra419

Reputation: 413

Not able to open HTTPS URL in IOS Simulator with appium and Selenium WebDriver

I am using Appium with Selenium WebDriver for automating my web application(having SSL certificate with https in the application url). i am using below code for IPad Simulator.

            DesiredCapabilities capabilities = new DesiredCapabilities();
            capabilities.setCapability(CapabilityType.BROWSER_NAME, "iOS");
            capabilities.setCapability(CapabilityType.VERSION, "6.1");
            capabilities.setCapability(CapabilityType.PLATFORM, "Mac");
            capabilities.setCapability("device", "iPad");
            capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
            capabilities.setCapability(CapabilityType.SUPPORTS_JAVASCRIPT, true);

            //Create an instance of RemoteWebDriver and connect to the Appium server.
            driver = new RemoteWebDriver(new URL("http://localhost:4723/wd/hub"), capabilities);

But still when i execute my automation script it is not able to open the application url in the IPad simulator.

Can anyone please help me in how to solve this issue.

Thanks in Advance!!

Upvotes: 1

Views: 1859

Answers (2)

Abhishek Swain
Abhishek Swain

Reputation: 1054

If you are using Appium 1.0+, a number of changes needs to be done with your DesiredCapabilities :

Please match your cap sets with below:

Few Important Points: Double check the IP & PORT on which Appium server started and mention the same while passing to RemoteWebDriver.

 public void setUp() throws Exception
        {
            DesiredCapabilities capabilities = new DesiredCapabilities();
            capabilities.setCapability("deviceName", "iPhone Simulator");
            capabilities.setCapability("platformName", "iOS");
            capabilities.setCapability("platformVersion", "7.1");
            capabilities.setCapability("browserName", "safari");
            driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"),
                    capabilities);

        }

Upvotes: 2

Jess
Jess

Reputation: 3146

A few corrections to your DesiredCapabilities:

  • Browser Name should be Safari
  • Platform Name should be iOS
  • And shouldn't the URL of your RemoteWebDriver be http://0.0.0.0:4723/wd/hub?

Please review the desired capabilities spec

And after you make those corrections, if you try going to http://www.google.com, does it work?

Upvotes: 0

Related Questions