Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Install Guide Mac Mobile Automate

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 14

Mobile App Automation Tools

Documentation and Installation Guide


Author: Priyadharshini E (EMP NO: 1100-6059) (Senior Software Engineer)

Introduction
This documentation provides an overview of various tools and software utilized for mobile app
automation on the Macbook Pro platform. These tools enable testers to automate the testing of
mobile applications across different platforms and devices.

To perform mobile app automation on a MacBook Pro, you typically need the following
prerequisites:

1. MacBook Pro: Any recent MacBook Pro model should work fine.
2. Operating System: Ensure you have macOS installed. Most automation tools support
recent versions of macOS.

Tools and Software


1. Homebrew
Description: Homebrew is a package manager for macOS that simplifies the installation of
software packages.

Purpose: Used for installing and managing dependencies and tools required for mobile app
automation.

Installation Steps: The step-by-step instructions to install Homebrew on your MacBook Pro:

1. Open Terminal: You can find Terminal in the "Utilities" folder within the
"Applications" folder, or you can use Spotlight Search (Cmd + Space) and type
"Terminal" to open it.
2. Install Command Line Tools for Xcode: If you haven't already installed Xcode
Command Line Tools, you might need to do so. In Terminal, type the following
command and press Enter: xcode-select –install.
3. Install Homebrew: Once you have Terminal open, you can install Homebrew by
copying and pasting the following command into Terminal and pressing Enter: /bin/bash -
c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh) ".

(This command will download and execute the Homebrew installation script.)

4. Follow the Prompts: After running the installation command, you'll be prompted to
enter your password. This is required for the installation to proceed. When you type your
password, no characters will appear on the screen, but Terminal is still registering your
input. Press Enter after typing your password.
5. Wait for Installation: The installation process may take a few minutes depending on
your internet connection speed. Homebrew will automatically download and install the
necessary files.
6. Verify Installation: After the installation is complete, you can verify that Homebrew
was installed correctly by running: brew –version.
(This command will display the version of Homebrew installed on your system. If Homebrew
was installed successfully, you'll see the version number in the output.)

2. Node.js
Description: Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine.

Purpose: Utilized for running JavaScript-based automation scripts and setting up the
environment for tools like Appium.

Installation Steps: Step-by-step guide to installing Node.js via Homebrew:

1. Update Homebrew: It's always a good idea to update Homebrew to the latest version before
installing any new packages. Run: brew update.
2. Install Node.js: Once Homebrew is installed and updated, you can install Node.js by running:
brew install node.
3. Verify Installation: After the installation is complete, you can verify that Node.js and npm
(Node Package Manager) were installed correctly by checking their versions. Run the following
commands: node –v
npm –v.
This will display the installed versions of Node.js and npm, respectively.
3. Appium
Description: Appium is an open-source tool for automating mobile, native, and hybrid
applications on iOS and Android platforms.

Purpose: Used for writing and executing automated tests for mobile applications across different
devices and operating systems.

Installation Steps: Step-by-step guide to installing Appium Homebrew:

 Once you have Node.js installed, you can install Appium using npm (Node Package
Manager). Run the following command:

npm install -g appium.

 After installation, you can verify that Appium is installed correctly by running:

appium –version

 To start the Appium server, simply run the following command in Terminal:

Appium

This will start the Appium server, and you'll see the logs indicating that the server is running.

 Appium Desktop provides a graphical interface for working with Appium. You can install it via
Homebrew Cask by running:
brew install --cask appium-desktop

4. Java 8
Description: Java 8 is a programming language and computing platform widely used for
developing automation framework for mobile applications.

Purpose: Required for writing automation scripts using Java and running test suites using
frameworks like TestNG.

Installation Steps: Before installing Java 8, you may want to check if it's already installed on your
system. Open Terminal and run:

java –version
 Download Java 8 from the official Oracle website or from other trusted sources. Here's a
direct link to the Oracle JDK 8 download page: Java SE Development Kit 8 Downloads

 Once the download is complete, double-click on the downloaded .dmg file to mount the disk
image.

 Inside the mounted disk image, you'll find a .pkg file. Double-click on it to start the
installation process.

 Follow the on-screen instructions to complete the installation. You may need to enter your
administrator password during the process.

 After the installation is complete, you can verify that Java 8 is installed correctly by
reopening Terminal and running:

java –version

This command should now display the version information for Java 8.

 Set JAVA_HOME Setting the JAVA_HOME environment variable can be useful for some
applications. To set JAVA_HOME to Java 8, you can add the following line to your shell
profile (.bash_profile, .bashrc, .zshrc, etc.):

export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)

