Opening multiple appium server Instances on same machine - appium

Can I start 2 appium server instances on my machine at the same time so that I can execute my test script simultaneously on 2 different devices connected to the machine?
Actually what I'm trying is to run my test script on 2 devices connected to same windows machine. For this I am using TestNG to pass the Android Driver url to start session. This url will be dynamic as 2 devices will be using 2 Appium server instances. Can I create 2 instances of Appium server at same time? If so then can I use code to create those instances as I don't want to use GUI to start it.

This question has already been asked and answer (if I am reading what you want correctly).
Please refer to How to start the Appium server from command prompt in MAC machine?
On a windows machine there should be an appium executable which you run with the command line arguments --address 127.0.0.1 -p 4273
In essence all you need to do is use a different port for your tests.

Related

I am using appium.app on mac how to open more than one session to run with different ports

I want to run the appium with different ports i am using appium.app on mac desktop.how to run with different ports any ideas..?
What do you mean to run appium with different ports? In case you're using the app, you set the port before you start the server.
In case you meant to run multiple appium sessions with different ports, I've installed appium using npm and then started my servers from command line
I guess you are talking about attaching more than one device and then executing the scripts in parallel on all devices like the selenium grid.
You can go through this link, which is appum's official documentation for setting up selenium grid for mobile automation.

GUI in docker application

I have a desktop application written completely in C with GUI written in Gtk. Currently, it works fine on my Ubuntu desktop.
Now, I want to use the application independent of the OS. Therefore, Docker seems to help with it but as far as I know, it only provides web based UI.
How can I use Docker to deploy standalone desktop applications?
Is there any other container which does the job?
P.S.: The application is written in Gtk 2 hence I cannot use broadway.
I haven't done it myself anytime but just suggesting what might seem obvious.
You can try this though:
Run XVNC server inside the container
Expose the port at which XVNC runs
Connect to the XVNC server from the host machine
Trigger your gui application from within the XVNC console

Is it possible to run appium server as a service in Linux OS like Ubuntu?

I've googled the topic but no result. One alternative way is to use Java client to start appium server programatically. However, I am using Python as my test script. It seems the Python client does not have such APIs.
So, I want to know if it is possible to run appium server as a service, so that I can use the following command to start/stop it:
service appium-server start
service appium-server stop
Any information will be appreciated.

How to run a X Windows application in Codenvy Cloud IDE?

Copdenvy's shellinabox runner allows you to start a shell in the browser in which you can compile and run your code. This is fine for applications that are console based. Is it possible to run an X Windows application in the cloud and see the graphical window?
Setting the DISPLAY variable in the shell to that of your Linux workstation could work, though it relies on you being in control of the local network for things like NAT and firewall settings. The attraction of the cloud IDE is that you only need a browser and an https connection.
Can you ssh -X into the Docker container from an X capable source? Where would you find the URL? How would you manage the ssh keys?
If you look at the Java/Swing "VNC + Java 7" runner for example you'll see that you're able to run an application which is using X DISPLAY through VNC. Codenvy supplies a web based X Windows environment that you can access by clicking on the hyperlink that is shown underneath the Console window, to the left of the Timeout counter. You can then look at the Docker recipe used to start this sample.
SSH in the docker container could be managed in Codenvy 3.x if you install inside the VM the sshd daemon and export the ssh/22 port. In upcoming Codenvy SaaS 4.x ssh will be enabled without any configuration.

Can Jenkins start up GenyMotion on Ubuntu 14, if I access the Jenkins website from my Mac?

Is it possible for this setting to work?
1) Ubuntu 14 with Jenkins, Genymotion, and Virtual Box installed
2) The job inside Jenkins will restore and run Genymotion from a command line following this tutorial: http://blog.genymobile.com/genymotion-jenkins-android-testing/
From my Mac, I tried to access the Jenkins website and run the build.
Firstly, Genymotion failed because it couldn't "connect to X server".
So, I installed Xvnc Plugin on Jenkins which solved the error.
Unfortunately, Genymotion still failed to start up with the error "Cannot get IP address".
Please note that I only have "ssh -X" access to the server.
I can manually start up Genymotion but the process was terminated when I logged off. As a result, I could not leave the GenyMotion run on the Server as suggested by this solution: Jenkins - Use Genymotion VM instead of Android Emulator
Any advice?
Here is the way to make Genymotion works on a continuous integration server.
First, the computer running Genymotion needs to respect the hardware requirements
You won't be able to run Genymotion if you don't have an X server running.
I don't think xVNC supports OpenGL so I advise you to run your standard X server.
You can launch the Xorg server by running startx.
Then you need to set your ssh connection in Jenkins without the -X parameter because we want the rendering to be done locally
Then you need to declare the environement variable DISPLAY to the default X client's value. Most of the time it is :0
This value will ask to open all the windows you launch through the ssh connexion into the first X client. It is the one running on the computer screen.
To check the DISPLAY value you need to enter, you need to access the computer physically and type echo $DISPLAY. Most of the time this value is :0
Also, if your computer is not compatible with the hardware requirements, you can use another computer on your network to run your tests thanks to the Jenkins nodes. Here is a good tutorial to set it up.
And finally, I want to mention we will soon release a command line tool for Genymotion and a Gradle Plugin that will allows you to control your Genymotion devices running during your tests directly from your build.gradle file.
It`s a bit late, but maybe this could help you out
### Get IP address of selected VM
VM_IP=`VBoxManage guestproperty get $VM_SELECTED androvm_ip_management | awk - F ": " '{print $2}'`
I found this here (repo) respectively here (slides)

Resources