Friday, May 16, 2014

Mobile Browser Perf Automation Android

Products which can use this:

  1. E-invoice
  2. QBO-lite
  3. Virtual Office

Tools:

  1. Google Chrome
  2. Developer Tools
  3. Using Selenium 
  4. Appium

Setup:
 

 A. On the Android Phone:

1. Unlock the developer mode on Android phone.
2. Give a name to android phone by going to
3. Download Chrome app on Android phone
4. Connect the Android phone to mac

B. On the Macbook:

1. Install Chrome browser.
2. Click on ‘Customize and Control Google chrome’ tab from the browser menu.
3. Click on ‘Inspect devices’ and check the box which says “Discover USB devices”


 Steps to Automate:


1. Launch the chrome app on the phone
2. You can use adb from mac book to do that.
3. Use selenium to launch chrome://inspect/#devices chrome developer tool inspect device section.
4. Now if you have launch chrome correctly on the device and if you have done above setup right, then you should see something like this:

5. Add your e-invoice link in “Open tab with url” text section and click on Open button. (selenium)
Right now I am trying to open "http://www.intuit.com/"
You will see something like this:

6. Now click on  inspect button. It will open up developer tool window.
You will see something like this:

7. Click on the network tab and check the box which says preserve the logs


8. Go to Audits section and on Audits tab, check Select All.
9. Check the radio button “Reload page and Audit on load”
10. Go to Network tab and Right click on the log and click on "Save as HAR with content"


11. Upload this data on server and render it using some HAR viewer