Parallel execution of ios test cases using IOS simulator on appium - appium-ios

Hi i want to run ios test cases parallel using IOS simulator on appium.
I know MAC restricts as only one simulator will be up, but is there a backdoor entry i can make them in parallel , i don't want to use grid because of some reasons , so is there a way to run ios test cases parallel on IOS simulator.
And if i run two appium servers with different port and address at a time only one ios simulator will be up ,as it shutdowns the other one.
I am using 1.6.4 appium server and Xcode 8+.
Any help is very much appreciated.

Here is what I did and it worked for me:
Run the first server with standard address and port by running appium
And the second one with custom port and custom WebDriver Agent port:
appium -p 4722 --webdriveragent-port 8100
This way the phones will have different WebDriver Agents to control them.
Make sure to pass it within capabilities!
======EDIT======
If you have issues with running two emulated devices here is a tutorial which worked for me as well: https://www.youtube.com/watch?v=0aS_zEYvQY4

I anyone else lands here I managed to solve running multiple emulators on one MaC.
You need to also specify different webdriver ports when you start your appirum server:
appium --address [your-appirum-server-ip-address] --port [random-free-port] -bp [different-random-free-port]-cp [another-random-free-port] --full-reset --webdriveragent-port [finally-yet-another-random-free-port]
e.g.
appium --address 10.8.0.3 --port 4874 -bp 6004 -cp 9004 --full-reset --webdriveragent-port 10004
then set the capabilities on your test script to connect to different ports and the majic will happen.

There is no way. Only one simulator can be up. If you have two Macs, you can copy the .xcodeproj file and run them side by side on the two computers.

Related

NRF BLE chip, with bonding - bt-agent in NoInputNoOutput mode can't "forget" device

First little project at a new place and I'm having some trouble - hoping I can get some ideas. We have a BLE device using an NRF chip one which we've just enabled security and bonding. We're hoping to get our linux test fixtures set up so that the devices can be paired and bonded without the operator needing to accept the bonding request for every device. In the field, the end user will need to bond a device to a smartphone at least once.
I set up an agent using bt-agent --compatibility=NoInputNoOutput as described here:
https://www.kynetics.com/docs/2018/pairing_agents_bluez/
The bonding worked wonderfully without user interaction on my linux desktop (Ubuntu 20.10). Problem is, when I remove the agent, I had hoped that the bonding process would return to normal. It does not - it still doesn't require user interaction to establish the bonding. A similar operation completed from my Android phone works as expected after I "forget" the device.
I'm looking for more ideas as to how to reset the bonding/pairing of this device on my linux computer such that I can easily trade back and forth between needing user input and not (for testing and demonstration purposes). I've tried the following:
Remove the cache entry for my device in /var/lib/bluetooth//cache
Remove the device using bluetoothctl => remove aa:bb:cc:dd:ee:ff
Remove all agents using bluetoothctl => agent off (until no more agents remain)
probably some other things that aren't coming to mind right now
Regardless, the device automatically bonds when I click it in my Bluetooth list (or choose to connect in bluetoothctl). Any other thoughts on how I can return my linux box to a state where it's requiring user interaction for the bonding process?
thanks a million
I would expect Remove the device using bluetoothctl => remove aa:bb:cc:dd:ee:ff to have removed the device and the bond information.
Which leads me to suspect that your agent is still running in the background and being triggered on the request to do the pairing/bonding. My assumptions is that the agent registered by bt-agent would be unregistered when bt-agent exits. Could the bt-agent script still running in the background? Is the agent not unregistered on exit?
I don't have bt-agent on my system as it doesn't seem to be part of the standard BlueZ offering so I can't reproduce the issue. To get more debug information when pairing and exiting bt-agent, have separate terminals open with the following running to get more visibility of what is happening:
bluetootctl
journalctl -f -u bluetooth
sudo busctl monitor org.bluez
sudo btmon

How to serve a Qt application to multiple users via Qt WebGL streaming?

