 So I hope it goes well and I try this myself this this morning. It worked Let's see how it goes. So I want to start with a little Just a little thing about me. My name is Bruno or Bruno if you want to say in English Bruno Alessia, I'm a senior software engineer at Sauce Labs. I've been working for Sauce Lab for almost three years now Right now. I actually working on the visual testing team But before that I was just recently just like last month. So but before that I was working on the emulator and similar thing So a little more More about me. I'm a Python developer mostly. I do Node.js. I really like Node.js I think it's pretty cool. I guess you guys are here also like Node.js and Appian Thank you Before that I used to do like mobile development development iOS, Android, Java, hybrid apps Also some of them with JavaScript and I hope I really like open source That's why I got engaged into Appian and I'm Contributor to Appian not as much but I do contribute Contribute to some things. They're actually the ones I'm going to talk today If you guys want to get in touch, KitKat, Twitter My email but all the media I go to Bruno in all of them So I Want to start before going through what I want to talk. I want to start with an usual case scenario on Testing how many of you guys have created this test Login in your page in a native application In your hybrid application. So this is a common test like an usual test We usually use Appian for functional testing just making sure like the elements that display Just making sure like we can interact with elements and making sure that sometimes we follow some flow But what happens you want to go beyond the user interaction on our app? What other factors can affect our application or might affect your application? So what happens on your app if you're having an SMS incoming to the phone? The network suddenly drops. That's something really usual. You go down to a tunnel You're using App and something started happening A phone call is accepted like is your app ready for this? The battery is really low for some gaming. So you actually may want to test If your body is really low to actually tell the user like where is low and maybe you want to save things or do things The fingerprint is used signal strain Changes the charger is disconnected the device is rotated The license or found that is too dark and much much more. I think you guys get the idea of What I'm trying to talk about so Is there any way to test this? How do you test this usually let go Getting a device and start connecting and disconnecting the device to make sure the battery or the chargers connectors Disconnected are you mocking phone calls using its donor services? Luckily for those who are developing Android vacations, there's a solution for this and Which is this one is the Android emulator How many of you guys here are using the Android emulator for? Day-to-day development It's good. Do you? guys all The new features than the Android emulator has Since the Android emulator 2.3 go so at Google release. I think like probably More than a year ago. There's a lot of new things that you can do with the emulator I can help you test these things. So let me go with an example and show you guys how you can do this So I'm gonna start an emulator you guys see it The emulator started so an easy way to do this when you go to these little three dots blue turning here You're gonna start seeing a lot of new options Resolution is nobody good No, okay, that's sorry about the resolution Okay, so in these options on the emulator through the UI you can do a lot of things you actually can change the location I don't think I can see it But this is actually the lead latitude and the longitude you can actually change the altitude and a few more things That you can do on your real device change the battery change the signal strength Use your fingerprints So all the things that you may want to test on your app You can do it through emulator So to move forward Do I have to do you guys have to do all this manually? Do you actually have to install the application on the emulator and then go to that menu and try it? Luckily, no, and that's why pro you guys are probably are here So and this is Appium Conf and the good thing is like in Appium. I was informed You can do all those things mostly all of those things. So that can help you Start creating tests for these case scenarios. This is all the methods that actually Appium is already supporting for Android so you have fingerprint SMS phone calls signal strength changes voice Changes Capacity power capacity is actually telling the percent of is the battery hundred percent fifty percent two percent ACST is actually telling you if your device is connected or not connected network speed and a few more that it couldn't fit on the flight Let's take a look at some example of those like one of that once I put there was actually the Send SMS there's really a common scenario when you guys are out at the getting user through SMS So this is a simple test That is actually going to Start your activity It's gonna put a Phone number one of the elements gonna go to the next activity And then what you do is you actually send send an SMS to the device and the device will read that SMS as if it was like it's written for a real device and getting your SMS and you can verify That when you receive that SMS on your side, you're putting them on the screen Like for example when I sense one two three four you can see in the next it's gonna put on the screen and you didn't have to like Bucket any API in your test We didn't have to ask for a sandbox testing for any API using for your SMS solution This is actually really cool. They can use to just make sure you I is working and this is how it works you guys don't see much but In the sense mess you need two parameters the third one since is the phone number second is what you want to send I actually my sample I send one to four, but you can send whatever you want one thing I would recommend us to have To use is the app in documentation that give a limitation is usually up to date. I will give you all these Parameters that you need to do and we also give you another thing is like to making sure if this method is Implemented in all the clients for example in this case. This is actually not implemented in C sharp So once you see is if you're working on C sharp is that this is implemented, please Open an issue an app and I will try to implement it as soon as possible And if you know C sharp, I want to start contributing to that we can't help you guys get on more of it That was going down another example for Authentication is using the fingerprints like more and more devices right now are having biometric ways to authenticate Fingerprints face as the title which is the same as fingerprints and the good thing is like you can actually test with This with them later without doing khaki things like this is super easy to do like this is a simple common looking like How many of you guys here have a app in your phone that you can use your fingerprint to log in? I have at least two three my bank my other bank Ever note, I think I also use it So this is really easy how you can actually test this scenario like your first insider is gonna send the wrong fingerprint So making sure like when their fingerprints is wrong you're showing the right message like this is not you Get out and the second one is actually sending the right fingerprint So it's okay. He's saying welcome. You're authenticated and it's gonna show you to the next part of of the application so far I actually talked about Factors you actually waiting to happen like you're waiting from the SMS to come in and you're waiting for the fingerprint to trigger some action But what happened for factors that you actually are not waiting for what happened if you're Having a nap and suddenly you'll get a phone call Are you sure your app is ready to? Interact when a phone call is common It's incoming like that's your app We'll need to actually stop task when a phone call is incoming or we need to stop doing things when the phone Is incoming so this is an example an application I created for this. This is actually an example of a This app in conference application where you can see the videos and then for as soon as you're starting seeing the video You're actually are receiving a call for your grandma. I Think you see in a second So the right behavior will be when you're receiving that call in your application You actually want to stop the video so you don't lose anything and as soon as you stop Having that talk the video will continue. I don't know if you guys can see it We can wait a second like as soon as the says grandma the top the video will stop And then you will see when you I actually do cancel the video continues moving forward So that's a kind of a way you can test these things like previously like that the method for the com the call It's pretty simple. You just tell it from which number is coming and what do you want to do? Like there's are there are four methods. There's a call There's a accept can't cancel and hold and you can try or test your app, you know on all your these days and one last sample It's checking the battery state I mean you guys plug your phone and leave it for 10 hours and for God that is there and sometimes it oh I Forgot about my phone was there For that I actually for myself I install an application that actually as soon as it's a hundred percent You will trigger an alarm. So I say, okay, it's kind of percent So what it is like of these apps that you're seeing the markets is that you are not overcharging the capacity the Battery for hours and hours because doing that along all the days years or months That can actually with long term will affect your battery. So if you're creating an application for testing this tip for Triggering this alarm or something is a hundred percent. You can actually test it with an app in test You can actually this is like for example, I start with a 52% and as soon as I move the capacity to a hundred percent I'm triggering an alarm. I'm treating other there's a text there and actually There's gonna be a sound alarm right there. All of us. I could be faced. That's wrong. That should be battery At the bottom. I'll fix that later so I Mean talking about what you can do with emulator what you can do with Appian through the emulator, but I guess you guys gonna know how this works Everything is here is on the app you code, but I can share that pretty quickly. Have you guys heard about ADB? Perfect, which is really really good if you guys haven't heard about it I recommend you guys go to that link and start learning what it is ADB is the Android debug bridge I will let you start communicating with the emulator really best and do a lot of things about a bunch of things Not just these I'm showing here much more more things I actually have you do a lot of things with ADB to actually support testing like installing the application starting the intense Here doing things the emulator And more and more and more so So how this works? The same things that you can do today UI There's actually an ADV emu command that you can use for example if on my example that will actually send in SMS You can see that I don't know if you guys can see it, but I can make it bigger You can simply run that command ADV emu SMS send and that will get on the device. That's how easy you can start doing these kind of things without Having to go manually and start doing these things So, but that's the command line. How is that become an Appian feature? once you have this Send SMS Where does it go? The first thing you only need to update So it becomes an Appian feature is Appian ADB. Appian ADB is a wrapper I run every ADV command that will communicate with the device So if you're trying to understand or figure out where where is Appian call your sub commands You just go to Appian ADB and This will have all the methods one your new methods of this new method This is how I went to the process while all these things to Appian One thing new method is there you have to go up a level To the Appian Android driver. The Appian Android driver is the Driver in charge of calling these commands and along with that is also making sure that this ADB Command is not being called to a real device. So in the Android Driver emulator you actually say saying okay, if this is a test write emulator cause this ADB command And that will trigger the ADB command like this. The next thing is the other side is the Appian based driver Appian is a server as Selenium Appian is a server and for each things that you want to do you need an endpoint and parameters, so then next thing will you add these New things is going to be in the base driver The base driver will have your new input that all the clients will able to communicate to And last but not least the most important part is just updating all the dependencies that you have on Appian Once all of these packages are updated You can create will create a new Appian release and this feature will be available for everyone But there's one more thing that you'll need to do What we'll need to do for the Appian client It's updating all the clients like we have updated our server with a new endpoint that has the new Send SMS that's getting its parameters, but then we need to update the clients So this is where like you guys probably are programming in Java, Python Node.js, sorry Christian, I forgot to put web.io PHP, this is one of the servers updated you will need to go We'll need to go out and update the client so you guys can use that during your tests So to move forward Are you guys interested in seeing and add a new feature to Appian like right now? Can you guys see which one of those is actually not implemented in Appian? License, so if you got interested we're gonna go to the process to add in that feature Right now and hopefully next week I'll create a bright PR and add all the new tests that need it But it is to go to these like see all these files will need to change to These license or feature become a new Appian feature So no support in Appian Until now So let's add a live sensor feature In order to do this. I actually created an app a really simple app like a common app I don't know if you guys may have some application in the market. That is for reading What so I just created is an application that When It sends that the lies to low it will actually send to that change throughout mode So maybe it's you're going to something will change into drug mode Okay, that was before So let's try this application really easily and see how it works So I have already installed this application the device Check So this is the application simple application. I go to the there's a one virtual sensor section on the emulator There's an additional sensors and in here and I see the mouse. It actually said light looks so if I go to zero My application would change to dark mode and if I move away again It will work that so the idea is like let's try to automate this. Let's try to make a new feature to up So what was the first step? On our pro to a new nap in features is figure out the IDVM you come out Lucky for some guy you guys this was very bring me because I'm gonna do this all life. So Bear with me So if there's a ADVM you there's probably gonna be I'm gonna try to share this Let's guys see this There's an any You guys are gonna try to do this to ADVM you so there should be a really easy way to do a TV Amu help and again give you something Unfortunately, there isn't I don't know why Google didn't add it But there's another work around to actually figure out these things And it's telnet how many of you guys use telnet Okay, so Taylor is actually a way of communication of I don't know Definition but it's a terminal where you can communicate through DCP ports So if you do telnet local hosts 5 5 5 4 That's it and I'm now I'm inside a milliter and here I do have the help And here's where how I figure out all the commands in the first place that you have Do TSM network power SMS. I like it for us this one sensor around and you can use sensor That is I will give you all the sensors are actually dissimilar to have like it's enabled especially enable humidity is enabled and all these things and when you do sensor Get light It will get if you give you the actual value and if you do sensor set light zero It's actually the command we want and it's actually you're not up changing the things The good thing about this is that sensor set light It gets run later on adb emu sensor set light So if you go to telnet and figure out device you can go out of the terminal and use adb emu to run this command So we got our first step, which is adb sensor set light So let's go to the next step the next step will be to Incorporate or implement this in App in adb app in adb we talk about is a wrapper around adb So if you want to do when you add a new command for the emulator actually these All these new commands are actually in the adb emu commands and then And the meta is going to be just like that. It's gonna adb exact emu Sensor set light and the parameter that you are sending it to it So let's go to our code. I actually was cheating here. I I comment everything so this is adb emu commands inside the app in adb package And I'm gonna start enabling this That's it. That was our first step app in adb. It's done what we do next We want to start testing all these together So I'm just gonna do npm link and at the end we're gonna npm link all the packages that we may update it To open and create a new start up in from the command line So the next step was This one we cover this part the next part is going to the driver In the Appian driver We're actually going to need to add a new method the light sensor Which is actually going to verify is this an emulator if this emulator this method is available I'm just gonna call this adb and sensor light. So let's go to that part That's too fast that My go back All the commands of the new methods we added driver in command actions So you what if you are that in a new feature to Appian? It's usually going to that directory So let's open that one. I have it right here Comment this. This is how it will look like and let's go to the next step. We got this part Let's go to the next one. We talk about the next one will be the routes The new endpoint so taking an example Let's take a look at this how the new input will look like I'm going to take an example as a fingerprint. This I'm familiar with this one. What I want to do is actually add this new endpoint That's going to call It's going to be dash fingerprint from the fingerprint. We actually want to A parameter is required. There's a fingerprint ID So then we can use that in our methods to actually send different fingerprints I can talk with you guys about fingerprints. We got that actually requires the emulator to be Provision but that's super easy to do so taking that example And go we're going to add a new light sensor and so Same path Appian device land sensor and we actually want same as fingerprint We want to have a parameter that is required and we're going to call it light And let's go to the code This is on the roads It's actually be size fingerprints And let's go to the next step the next step. We have updated it. We we figured out the command We have dated appian edb. We have dated driver And we have dated base driver the next thing we'll put all these things together into appian for that To make it easier actually you go to all the package you just link The device to we easily test it you do mp m link appian edb appian driver base driver And you call it up from appian. So I have a script for that That is actually going to build this for us. So it's easy So this is actually like Making all this linking. So you have all the latest dependencies in appian And one that is done We're going to be able to run it The new app in the meantime, we can actually jump to the next step. What was the next step like we have up in running What was the next step that we'll need to do? clients So let's move to the client Uh for like For this talk I actually gonna update the client the wd client from Node.js So This is a actually client. I usually use a wd. There's a lot of other clients like weptorio. It's also super useful It's really nice But i'm gonna i prepare my demo with this one. So Let's go to the client I have it around inside the client Uh all the uh Methods and inside the link leaf Command.js and the client we're actually gonna add a new Call to the a new request to the api Same so if you look at the step before it's actually on the Up here what we're gonna do is actually do this session Call these requests with a post and send the data which the data in this case is going to be the light So update the client Which is this one Okay, so We have dated everything Now we need like we have App in updated we have the client updated Now we want to build our test. So our test will look like this What we're gonna do This is like a really quick test what we're gonna do. We're gonna call the light sensor We're gonna search for a specific id. We're gonna make sure it's like actually using this color This is It's not the best test But it's just to prove like you can add new type of Features to api and when it's zero is actually gonna do the same but if I actually change to that point So I have that test already here You don't see it. So we have the We have app in we have the client and we have the test So if everything went well It should work and we'll probably have a new app in feature Testing oh, this is still running. Okay. We'll have a new app in feature Using a new light sensor feature and have a test to test the app that we actually gonna release to the market This is still running. I was not expected to take that long but one second So we have the clients Updated we have all the packages We're gonna start the server We're gonna start the app in server Takes a while So this is using the new app inversion that I actually changed the Package name so you can say app in conf and another terminal. We're gonna try to run I need a new terminal We're gonna try to run this new test Sorry, I'll be there right there and everything went well. This test should be running fingers crossed It's doing things We have the logs starting the application And that's it. This is a new feature to api and testing our new application a new feature And we actually have to can integrate these to api and I'm probably gonna finish this next week With all the unit tests that you'll need to actually create the app in feature That's it. Thank you Questions Yeah, well, I'm now I just updated the Mino JS client by one it becomes an app in feature we can update all the clients So that's because you can use it in Java 5.0 Yes, I did it live right here right now Yeah, yeah, this was done for the conference This is not dread. He's not in apium yet. It's gonna be in the next release Yeah, I was Like will it work for the ios or android? No, this is just for android emulators. So it will not work for ios emulator. No So if we have like a hybrid app We want to test it out in the ios also. So it will not work for the ios. It will work for the android This is I you can only do this because the android emulator provide you this The ios device or simulator doesn't provide this. So there's nothing we can do about it from the apium side So if the apium simulator actually starts providing this in the future, we can add it But there's this is actually specific to the emulator. Let me just keep it These features like the fingerprint call and sms and all The demo shown with the android emulators supported by the google So does it works with the genie motion emulators as well if they're using the base Image sdk from google they should work. Okay. I don't know what genie motion is doing with their emulators So I have no idea Like this is uh, this is just like i'm taking the base emulator that google is giving to you choose the sdk I have no idea what genie motion is doing on top of that, but it should it will probably work Yeah, thanks What is the degree of reliability that we can have between a real device and a simulator because all these options Look really good, but i'm used to to use real devices. So I can trust 100 percent Yeah, you are going to use this for Functional testing you're not going to be testing performance or anything like if this is showing on emulator It should show on and real devices The only thing that you need to aware in real devices is like vendor specific real devices like for example, I don't know Uh, Samsung or Motorola may display the things differently, but this should work Like you can test this on an emulator And if it's Going through that it should work on a real device There's no There's probably no weird scenarios like the code that I have on my application actually receiving the sms It's going to be the same one on the real devices So it's it's just very fine that when you go to sms the api The common api that you use to get sms will receive it So you can this should be able to test on emulators before going to a real device And another one like the apium adb Rapper it works. I saw it's emu, but it works for real devices also. Yes. It's the same. It's the same all the Api need be is just a wrapper around adb If you can do things through adb with a real device, you will be able to do it in apium Anything that you can do where to be we usually add it to api need to be and add all these new features when we can There's a lot of code that we actually do for real devices Okay, and and thanks really much for the demo sure So we have this apium client in our machine so we can do a apium new version in our machine and use it Like you created a beta version now For apium Similarly, can we do it? Yes, i'm by the end of the day. We're actually making official release if The apium guys approve it, but they have at the end right by the end of the day I'm gonna Publish or make it public and you guys can try it yourself in your laptop Okay, let's see if the apium guys accept this new feature Uh, do you know, uh This feature has a limitation between the android versions No, I don't think so This is something provided by the emulator. I'm almost sure it will work in all of them. I only tried seven, but You want to see with me, you know In a desk like we can try it from 4.4 to even 10 That is in beta Thank you One more questions Oh, okay There's one more question Will there be some support in future for camera plugin as well for camera we don't I don't The camera is kind of tricky Because I can tell you why let me go back to emulator And you guys can see the camera is kind of tricky because it's something that's not yet support from the emulator, but If along with the light, there's another things that you can actually add in here. There's actually humidity pressure proximity Magnetic field that we can add all those features that are already here There's nothing in emulator for camera. So for that you actually have to start mocking There's some solution again actually Create a fake webcam and when you start the emulator, you just point it to that fake webcam and that's how you test your apps There's nothing in the emulator itself Okay, thanks. I guess we have normal questions now. Cool. Thank you. Thanks Bruno