So in the previous section, I showed you how you're able to execute your native framework scripts using a nondirect connection, utilizing a second script, kind of a second script handoff if you will. You can work on any IDE of your choice and create a second script and be able to load your application or test and your test runner and execute from that way. Again, making use of a nondirect connection.

In this section, I'll be showing you how you can execute your native framework scripts using a direct connection. So a direct connection from your IDE right to a real device, even a cloudified device through virtual connection. In Kobiton, we will be able to do just that making use of Kobiton's feature virtual USB.

So here I have Android studio code pulled up. Excuse me, Android studio pulled up. I do have simple Espresso scripts that are created. I like to run on a real device. Currently in a physical device. I don't have anything. No devices online or connected.

So let's go ahead and connect to a device. So what I'll do is I'll go ahead and launch virtual USB. It has its own client, a downloadable client from the portal, and I'll sign in just as if I'd sent it to the Kobiton portal using my same username and password.

So here in virtual USB, we can see the devices that are online and available. So for Espresso, I'll be connecting to an Android device. Let's connect to this. The same devices previously the Galaxy S20. So I'll hit connect here. And here we are connected. If I navigate back to Android Studio, this being an Android 12 system, I can see that this device is green and online via the Android 12 and online with the green dot. And if I wanted to run this script, I can point it to that, that real device using that direct connection. So to view it itself, I'm going to navigate to the Kobiton portal. Here I can see the device.

 It has retained the only so myself can use a use this some directly connected to it at the moment. So let's go ahead and launch this device. Okay. So here we are in a live view of this device connected to Android Studio. I am going to minimize this frame just a bit. An Android studio. I'm going to go ahead and execute my Espresso scripts and then view it in a live execution on the connected device.

So we'll go ahead and make sure that we have our script selected to run the correct device to run it on. And we'll go ahead and hit run. So as it's compiling, I'm going to go ahead and navigate back to Kobiton. I'm going to just kind of make use of the space here in viewing the compiling and build of gradle in the application as well as executing the scripts.

Engine is the test runner is not already compiled, this execution type is a bit lengthier than the non-direct connected route. So with a non-direct connected route of that second script, your test runner and Espresso scripts are already compiled and packaged.

So that is why it runs faster. From this route, it does take a moment to compile everything and to install the application and run the script. So it is a bit of a lengthier time compared to the nondirect connected route. Here we can see our script is running. And there you have it. If you navigate back to Android studio.

We can see the results are still compiling and are still executing. Here we go. Here we have our Expresso scripts that have been run and our Expresso scripts that have passed as well. Making use of a direct connection. Executing from Android Studio onto a connected real device using Kobiton and Kobiton's feature virtual USB. This too can be the same with XCUI test and Xcode. You may also connect to a device directly in iOS device and be able to execute your XCUI test scripts onto that device in the same manner. All right.

So those are the two different ways to run your scripts. So again, we have a non-direct connection, making use of a second script handoff route as well as a direct connection making use of virtual USB to directly connect to a cloudified device. Each with our pros and cons. Each each achieved the goal of executing your native frameworks scripts onto a real device. 

Comments are closed.

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
Pen