Save the file, and then run source ~/.bash_profile (or source ~/.bashrc, source
~/.zshrc, etc.) to apply the changes immediately.

5. Eclipse IDE
Description: Eclipse IDE is a popular integrated development environment for Java
development.

Purpose: Provides a comprehensive environment for writing, debugging, and running


automation scripts written in Java.

Installation Steps:

 Visit the official Eclipse website at https://www.eclipse.org/downloads/ and download the


Eclipse IDE for Java Developers package. This package includes everything you need to get
started with Java development in Eclipse.
 Once the download is complete, locate the downloaded .tar.gz file and double-click on it to
extract the contents. This will create a folder containing the Eclipse application.

 Drag the extracted Eclipse folder to your Applications folder. This will install Eclipse on your
system.

 Open Finder and navigate to your Applications folder. Double-click on the Eclipse icon to
launch the Eclipse IDE.

 When you first launch Eclipse, you'll be prompted to select a workspace. This is the directory
where your projects and preferences will be stored. You can choose the default workspace or
specify a custom location.

 Once Eclipse is up and running, you can verify that it's installed correctly by creating a new Java
project or opening an existing one.

6. Selenium
Description: Selenium is a suite of tools for automating web browsers.

Purpose: Integrated with Appium, it enables the automation of mobile web applications using
web browser automation techniques.

Installation Steps:

Selenium WebDriver is a set of APIs that allows you to automate web browsers across different
platforms. You can add Selenium WebDriver as a dependency in your Java project using a build
automation tool like Maven or Gradle.

 Setting Up a Java Project in Eclipse:

 Open Eclipse IDE.


 Create a new Java project by selecting File > New > Java Project.
 Give your project a name and click "Finish".

 Adding Selenium WebDriver Dependency:

 Navigate to your project directory in Terminal.


 Create a pom.xml file if you don't already have one.
 Add Selenium WebDriver dependency inside the <dependencies> tag in your pom.xml
file.
 Save the pom.xml file.

 Configuring WebDriver in Your Java Project:

 Create a new Java class or package in your Eclipse project.


 Import WebDriver and other necessary classes
 Write your Selenium WebDriver code using the appropriate WebDriver instance.

WebDriver driver = new ChromeDriver(); // Initialize ChromeDriver

driver.get("https://www.example.com"); // Open a website

 You're now ready to run your Selenium tests. Execute your Java program from Eclipse or using
Terminal.

7. TestNG
Description: TestNG is a testing framework inspired by JUnit and NUnit.

Purpose: Used for organizing and running automated tests written in Java. Integrates seamlessly
with Eclipse IDE for test management.

Installation Steps:

 If you've created a Maven project, open the pom.xml file located in the root directory of your
project.
 Add the TestNG dependency inside the <dependencies> tag:

 Save the pom.xml file.

 If you've created a Maven project, you need to update it to download the TestNG dependency.

 Navigate to your project directory in Terminal.


 Run the following command to update the Maven project:

mvn clean install

 Create a new Java class for your TestNG test case.


 Annotate your test class with @Test annotations to define test methods.
 You can use TestNG annotations like @BeforeTest, @AfterTest, etc., for setup and
teardown.

TestNG PLUGINS :
 Install TestNG Plugin:

 Open Eclipse IDE.


 Go to Help > Eclipse Marketplace.
 In the Eclipse Marketplace dialog, search for "TestNG" in the search bar.
 Find the "TestNG for Eclipse" plugin and click "Install".
 Follow the prompts to complete the installation process. You may need to restart Eclipse
after installation.

 Create a New Java Project:

 In Eclipse, create a new Java project by selecting File > New > Java Project.
 Give your project a name and click "Finish".

 Add TestNG Library to the Build Path:

 Right-click on your project in the Project Explorer.


 Select Build Path > Configure Build Path.
 In the Libraries tab, click on "Add Library".
 Choose "TestNG" and click "Next".
 Select "TestNG library" and click "Finish".

 Write TestNG Test Classes:

 Create a new Java class for your TestNG test case.


 Annotate your test class with @Test annotations to define test methods.
 You can use TestNG annotations like @BeforeTest, @AfterTest, etc., for setup and