Qt Quick WebGL Streaming is a technology by which any Qt Quick ("QML") application can display its user interface to a user connecting via a web browser. All you have to do is to start the application like this on the host:
./my-qml-program -platform webgl:port=8080
This works, but is limited by design so that only one user can be connected at the same time and see the user interface. As the reason for this, they quote problems with user input, with querying the GPU, and with security (source).
Initially, the Qt developers wanted to support multiple users in WebGL streaming by serving multiple windows from one process:
How will concurrency be supported? Like does each connection get it's own QGuiApplication, or is there only one? […] You create a single QGuiApplication and different windows. There is a signal to notify when new clients connect to the HTTP server. When the signal is emitted, you create a different QWindow. The windows are independent (source)
Now however, the developers want to support multiple users in WebGL streaming by launching one process per user.
We are working in decoupling the HTTP Server from the plugin
A dedicated HTTP Server application will be provided
Instead of running all the users in the same process a new process will be spawned per user
The new process will handle the web socket
(source)
"Decoupling the HTTP Server from the plugin" would mean replacing it with QHttpServer:
I have planned some use-cases for this [QHttpServer] module: Change the current embedded web server (and WebSockets) in the WebGL plugin to make it easy to create your own custom solutions based on the plugin. (source)
So far, no solution has been implemented. What is the simplest way to implement support for multiple users in Qt WebGL streaming myself, without waiting for Qt to implement this?
Here is a solution that uses the load balancer Pen to make a Qt application accessible via WebGL streaming to multiple users at the same time. It forwards an incoming connection to one of multiple Qt processes running on the same host, each of which running its own embedded web server. This kind of forwarding is exactly the job of a load balancer, just that it usually distributes connections to multiple hosts.
Caveat: In my tests, WebGL streaming in Qt 5.12.3 is fast enough for real use only in the local network, not over Internet. So you can't use it to "convert a Qt application into a web application on the cheap".
Instructions
These instructions apply to Ubuntu 19.10, 20.04 and other Debian based distributions.
Install the Qt application on your web host.
Install the Qt WebGL platform plugin on your web host. It is not contained in the Ubuntu 19.10 distribution, for example. In such a case, you'd have to compile and install it yourself. Under Ubuntu Linux, the result should be the following file:
/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqwebgl.so
Start multiple processes of the Qt application. Each should serve one port with Qt WebGL streaming. Here we start three processes, but you can start as many as fit into your memory.
nohup myapplication -platform webgl:port=8080 &
nohup myapplication -platform webgl:port=8081 &
nohup myapplication -platform webgl:port=8082 &
Install the load balancer Pen.
sudo apt install pen
Start the load balancer. Note that with pen 80 … it is started so that the users only have to enter a simple URl such as http://example.com/ into their web browser to visit the application. If port 80 is already in use, you can choose any other port (say, 9090), start the load balancer with pen 9090 … and then let users visit a URL like http://example.com:9090/. Also note the :1:1 suffix for each server process listed, telling pen to only connect at most one client to one process.
pen 80 localhost:8080:1:1 localhost:8081:1:1 localhost:8082:1:1
Test the setup. To test, visit the associated URL http://example.com/ from multiple devices. You shoud be served one process of the application on each device. It is not possible to see two processes in two parallel browser tabs on the same device – pen would then try to connect the second such tab to the same Qt process as the first tab because the request comes from the same IP address. As a result, you'd see a spinning wheel in the second tab, because Qt processes only allow one connection each for WebGL streaming.
Improvements
This solution could be further improved by starting the Qt processes only on demand, once a client connects. This should be possible with systemd socket activation.

detect os version of remote machine

i'm working on some simple network management tool and it has a scanner that should display all active devices on the network and also show their os and its version.
at least i want to get windows and linux versions, but some other (like cisco ios) are also valuable.
i've looked into tcp/ip fingerprinting using ttl and window size, but it seems not very reliable and only detects whether it is windows of linux.
is it even possible?
p.s. i don't want to use some ready solutions like wmi or snmp

Accessing Serial Ports with an Application Runs in Flatpak

I recently updated my IDE to Monodevelop 6 using Flatpak, on Ubuntu 16.04 LTS, from an older version 5.
I have an application that interacts with serial ports which is basically a USB/RS232 adapter connecting a device to my computer.
I have no issue accessing USB port (/dev/ttyUSB0) when I debug the application in Monodevelop5. However, the device directory (/dev/) that I have access to, using Monodevelop6 is completely different than the one I have access to in Linux, and there is no ttyUSB0 in that folder.
I believe this is because Flatpak runs the application in sandbox. So, if that is the reason, how can I access to a serial port then?
Thanks.
Most likely that's because Flatpak is blocking access to the serial device.
Unfortunately at the moment I don't think there is a way to give access specifically to the serial devices, so you'd need to give access to all:
$ flatpak run --device=all com.xamarin.MonoDevelop
What this does is essentially mount the host's /dev inside the sandbox, so the app has full access to it.
It's a pretty big hole in the sandbox, but sometimes it's needed until all the permission handling stuff gets implemented.

what is Linux equivalent of "netsh interface tcp set global autotuning=disabled" command?

I want to download the Android SDK with the SDK manager in Ubuntu 14.0.4. My internet bandwidth is 10 megabits per second, but Android SDK manager download speed is too low.
There was a solution for it in here, the command is:
netsh interface tcp set global autotuning=disabled
but this is for windows. What is the equivalent command for Linux (Ubuntu)?

Resources