Download android.bat create avd

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Selenium Grid2 Setup
OS: Windows7
Android SDK: C:\cso\software\Android\adt-bundle-windows-x86_64-20130522 (1)\adt-bundlewindows-x86_64-20130522\sdk
Selenium Android WebDriver C:\cso\software\Android\adt-bundle-windows-x86_64-20130522
(1)\adt-bundle-windows-x86_64-20130522\sdk \android-server-2.32.0.apk
Selenium Grid2 startup script:
set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_21
set PATH=%JAVA_HOME%\jre\bin;%JAVA_HOME%\bin;%PATH%
set SELENIUM_VERSION=2.33.0
set CHROME_VERSION=chrome-27.0.1453.110
set HUB_URL=http://localhost:4444/grid/register
set
CHROME_DRIVER_LOC=C:\cso\software\Java\selenium\chromedriver_win32_2.0\chromedrive
r.exe
start java -jar selenium-server-standalone-%SELENIUM_VERSION%.jar -role hub
start java -jar selenium-server-standalone-%SELENIUM_VERSION%.jar -role node Dwebdriver.chrome.driver=%CHROME_DRIVER_LOC% -hub %HUB_URL% -port 5556 -nodeConfig
webconfig.json
Selenium Grid console:
TestNG Setup:
<test name="TEST16" junit="false" preserve-order="true">
<parameter name="browser" value="android" />
<parameter name="platform" value="ANDROID" />
<classes>
<class name="com.selenium.tests.haute.HomePageCTATestCaseAndroid" />
</classes>
</test>
Java Test:
if (browser.equalsIgnoreCase("android") ) {
System.out.println("android browser running from TestNG");
new DesiredCapabilities();
DesiredCapabilities cap = DesiredCapabilities.android();
cap.setJavascriptEnabled(true);
cap.setCapability("ensureCleanSession", "true");
cap.setPlatform(org.openqa.selenium.Platform.ANDROID);
driver = new RemoteWebDriver(new
URL("http://localhost:5556/wd/hub"), cap);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}
Emulator creation and startup commands used:
C:\cso\software\Android\adt-bundle-windows-x86_64-20130522 (1)\adt-bundle-
android.bat create avd -n
my_first_android -t 12 -c 100M
windows-x86_64-20130522\sdk\tools>
Auto-selecting single ABI armeabi-v7a
Created AVD 'my_first_android' based on Google APIs (Google Inc.), ARM
(armeabi-v7a) processor,with the following hardware config:
hw.lcd.density=240
vm.heapSize=48
hw.ramSize=512
C:\cso\software\Android\adt-bundle-windows-x86_64-20130522 (1)\adt-bundlewindows-x86_64-20130522\sdk\tools>android
Available Android targets:
---------id: 1 or "android-3"
list targets
Name: Android 1.5
Type: Platform
API level: 3
Revision: 4
Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P
ABIs : armeabi
---------id: 2 or "android-4"
Name: Android 1.6
Type: Platform
API level: 4
Revision: 3
Skins: HVGA, QVGA, WVGA800 (default), WVGA854
ABIs : armeabi
---------id: 3 or "android-7"
Name: Android 2.1
Type: Platform
API level: 7
Revision: 3
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WVGA800 (default), WVGA854
ABIs : armeabi
---------id: 4 or "android-8"
Name: Android 2.2
Type: Platform
API level: 8
Revision: 3
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WVGA800 (default), WVGA854
ABIs : armeabi
---------id: 5 or "android-10"
Name: Android 2.3.3
Type: Platform
API level: 10
Revision: 2
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WVGA800 (default), WVGA854
ABIs : armeabi
---------id: 6 or "android-11"
Name: Android 3.0
Type: Platform
API level: 11
Revision: 2
Skins: WXGA (default)
ABIs : armeabi
---------id: 7 or "android-12"
Name: Android 3.1
Type: Platform
API level: 12
Revision: 3
Skins: WXGA (default)
ABIs : armeabi
---------id: 8 or "android-13"
Name: Android 3.2
Type: Platform
API level: 13
Revision: 1
Skins: WXGA (default)
ABIs : armeabi
---------id: 9 or "android-14"
Name: Android 4.0
Type: Platform
API level: 14
Revision: 3
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default),
WVGA854, WXGA720, WXGA800
ABIs : no ABIs.
---------id: 10 or "android-15"
Name: Android 4.0.3
Type: Platform
API level: 15
Revision: 3
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default),
WVGA854, WXGA720, WXGA800
ABIs : no ABIs.
---------id: 11 or "android-17"
Name: Android 4.2.2
Type: Platform
API level: 17
Revision: 2
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default),
WVGA854, WXGA720, WXGA800, WXGA800-7in
ABIs : armeabi-v7a, mips, x86
---------id: 12 or "Google Inc.:Google APIs:17"
Name: Google APIs
Type: Add-On
Vendor: Google Inc.
Revision: 3
Description: Android + Google APIs
Based on Android 4.2.2 (API level 17)
Libraries:
* com.google.android.media.effects (effects.jar)
Collection of video effects
* com.android.future.usb.accessory (usb.jar)
API for USB Accessories
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: WVGA854, WQVGA400, WSVGA, WXGA800-7in, WXGA720, HVGA, WQVGA432,
WVGA800 (default), QVGA, WXGA800
ABIs : armeabi-v7a
C:\cso\software\Android\adt-bundle-windows-x86_64-20130522 (1)\adt-bundlewindows-x86_64-20130522\sdk\tools>emulator.exe
-avd
my_first_android &
C:\cso\software\Android\adt-bundle-windows-x86_64-20130522 (1)\adt-bundlewindows-x86_64-20130522\sdk\tools>cd
..
C:\cso\software\Android\adt-bundle-windows-x86_64-20130522 (1)\adt-bundlewindows-x86_64-20130522\sdk>cd
platform-tools
C:\cso\software\Android\adt-bundle-windows-x86_64-20130522 (1)\adt-bundlewindows-x86_64-20130522\sdk\platform-tools>adb
devices
List of devices attached
emulator-5554
device
adb -s emulator-5554 -e install -r ../android-server2.32.0.apk
974 KB/s (1592370 bytes in 1.595s)
pkg: /data/local/tmp/android-server-2.32.0.apk
Success
adb -s emulator-5554 shell am start -a
android.intent.action.MAIN -n
org.openqa.selenium.android.app/.MainActivity
Starting: Intent { act=android.intent.action.MAIN
cmp=org.openqa.selenium.android.app/.MainActivity }
adb -s emulator-5554 forward tcp:5556 tcp:8080
Result:
Error stack trace in Eclipse console:
...
... TestNG 6.8 beta by Cédric Beust ([email protected])
...
[TestRunner] Running the tests in 'TEST16' with parallel mode:tests
[RunInfo] Adding method selector: org.testng.internal.XmlMethodSelector@5188e507
priority: 10
[TestClass] Creating TestClass for [ClassImpl
class=com.autonomy.optimost.selenium.tests.haute.HomePageCTATestCaseAndroid]
[TestClass] Adding method HomePageCTATestCaseAndroid.runTest()[pri:0,
instance:null] on TestClass class
com.autonomy.optimost.selenium.tests.haute.HomePageCTATestCaseAndroid
[XmlMethodSelector] Including method
com.autonomy.optimost.selenium.tests.haute.setup()
[XmlMethodSelector] Including method
com.autonomy.optimost.selenium.tests.haute.tearDown()
[XmlMethodSelector] Including method
com.autonomy.optimost.selenium.tests.haute.runTest()
[TestNG] Running:
C:\customers\UK\Spurs\PHASE2-JULY2012\svn\SeleniumTests\src\main\java\com\autonomy\optimost\selenium\tests\haute\te
stNG-suite-haute.xml
[SuiteRunner] Created 1 TestRunners
[ThreadUtil] Starting executor timeOut:2147483647ms workers:1 threadPoolSize:5
[[SuiteWorker]] Running XML Test 'TEST16' in Parallel
[TestRunner] Running test TEST16 on 1 classes, included groups:[] excluded
groups:[]
===== Test class
com.autonomy.optimost.selenium.tests.haute.HomePageCTATestCaseAndroid
@BeforeClass HomePageCTATestCaseAndroid.setup(java.lang.String)[pri:0,
instance:com.autonomy.optimost.selenium.tests.haute.HomePageCTATestCaseAndroid@7be
c09b0]
@Test HomePageCTATestCaseAndroid.runTest()[pri:0,
instance:com.autonomy.optimost.selenium.tests.haute.HomePageCTATestCaseAndroid@7be
c09b0]
@AfterClass HomePageCTATestCaseAndroid.tearDown()[pri:0,
instance:com.autonomy.optimost.selenium.tests.haute.HomePageCTATestCaseAndroid@7be
c09b0]
======
[Invoker 392353614] Keeping method
HomePageCTATestCaseAndroid.setup(java.lang.String)[pri:0,
instance:com.autonomy.optimost.selenium.tests.haute.HomePageCTATestCaseAndroid@7be
c09b0] for class [TestClass name=class
com.autonomy.optimost.selenium.tests.haute.HomePageCTATestCaseAndroid]
[Invoker 392353614] Invoking @BeforeClass
HomePageCTATestCaseAndroid.setup(java.lang.String)[pri:0,
instance:com.autonomy.optimost.selenium.tests.haute.HomePageCTATestCaseAndroid@7be
c09b0]
android browser running from TestNG
[Invoker 392353614] Invoking
com.autonomy.optimost.selenium.tests.haute.HomePageCTATestCaseAndroid.runTest
ERROR [TestNG] (HomePageCTATestCaseAndroid.java:64) - FAIL
ERROR [TestNG] (HomePageCTATestCaseAndroid.java:65) org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with
the remote browser. It may have died.
Build info: version: '2.33.0', revision:
'4ecaf82108b2a6cc6f006aae81961236eba93358', time: '2013-05-22 12:00:17'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1',
java.version: '1.7.0_21'
Driver info: driver.version: RemoteWebDriver
[Invoker 392353614] Keeping method HomePageCTATestCaseAndroid.tearDown()[pri:0,
instance:com.autonomy.optimost.selenium.tests.haute.HomePageCTATestCaseAndroid@7be
c09b0] for class [TestClass name=class
com.autonomy.optimost.selenium.tests.haute.HomePageCTATestCaseAndroid]
[Invoker 392353614] Invoking @AfterClass
HomePageCTATestCaseAndroid.tearDown()[pri:0,
instance:com.autonomy.optimost.selenium.tests.haute.HomePageCTATestCaseAndroid@7be
c09b0]
INFO [Forwarding quit on session 95252f59-7e06-42d9-95fd-daa99753395a to remote]
(DefaultRequestDirector.java:723) - I/O exception
(org.apache.http.NoHttpResponseException) caught when processing request: The
target server failed to respond
INFO [Forwarding quit on session 95252f59-7e06-42d9-95fd-daa99753395a to remote]
(DefaultRequestDirector.java:730) - Retrying request
INFO [Forwarding quit on session 95252f59-7e06-42d9-95fd-daa99753395a to remote]
(DefaultRequestDirector.java:723) - I/O exception
(org.apache.http.NoHttpResponseException) caught when processing request: The
target server failed to respond
INFO [Forwarding quit on session 95252f59-7e06-42d9-95fd-daa99753395a to remote]
(DefaultRequestDirector.java:730) - Retrying request
===== Invoked methods
HomePageCTATestCaseAndroid.setup(java.lang.String)[pri:0,
instance:com.autonomy.optimost.selenium.tests.haute.HomePageCTATestCaseAndroid@7be
c09b0]android 2079066544
HomePageCTATestCaseAndroid.runTest()[pri:0,
instance:com.autonomy.optimost.selenium.tests.haute.HomePageCTATestCaseAndroid@7be
c09b0] 2079066544
HomePageCTATestCaseAndroid.tearDown()[pri:0,
instance:com.autonomy.optimost.selenium.tests.haute.HomePageCTATestCaseAndroid@7be
c09b0] 2079066544
=====
Creating C:\customers\UK\Spurs\PHASE2-JULY-2012\svn\SeleniumTests\testoutput\MatchdaySeleniumTests\TEST16.html
Creating C:\customers\UK\Spurs\PHASE2-JULY-2012\svn\SeleniumTests\testoutput\MatchdaySeleniumTests\TEST16.xml
PASSED: runTest
===============================================
TEST16
Tests run: 1, Failures: 0, Skips: 0
===============================================
===============================================
MatchdaySeleniumTests
Total tests run: 1, Failures: 0, Skips: 0
===============================================
Creating C:\customers\UK\Spurs\PHASE2-JULY-2012\svn\SeleniumTests\testoutput\old\MatchdaySeleniumTests\toc.html
Creating C:\customers\UK\Spurs\PHASE2-JULY-2012\svn\SeleniumTests\testoutput\old\MatchdaySeleniumTests\TEST16.properties
Creating C:\customers\UK\Spurs\PHASE2-JULY-2012\svn\SeleniumTests\testoutput\old\MatchdaySeleniumTests\index.html
Creating C:\customers\UK\Spurs\PHASE2-JULY-2012\svn\SeleniumTests\testoutput\old\MatchdaySeleniumTests\main.html
Creating C:\customers\UK\Spurs\PHASE2-JULY-2012\svn\SeleniumTests\testoutput\old\MatchdaySeleniumTests\groups.html
Creating C:\customers\UK\Spurs\PHASE2-JULY-2012\svn\SeleniumTests\testoutput\old\MatchdaySeleniumTests\methods.html
Creating C:\customers\UK\Spurs\PHASE2-JULY-2012\svn\SeleniumTests\testoutput\old\MatchdaySeleniumTests\methods.html
Creating C:\customers\UK\Spurs\PHASE2-JULY-2012\svn\SeleniumTests\testoutput\old\MatchdaySeleniumTests\methods.html
Creating C:\customers\UK\Spurs\PHASE2-JULY-2012\svn\SeleniumTests\testoutput\old\MatchdaySeleniumTests\methods.html
Creating C:\customers\UK\Spurs\PHASE2-JULY-2012\svn\SeleniumTests\testoutput\old\MatchdaySeleniumTests\methods.html
Creating C:\customers\UK\Spurs\PHASE2-JULY-2012\svn\SeleniumTests\testoutput\old\MatchdaySeleniumTests\methods-alphabetical.html
Creating C:\customers\UK\Spurs\PHASE2-JULY-2012\svn\SeleniumTests\testoutput\old\MatchdaySeleniumTests\methods-alphabetical.html
Creating C:\customers\UK\Spurs\PHASE2-JULY-2012\svn\SeleniumTests\testoutput\old\MatchdaySeleniumTests\methods-alphabetical.html
Creating C:\customers\UK\Spurs\PHASE2-JULY-2012\svn\SeleniumTests\testoutput\old\MatchdaySeleniumTests\methods-alphabetical.html
Creating C:\customers\UK\Spurs\PHASE2-JULY-2012\svn\SeleniumTests\testoutput\old\MatchdaySeleniumTests\methods-alphabetical.html
Creating C:\customers\UK\Spurs\PHASE2-JULY-2012\svn\SeleniumTests\testoutput\old\MatchdaySeleniumTests\classes.html
Creating C:\customers\UK\Spurs\PHASE2-JULY-2012\svn\SeleniumTests\testoutput\old\MatchdaySeleniumTests\reporter-output.html
Creating C:\customers\UK\Spurs\PHASE2-JULY-2012\svn\SeleniumTests\testoutput\old\MatchdaySeleniumTests\methods-not-run.html
Creating C:\customers\UK\Spurs\PHASE2-JULY-2012\svn\SeleniumTests\testoutput\old\MatchdaySeleniumTests\testng.xml.html
Creating C:\customers\UK\Spurs\PHASE2-JULY-2012\svn\SeleniumTests\testoutput\old\index.html
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@49da30c3: 149 ms
Creating C:\customers\UK\Spurs\PHASE2-JULY-2012\svn\SeleniumTests\testoutput\testng-results.xml
[TestNG] Time taken by org.testng.reporters.XMLReporter@fa565c6: 17 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter@71e606a9: 6 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 1 ms
Creating C:\customers\UK\Spurs\PHASE2-JULY-2012\svn\SeleniumTests\testoutput\junitreports\TESTcom.autonomy.optimost.selenium.tests.haute.HomePageCTATestCaseAndroid.xml
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@331f9cee: 7 ms
Creating C:\customers\UK\Spurs\PHASE2-JULY-2012\svn\SeleniumTests\testoutput\index.html
[TestNG] Time taken by org.testng.reporters.jq.Main@dfa4f8d: 67 ms
Related documents