teardown.

 Run TestNG Tests:

 Right-click on your test class or test suite XML file.


 Select Run As > TestNG Test.
 Eclipse will execute your TestNG tests and display the results in the "TestNG" view.

 View TestNG Results:

 Eclipse provides a TestNG Results view where you can see the status of your test cases
(passed, failed, skipped) and any associated logs or stack traces.
 You can open this view by going to Window > Show View > Other > TestNG >
TestNG.

8. Appium Inspector
Description: Appium Inspector is a tool provided by Appium for inspecting elements of mobile
applications.

Purpose: Helps in identifying UI elements and generating automation scripts by recording


interactions with the application.

Installation Steps:

Download the Appium Desktop application from its GitHub releases page: Appium Desktop
Releases.

Once downloaded, you can simply drag the Appium Desktop app into your Applications folder.

 Start Appium Desktop

Navigate to your Applications folder and double-click on the Appium Desktop app to launch it.

 Once Appium Desktop is open, you'll see the option to start a new server session.
 Configure your desired capabilities for the session (like platformName, deviceName, etc.).
 Click on the "Start Session" button.
 This will launch the Appium Inspector, where you can interactively inspect elements of your
mobile application.

9. BrowserStack AppLive

Description: BrowserStack AppLive is a real device cloud platform for mobile app testing.

Purpose: Allows testing mobile applications on a wide range of real devices, browsers, and
operating systems.

Installation Steps:

Sign up for BrowserStack Account


 If you haven't already, sign up for a BrowserStack account. You can do this on the BrowserStack
