I am working on a POC where we are trying to generate scripts automatically when the user performs action on Mobile devices (Web & Native app on Android & iOS) by connecting it to the system.
We did a similar solution for Desktop web application using JavaFx which captures the actions [click, sendkeys, etc] and the web elements. If the user provides the url and performs the test steps manually once, it will identify the objects and actions and generate selenium scripts accordingly. Now we wanna do the same for Mobile.
Is there any Appium API to do this ??
Please help me out if any one knows how to leverage this.
If you download the Appium desktop client, you can pass in your parameters for App, device etc. and then you can use it to view the element tree and also record macros through it.
My requirement is i’l provide a UI in which use can select the application and click on ‘Start’ button and perform test steps on it. Once the user clicks ‘Stop’ button, script should get generated automatically.
@Kirthi you can do it for java, javascript ,ruby and python in Appium client as said by @simongilmurray is totally agreeable .try to use it and copy to clipboard and past the code in you test class file
My requirement is I wanna build a new tool similar to that where I can record and generate scripts. Does Appium provides any library that i leverage it?
learn how appium opens driver against iOS and Android
with your ui create minimum number variables needed from user fill to open driver
make it work now all together with your program
once above 3 done now you can take screenshot using Appium command and page source. Using them you should be able show user device screen and identify elements user clicks with your screen.
now you can write your script identifying one by one user clicks. As we see user should click on screen you provide but not device itself.
@Kirthi where you able to achieve automatic script generation for mobile? Also, how did u acheive for web browser using JavaFX Can you please share some input. I am trying to do the exact same thing as you are for web browser & mobile.