appium-for-mac icon indicating copy to clipboard operation
appium-for-mac copied to clipboard

Integrated testing of Safari using SafariDriver and Appium for Mac with an example

Open daluu opened this issue 9 years ago • 3 comments

Not an issue/bug, but perhaps a discussion & enhancement request (for examples).

Can Appium for Mac handle much in terms of manipulating Safari browser? I see the current example for Safari is rather primitive. I was just thinking if it can do more, Appium for Mac, when combined with SafariDriver in a test, could make up for shortcomings in SafariDriver. Things like:

  • handling alerts
  • file downloads
  • authentication popups (login, accept SSL certificate, etc.)
  • navigate back, forward, traverse history
  • invoke Safari extension in terms of interaction with a webpage currently open in Safari
  • any other item of browser that SafariDriver can't control

of course this integrated test would be driven by 2 instances of WebDriver - one for SafariDriver and another for Appium for Mac. SafariDriver launches the browser and drives to certain state. Appium for Mac driver instance will then handle a section of the test that SafariDriver can't handle and then we resume driving the test with SafariDriver again after Appium for Mac does its part.

This would make for an interesting example and use case, since in Windows world, we see much examples about using AutoIt and Sikuli to handle shortcomings in other browsers on the Windows side. But I haven't really seen any mention on the Mac side, while there have been gripes in Selenium issues on shortcomings of SafariDriver that perhaps this integration can handle.

daluu avatar Dec 31 '14 08:12 daluu

Someone attempted this a year or so ago. The problem was mainly the performance was slow. It is possible, I would just need to rewrite some of the code to improve the performance of xpath search.

penguinho avatar Jan 02 '15 11:01 penguinho

I am having issue in launching safariLauncher on real ipad with following configuration:

  1. Xcode 7.2 mac 10.10 Appium 1.5 and tried with appium 1.4.13 app GUi

build succeeded in Xcode but when I try to run safarilauncher.xcode it throws an error that process launch failed :timed out trying to launch app The ipad has safarilauncher app installed on it and clicking on it launches safarilauncher with a message that click safari launcher. No errors by appium doctor for ios.

I tried running my script after starting Appium server on mac with follow appiummac2 appiummac3

ing settings: error is Test Name: TestMethod1 Test FullName: UnitTestProject2.UnitTest1.TestMethod1 Test Source: C:\ED\TestAutomation\Ed.LMS\Main\UnitTestProject2\UnitTestProject2\AppiumIpad.cs : line 15 Test Outcome: Failed Test Duration: 0:00:09.451697

Result StackTrace:
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters) at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities) at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) at OpenQA.Selenium.Appium.AppiumDriver1..ctor(Uri remoteAddress, ICapabilities desiredCapabilities) at OpenQA.Selenium.Appium.iOS.IOSDriver`1..ctor(Uri remoteAddress, DesiredCapabilities desiredCapabilities) at UnitTestProject2.UnitTest1.TestMethod1() in C:\ED\TestAutomation\Ed.LMS\Main\UnitTestProject2\UnitTestProject2\AppiumIpad.cs:line 27 Result Message: Test method UnitTestProject2.UnitTest1.TestMethod1 threw exception: System.InvalidOperationException: A new session could not be created. (Original error: ENOENT, stat '/Applications/Appium.app/Contents/Resources/node_modules/appium/build/SafariLauncher/SafariLauncher.zip') (33)

tried whatever was suggested, I think I might be missing something but no clue what ? Had been struggling for weeks , please help . I really appreciate your time, help and suggestions.

Thanks

pshilpa1 avatar Mar 04 '16 18:03 pshilpa1

@pshilpa1 this is the wrong issue to post to. Better you post to http://discuss.appium.io for help.

daluu avatar Mar 04 '16 20:03 daluu