IPhone real device automation environment setup - ios

I am trying to write script using Java and Selenium. Using Appium tool for automation. I finished testing web app on simulator. I want to know if it is possible to run test script by connecting the real iPhone device to MAC through Wifi. If yes, will xcode be able to detect the device? If no, is there any software out there which can help me achieve this. I know there is option of connecting using USB but I am dealing with remote MAC machine.

Now if I am understanding your problem correctly - you want to run test on real device without physically connecting to MAC.
**Answers:**
1. There is no way, you can run test on Real Device without physically connecting it to Mac with an Xcode.
2. Xcode can't detect any iPhone via wifi.
3. There is one way to run test on iPhone without physical connection, if you want to run tests on mobile website that is Safari:
A. **ONE TIME SETUP** You need to install iWeb Driver (app) in iPhone once via Xcode. This is a deprecated way though. If you want this, I'll upload the iWeb Driver source code on github, you can download and install further.
B. Now before running test, you need to launch the iWeb Driver (app) manually on device, once you run this, it will flash an a URL on app.
C. Use this url in Remote Webdriver like:
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(CapabilityType.PLATFORM, DesiredCapabilities.iphone());
WebDriver iphoneDriver = new RemoteWebDriver(new URL(iphoneIp), cap);
and then use this driver just like other and run your tests.

Related

so if we need to setup an auto tests (Appium) of an iPhone app from our Win 10 setup - what are all of our options?

for Android - we just run the emulator and hook them up
but for iPhone what are our options?
can we also run some iPhone emulator?
or hook up an actual iPhone via USB?
or have our code connect to virtual (or real) MacOS that has an iPhone emulator (connected to by Appium)
or for that matter/similar to above - connect to a 3rd party service that will serve up an emulation for us to test? what are the best services?
are these all the options?
thank you ...
There is no difference from such point of view between android and iOS.
Yes, you can basically use all of the options.
The most simple way is to run emulator on your machine and test it. If you have such resources, you can test on real devices (the best way). Since you can run iPhone emulator even on Windows there is no need to run emulator on MAC.
Regarding 3rd party services, there is an AWS farm that uses real mobile devices, but i have never tried it, i think it is the most expensive way

Automated tests in iOS with RobotFramework

I'm working in a project of develop a responsive webapp and I'm in charge of creating automated tests in order to test everything in 3 different places, Desktop web, Android web and iOS web with RobotFramework and Appium Library
Desktop and Android it's not the first time I've done it so I quickly configured everything, on the other hand I never tested or even develop anything for iOS (not even used an iPhone irl) and I know from a past experience that XCode has required to send data to the phone, in a similar way to adb for Android.
The real question that my research was not able to respond is: Is a MacOS environment running XCode needed in order to run regression tests? Or is it possible in someway just use Windows, Robot and a physical phone/emulator to run regression tests?
In the case that a MacOS is required do I need Apple Developer ID? (I remember a few years back that it was required for any iOS related development).
In case you're using MacOS and running with Real Device iOS you will require to have Developer Account to provision profile WebDriverAgent or Otherwise you need to have certificate from your developer to install on your Mac. Create Your Apple Dev Account. And if you want try with Windows you can try with Appium Studio.
Yes, you need a MacOS to test with Appium/AppiumLibrary and Robot Framework.
You don't need an Apple Developer ID to test on iOS (only need it when publishing apps to Apple Store).

Connect iOS Device to Mac and Log App Errors

Goal:
Connect iOS device (physical device) to macbook
Use Appium / IntelliJ / or any other software to capture app errors from the device
I run automation tests using simulated devices, however, it's proving to not be as affective as manual testing for I'm getting different results. What I want is to simply connect my device to my macbook, run something to log app errors as I interact with my test device.
My current set up to run automated tests:
Appium
IntelliJ - Using simulated devices (No longer wanting to do)
To view what's going on in the device, you'll need to use Xcode. The easiest way to obtain that is to use the Mac App Store application.
If you're able to build your app there is a lot more debugging you can do, but I'm assuming you're not able to do that based on what you've written and won't provide instruction on that.
Attach device
Launch Xcode
Click Window menu
Click Devices and Simulators
Unlock device
Click Open Console if you're looking to see live activity of the system (this is very noisy and unlikely to be of much use) or View Device Logs to see any crash reports.

Should I use Mac for testing iPhone or is Windows enough?

I managed to control my android device with both 'ADB' and 'Appium' on windows system.
Question is : Can I do the same for iPhone ? as i heard that it can't be done in windows platform and it isn't clear on net.
Also wanted to know if the iPhone sdk having tools like ADB 'command line tool' to do some things like make phone call , or press , or swipe ..
I trigger all of that with python scripts.
Thanks
For iPhone automation testing with the help of appium, you must need Mac machine.For iOS app testing using appium, the primary requirement is XCode which comes with only iOS Operating System which you can get only on MacBook/MacMini.
There is no tool like ADB for iOS. Whatever command you want to send to the device, all those needs to be sent through appium driver only. You can check the appium driver, there are lot of in built methods like hiding keyboard or launching app or opening notifications panel etc.

Remote execution iOS UI tests and unit tests without connection to Mac computer

I have Mac with installed OS X server. We can remotely install iOS app. But we need to run Xcode UI and Unit tests remotely. The problem is that tested devices has connected lightning MFI device and cannot be connected to Xcode computer. Our goal is to run UI and Unit tests remotely and transfer results to server by Air. Could anyone please propose any suggestion how we can do it?
Finally I got a final answer from Apple:
I did investigate if there were any workarounds or alternatives to get UI Tests to run without an active connection to Xcode, and unfortunately I found this was not possible. I also investigated if you could run UIAutomation tests wirelessly since Instruments supports collecting data wirelessly. Unfortunately that support does not extend to the Automation instrument, so it is also not possible to run UIAutomation tests without a lightning cable connected.

Resources