Using Selenium with ios-driver to test iOS mobile apps from a Windows machine - ios

I am investigating the feasibility of testing native, hybrid, and web-based applications using Selenium for Windows (web only), Android, and iOS mobile devices (e.g. iPad).
The ideal setup for a tester would be a Windows machine with physical devices connected via USB. This works with Android as all that is needed (excluding the ADK and USB driver setup) is Selendroid's stand-alone server and a JAR dependency. However, from my understanding, this is not possible with iOS mobile devices using ios-driver. I have also checked out Appium, and they too state that a Mac computer would be needed to test iOS devices.
So that brings us to my question: Is there a way to test iOS mobile apps (web, hybrid, native) from a Windows machine?
Here is a list of preferences:
- Use Selenium and other Selenium-compatible plug-ins
- Run tests from Windows machine
- Cannot use iOS VM
- Cannot use Mac machine with "middle-man" application to communicate with Windows machine
- Have to test physical mobile devices
- No "hacks" (e.g. Jailbreaking)
It is also safe to assume that I have no experience developing iOS applications.

It is possible to run the tests from a Windows machine but not the way you are probably thinking. You will still need a Mac. Here are the requirements:
A mac on your network with Appium server running
Has Appium environment installed properly
Has the .app on the machine
If you have these three requirements fulfilled and there is no firewall blocking network access to the Mac then you can do it. You will have to actual tests on the Windows machine but instead of specifying 127.0.0.1:8080 in the setup method as the IP address of Appium server you will replace it with this: yourmacsipaddress:8080 and this should execute the test properly.
Remember that you have to specify the path of the .app in the test which is running from your Windows machine. But the catch is that the path has to be the path of the .app in the Mac and not on your Windows machine.
So the tests will run from your Windows machine but the installation of the app, the automation, and the testing will be done on the Mac but you will get the "pass" or "fail" update on your Windows machine.

If you do not want to set up appium in your local machine, You can also go with sauce lab.
sauce lab provide vm to you. select appropriate device and run using appiumDriver. Provide below capabilty and run using appiumDriver. your remote url will be like this
http://your_username:your_access_key#ondemand.saucelabs.com:80/wd/hub
For iOS Native,
{"driver.class":"io.appium.java_client.ios.IOSDriver","platformName":"iOS","browserName":"","platformVersion":"your os version","deviceName":"device Name","appiumVersion":"1.5.3","app":"sauce-storage:Your application name on sauce storage"}
Your application should be available on sauce storage. You can upload using sauce api .
You can also use this same for web application, android/ ios native application.

Related

Is it possible to run webdriverio app tests against AWS Device Farm without uploading the test suite?

We currently have a suite of webdriverio/appium tests for our react native app, with separate wdio.conf files for local, simulator, BrowserStack etc.
All of the examples I can find for device farm either involve first uploading the test suite as a zip up front, or creating a custom test runner that obtains a selenium grid url from Device Farm and then triggers the wdio command (but I can only see this being used for Selenium, nothing for appium/app testing).
Is it not possible to run tests from my local machine whilst pointing to AWS Device Farm devices?
Unfortunately this is not possible with AWS Device Farm, as you have already noticed that they do not have a Selenium Grid for mobile devices. In general for me it has been a huge hassle to get Appium tests to work on AWS using CI/CD - both because of the setup and the inability to easily debug since I can't run the tests locally against their devices. I would advise using another cloud farm service like Browserstack which allows you to target their grid from your local machine

How can I use a USB/COM port inside of a VSCode development container?

