how to automate android app using appium in Android | Launch Chrome browser in Real Android Device

Описание к видео how to automate android app using appium in Android | Launch Chrome browser in Real Android Device

Setting Up The Appium Tool On Windows and Automate Application and Launch Chrome Browser
Appium is an open source test automation framework for use with native, hybrid and mobile web apps.
It drives iOS, Android, and Windows apps using the WebDriver protocol.
Appium is a “cross-platform tool” i.e. it allows you to write tests on multiple platforms (iOS, Android, Windows), using the same APIs. Using Appium, you can run automated tests on actual devices like tablets, mobile phones.
Appium is an HTTP server written in Node.js that creates and handles multiple WebDriver sessions. Appium starts tests on the device and listens for commands from the main Appium server. It basically the same as the Selenium server that gets HTTP requests from Selenium client libraries.
Appium has proven its flexibility and scalability in native mobile app and game testing, as those apps and games tend to be pretty much identical on both platforms, Android and iOS. The benefit of having these sort of cross-platform framework helps using the identical script either app/game is running on either platform. The very same applies for the mobile web. Appium scripts run nicely whether you are testing website on Chrome, on Android and iOS.

Another important benefit of Appium is that users can write tests using their favorite development tools, environment and programming language, such as Java, Objective-C, JavaScript, PHP, Ruby, Python or C#, among many others.
Appium is most widely Android Automation tool, it is Open source and Cross-Platform. Appium is actually developed as an HTTP server using NodeJS.
At the heart of Appium tool, its key components are,
Appium Server - An HTTP Server that listens to the Appium Http based clients and uses its UI Automator driver to translate automation commands to language which Android devices can understand.
Appium framework exposes Appium Clients for different languages like Java, Python. Supported languages are listed in Appium clients.
Appium supports different drivers to automate various end platforms.
Appium Clients and Appium Server communication

Appium Client and Server use JSON Wire protocol over HTTP to communicate with each other. Communication between Appium clients and Appium Server could be complex and to overcome this complexity, the data is exchanged in JSON format which is structured.

To kick off the communication, a session is created as an initial step. Desired Capabilities are key-value pairs that are preferences for this session. These preferences include mandatory information (apart from other optional information) like the platform name, device name, application path which is the key information in automation.

Here is an example of the data sent via the JSON Wire Protocol with the desired capabilities to establish a session to Appium Server.
Starting Appium Server
In this section, we will use Appium Desktop for running the Appium Server. Appium Desktop is an excellent utility using which you can run an Appium Server and as well as Start Inspector session to load the application manually and find out the location elements of the Application under automation.To start Appium Server,

Launch the installed Appium Server in your machine (Example: In Windows from Start Menu Programs)
Click on the Start Server buttonThis will start Appium Server (localhost:4723) as shown in the screenshot below. Notice Start Inspector Session to start the inspector sessionUsing Inspector Session
Inspector utility of Appium can be used to create a manual session and then find the element location identifiers

Launch the Inspector Utility from the Appium menu as shown above in the Start Appium Server section.Specify the mandatory Desired Capabilities as shown above and click Start Session.Once you click the Start Session, a session is established to Appium Server, which mediates to the specified device in ‘deviceName' capability. Appium Server installs the application specified in ‘app' capability and Inspector utility will display the Application.

Inspector utility allows you to click any element in the application and displays all the properties related to the element which can be used to locate it at the runtime. See the screenshot below, the Username element is selected and all the attributes of this element are displayed in the right pane.
Preparing Mobile Device For Automation With Appium
Connect your Mobile Testing device via USB to PC. Enable Developer Mode on Mobile Phone before automating the app.

Steps to Enable Developer Mode/Options on Android Phone or Tablet:

1) Open Settings, Tap on ‘About’ Option, Tap on ‘Software Information’, Tap On ‘More’.

2) Tap on “Build number” 7 times to enable Developer options.

3) Go back to Settings and make sure that the “Developer options” setting is there.

4) Tap on Developer options and turn on the USB Debugging option from the menu on the next screen.

Комментарии

Информация по комментариям в разработке