Running Sahi on Android

info Please follow IPad instructions to run Sahi on an Android device.
Follow the instructions below to run Sahi on Android Emulator. These were tested on Android 2.3.3.

Start the Emulator

Assuming that you have an avd called sahi, start it:
cd D:\Experiments\android-sdk-windows\tools
emulator.exe -avd sahi -scale 0.7 -no-boot-anim
(The bare minimum could just be emulator.exe -avd sahi) For newer Android versions (after 2.3.3), start the emulator using
cd D:\Experiments\android-sdk-windows\tools
emulator.exe -avd sahi -scale 0.7 -no-boot-anim -http-proxy http://localhost:9999

Configure the proxy on the Emulator's browser (for 2.3.3):

  1. On the emulator, navigate to Home > Menu > Settings > Wireless & networks > Mobile networks > Access Point Names > TelKila
  2. Change Proxy to 10.0.2.2
  3. Change Port to 9999 NOTE: 10.0.2.2 is your localhost's IP as seen by the Android emulator NOTE: For Android versions > 2.3.3, proxy is already configured via the emulator parameter "-http-proxy http://localhost:9999".

Configure Sahi browser_types.xml

  1. Open Dashboard -> Configure -> browser_types.xml
  2. Before the closing
</browserTypes> add
<browserType>
  <name>android</name>
  <displayName>Android</displayName>
  <icon>opera.png</icon>
  <path>D:\Experiments\android-sdk-windows\platform-tools\adb</path>
  <options> shell am start -a android.intent.action.VIEW -d </options>
  <processName>adb.exe</processName>
  <useSystemProxy>false</useSystemProxy>
  <capacity>1</capacity>
  <force>true</force>
</browserType>
3) Save, restart Sahi.

Run the test using testrunner.bat

  1. Click on Dashboard -> Bin
  2. Run
testrunner.bat demo/clicksTest.sah http://gramam/demo/ android
warningLIMITATION: Android Emulator does not work with the proxy for HTTPS sites. The device however will work.