top of page

Automation With Appium

Writer's picture: Rakesh KumarRakesh Kumar

Updated: Aug 8, 2019

I tried my best to configure the appium on Mac with easy steps.




Steps To install APPIUM:

Hit below instructions on terminal in order to install Appium


brew install npm

npm install -g appium

gem install appium_lib

npm install -g appium-doctor

appium-doctor --ios


 

Steps for running the tests:

Start Appium on in terminal.(Command- Appium)

appium & # start appium


In another terminal window, run the ruby script recorded.

Using the command (Command - ruby file path)

ruby 'path of your ruby script file'


 

RUBY Installation:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

brew install rbenv ruby-build


# Add rbenv to bash so that it loads every time you open a terminal


echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile

source ~/.bash_profile


# Install Ruby

rbenv install 2.5.1

rbenv global 2.5.1

ruby -v


Note: You can use this also to install appium_lib and ruby by using below shortcuts

-> gem install rails -v 5.1.4 --user-install

-> gem install appium_lib --user-install

-> brew install carthage


To Read data from excel file you need to add EXCELFILEPATH environmental variable.

export EXCELFILEPATH=/Users/userName/Desktop/Appium/Data/HGAutoData.xls


To print added path:

echo $EXCELFILEPATH

 

For more info:



To Record the script with Appium Server you can download appium server from following link:

http://appium.io/

You can mention the settings to record the app in appium server under "JSON Representation Section" as below :

{

"platformName": "iOS",

"platformVersion": "11.3",

"deviceName": "iPhone X",

"automationName": "XCUITest",

"app": "path to your .app file"

}





For Latest Version of APPIUM:

SRStepsSolution/Commands

1.Install HomeBrewruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

2.Install Node JSbrew install node

3.Install Lib-imobile-devicebrew install libimobiledevice –HEAD

4.install ideviceinstallerbrew install ideviceinstaller

5.carthagebrew install carthage

6.Install Ios-Deploynpm install -g ios-deploy

7.Install Xcprettygem install xcpretty


Manual Configuration:

There are some manual configuration for webdriver to setup and install on device:

Open terminal go to

node_modules/appium-xcuitest-driver/WebDriverAgent

(this path is relative to your appium installation).


Run following commands

mkdir -p Resources/WebDriverAgent.bundle

sh ./Scripts/bootstrap.sh -d



Now open WebDriverAgent.xcodeproj in Xcode. Select your development team for the WebDriverAgentLib, WebDriverAgentRunner and integration Apps targets. This should also auto select Signing Certificate. Now there is trick while tweaking these targets. Please check this link.


Build WebDriverAgent once to verify all above steps worked.

xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=' test

Now start appium on command line using “appium -p <PORT>” and throwing commands through your script.


To be continued...

25 views0 comments

Kommentare


Call

Mob: 9972946755

 

Contact:

akarotech@gmail.com

Bengaluru, Karnataka

India

 

  • facebook-square
  • twitter-bird2-square

Follow Us

 

© 2019 by Akaro Technologies (Quality Values Our Work)

bottom of page