From inside of a development container for VSCode (Debian Linux) I'd like to use a COM port for communication via an USB device connnected to the Windows host machine (via WSL2). How can I make the COM port available insie of the container?
EDIT:
For WSL2 there is no official support yet.
As of right now WSL 2 does not include serial support, or USB device support.
A corresponding feature request is tracked on GitHub.
July 2021: As of right now WSL 2 does not include serial support, or USB device support.
Update November 2021: the same FAQ states:
Skanda Hazarika reports:
You can now connect USB devices in Windows Subsystem for Linux under Windows 11
If you’re an active user of Windows Subsystem for Linux and want to access USB devices right from the Linux instance running under WSL, then you’ll be happy to know that there has been a significant progress in this front.
Thanks to Microsoft’s contributions to the open-source dorssel/usbipd-win project, you can now enjoy USB passthrough access in WSL.
It means end users can perform tasks like flashing Android devices under Windows Subsystem for Linux, which are otherwise not supported by the Linux subsystem.
The usbipd-win project is all about creating a solution for sharing locally connected USB devices to other machines, including Hyper-V guests and WSL2. However, the official WSL2 Linux kernel used to lack support for the USB/IP protocol, requiring users to build the kernel themselves.
Since WSL kernel version 5.10.60.1, the required parameters are configured out of the box, so no manual recompilation is needed.
Microsoft has also contributed a command line interface to the project to both enable a USB device for sharing on Windows and seamlessly attach it from within WSL.
So if you have:
migrated/upgraded to Windows 11
applied all WSL updates (through the Windows Store)
Then, your VSCode should be able to access mounted USB drives through WSL.

I want to make a Test Lab setup for Appium

I want to make a Test Automation Lab for Appium (Android & iOS)
Questions:
1. As per Appium limitation we can access Single device (ios) from Machine.
In this case If I connect multiple Ios/Android devices to MAC machine (Server) how I can access from other machine ?
If I make Windows machine as a server Can I access and Run scripts from MAC machine?
You can use the selenium grid with Appium to do that. parallel test with appium & selenium grid
you have to add the appium in environment variable
start the grid
start the node which you want then run in parallel
You can go for sauce labs, Sauce Labs allows users to run tests in the cloud on more than 500 different browser platform, operating system and device combinations, providing a comprehensive test infrastructure for automated and manual testing of desktop and mobile applications using Selenium, Appium and JavaScript unit testing frameworks.
https://saucelabs.com/

How to test app on Edge on Mac OS or Linux

I am on Mac OS and Linux and want to test my app on Edge. I know I can use Browserstack, but it's a paid service. Any other ways that I can test on Edge for Free?
If you are on Mac or Linux, you can use the following tools to test Edge for free:
Virtual Machines
https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/
You can get the virtual machines image to test Edge as well as IE6 to IE11 on all platforms Mac, Linux and Windows. You do need to have either Virtual Box, VMware or Vagrant to install the VM image.
RemoteIE
https://dev.windows.com/en-us/microsoft-edge/tools/remote/
If you don't want to install VM image, try RemoteIE. The Remote client app is a small utility program that allows you to access Microsoft apps from the cloud. When you launch Internet Explorer from the Remote client app, a real preview version of the browser opens into a new window on your operating system, much like any other app you might have running. This version of Internet Explorer is modified to host the latest preview version of the EdgeHTML rendering engine, so you can test how your site will render in Microsoft Edge. It is available for Mac OS X, iOS, Android and Windows OS devices, and includes simple installation and account set up steps.
Yes, using virtual machines. Microsoft provides VMs in a number of formats for exactly this reason.
You can download them here

How to deploy a rails application on Windows PC (windows 7 / windows 8)?

I have built a rails app which is used as a standalone enterprise application. The application needs to run on Windows desktops (entire user base runs Windows machines). I am able to run it quite successfully on an Ubuntu machine but it's not something customers will prefer to run.
Since deploying on a windows machine is quite messy AFAIK. I would like deploy it on Windows using a virtual machine (VirtualBox).
Requirements would be -
Application installation on Windows 7 / Windows 8.
User should be able to access rails server by browser running on his/her system via localhost or any other IP address.
Application should auto-start when user reboots the machine.
Ideally user should be able to download and install the software on his/her machine by himself/herself.
I am working to make this work but would like to know the feasibility of this solution. Would like to if I am getting the concepts wrongs or if there is something which is simply not possible or is not making any sense.
Take a look at Vagrant, which is a highly scriptable VM host. You can then generate batch files to automatically start the VM on boot.
To deploy new code, you'll just want to provide them with a new VM image they can copy into your app directory.
That said, I agree with other comments that this might not be the right platform for your use case. The main reason for building web apps is so that many clients can use your app over the web using just one set of servers. Deploying a web server to each client seems like it's defeating that advantage.

Resources