website (https://www.browserstack.com).
 Choose a plan that suits your needs. BrowserStack offers a free trial, so you can start with that if
you're unsure.

Log in to BrowserStack

 Once you have signed up, log in to your BrowserStack account using your credentials.

Access BrowserStack AppLive

 In the BrowserStack dashboard, navigate to the "AppLive" section. This section allows you to
test your mobile apps in real-time on real devices.

Upload Your App

 To test your app, you need to upload it to BrowserStack. You can do this by clicking on the
"Upload App" button in the AppLive section.
 Follow the instructions to upload your app file. BrowserStack supports various formats, including
.apk for Android and .ipa for iOS.

Choose a Device

 Once your app is uploaded, BrowserStack will present you with a list of real devices that you can
test your app on.
 Choose a device from the list that you want to test your app on. You can filter devices by OS
version, manufacturer, and more.

Start Testing

 After selecting a device, click on it to start testing your app.


 BrowserStack will launch the selected device with your app installed. You'll be able to interact
with the app in real-time, just like you would on a physical device.

Use the Testing Tools

 BrowserStack provides various testing tools to help you debug and test your app effectively.
These include debug logs, device logs, network logs, and more.
 Explore the testing tools available to you to identify and fix any issues with your app.

End Testing Session

 Once you've finished testing your app, you can end the testing session by closing the device
window.
 Your testing session will be saved in your BrowserStack account, allowing you to review it later if
needed.

10. Android Studio and Xcode


Description: Android Studio is the official integrated development environment (IDE) for
Android app development, while Xcode is for iOS app development.

Purpose: Used for developing, debugging, and testing mobile applications natively on Android
and iOS platforms.

Installation Steps for Android Studio:

Download Android Studio

 Go to the Android Studio download page.


 Click on the "Download Android Studio" button.
 Follow the instructions for downloading the macOS version.

Install Android Studio

 Once the download is complete, locate the downloaded file (usually in your Downloads
folder) and double-click to open it.
 Drag the Android Studio icon into the Applications folder to install it.

Set up Android Studio

 Open the Applications folder and locate Android Studio.


 Double-click on Android Studio to launch it.
 On the Welcome screen, select "Configure" > "SDK Manager" to install the necessary
Android SDK components. Follow the on-screen instructions to install the required SDK
components. You may need to accept licenses and download additional packages based
on your needs.

Configure SDK Path

 After installing the SDK components, it's a good idea to configure the SDK path in Android
Studio.
 Go to "Preferences" (Android Studio > Preferences) or press Command + , to open the
Preferences window.
 In the left sidebar, navigate to "Appearance & Behavior" > "System Settings" > "Android
SDK".
 Here, you can specify the Android SDK location. If you installed the SDK using the SDK
Manager, the default path should be something like /Users/<your-
username>/Library/Android/sdk.

 Click "Apply" and then "OK" to save the settings.

Set up Virtual Devices

 If you plan to develop and test Android applications, you may want to set up virtual devices
(emulators) for testing.
 In Android Studio, go to "Tools" > "AVD Manager" to open the Android Virtual Device
Manager.
 Click on the "Create Virtual Device" button to create a new virtual device.
 Follow the wizard to select a device definition, system image, and configure other settings as
needed.

 Once the virtual device is created, you can launch it from the AVD Manager for testing your
applications.

Update Android Studio


 Android Studio receives updates regularly. It's a good practice to keep your IDE up to date to
access the latest features and bug fixes.

 You can check for updates by going to "Android Studio" > "Check for Updates" on macOS.

Installation Steps for Xcode:

Installing Xcode on a Mac is essential for iOS and macOS development. Here's a step-by-step
guide:

Open the Mac App Store

 Click on the Apple menu () in the top-left corner of your screen.
 Select "App Store" from the dropdown menu.

Search for Xcode

 In the search bar at the top-right corner of the App Store, type "Xcode" and press Enter.
 Xcode should appear as the first result. Click on it to open the Xcode page.
Install Xcode

 On the Xcode page, you should see an "Install" button. Click on it.
 You might be prompted to enter your Apple ID credentials. Enter your credentials and click "Sign
In" if required.
 After signing in, the installation process will start automatically.
 Depending on your internet connection speed, it may take some time to download and install
Xcode.

Agree to the License Agreement

 Once the installation is complete, launch Xcode from your Applications folder.
 You'll be prompted to agree to the Xcode license agreement. Read the agreement and click
"Agree" if you agree to the terms.

Install Additional Components

 After agreeing to the license agreement, Xcode might prompt you to install additional
components such as command line tools. Follow the on-screen instructions to install these
components if necessary.

Configure Xcode

 Upon first launch, Xcode may ask you to sign in with your Apple ID. Signing in is optional, but it
allows you to access additional features such as submitting apps to the App Store.
 You may also want to customize Xcode preferences according to your preferences. You can
access preferences by clicking on "Xcode" in the menu bar and selecting "Preferences".

Check for Updates

 Xcode receives updates regularly with new features, bug fixes, and performance improvements.
It's a good idea to keep Xcode up to date.
 You can check for updates by opening the App Store, clicking on your profile icon in the bottom-
left corner, and selecting "Updates".

11. Chrome Browser and Firefox Browser


Description: Chrome and Firefox are popular web browsers.
Purpose: Used for testing mobile web applications and executing automation scripts that interact
with web elements.

Installation Steps:

Installing Google Chrome:

1. Download Chrome:
o Open your existing web browser (e.g., Safari) and go to the Google Chrome website.
o Click on the "Download Chrome" button.

2. Install Chrome:
o Once the download is complete, locate the downloaded file (usually in your Downloads
folder) and double-click on it to open.
o Drag the Google Chrome icon into the Applications folder to install it.

3. Open Chrome:
o Go to your Applications folder and double-click on Google Chrome to launch it.
o You can also drag Chrome to your Dock for easy access.

Installing Mozilla Firefox:

1. Download Firefox:
o Open your existing web browser and go to the Mozilla Firefox website.
o Click on the "Download Firefox" button.

2. Install Firefox:
o Once the download is complete, locate the downloaded file and double-click on it to
open.
o Drag the Firefox icon into the Applications folder to install it.

3. Open Firefox:
o Go to your Applications folder and double-click on Mozilla Firefox to launch it.
o You can also drag Firefox to your Dock for easy access.

Additional Tips:

 Setting Default Browser:


o After installing both browsers, you might want to set your preferred browser as the
default. You can do this by going to "System Preferences" > "General" and selecting your
preferred browser from the "Default web browser" dropdown menu.

 Browser Updates:
o Both Chrome and Firefox receive regular updates. It's a good practice to keep your
browsers up to date to ensure security and performance improvements. Updates for
Chrome can be found in the Chrome menu (Chrome > About Google Chrome), and for
Firefox, in the Firefox menu (Firefox > About Firefox).

Conclusion
Mobile app automation tools and software play a crucial role in streamlining the testing process
for mobile applications. By leveraging these tools, developers and testers can ensure the quality
and reliability of their mobile apps across different platforms and devices. The combination of
Homebrew, Node.js, Appium, Java 17, Eclipse IDE, Selenium, TestNG, Appium Inspector,
BrowserStack AppLive, Android Studio, Xcode, Chrome Browser, and Firefox Browser forms a
comprehensive toolchain for efficient mobile app automation on the macOS platform.

You might also like