我一直在试图让Selenium服务器运行一套现有的测试(在Selenium IDE中制作)在几个目标平台上运行。我正在使用批处理文件,因为我们想在每晚/每周的作业上运行测试。 我有以下几点:在Android上运行硒测试
@echo off
cls
echo Launching Selenium under Internet Explorer
java -jar "c:\selenium\selenium-server-standalone-2.5.0.jar" -trustAllSSLCertificates -multiwindow -htmlSuite "*iehta" "http://mywebsite.com" "c:\selenium\tests\mytest.html" "c:\selenium\results\ie.html"
echo completed....
echo ---------------------------------------------------------------------------------
echo Launching Selenium under Firefox
java -jar "c:\selenium\selenium-server-standalone-2.5.0.jar" -trustAllSSLCertificates -multiwindow -htmlSuite "*firefox" "http://mywebsite.com" "c:\selenium\tests\mytest.html" "c:\selenium\results\firefox.html"
echo completed....
echo ---------------------------------------------------------------------------------
echo Launching Selenium under Google Chrome
java -jar "c:\selenium\selenium-server-standalone-2.5.0.jar" -trustAllSSLCertificates -multiwindow -htmlSuite "*googlechrome" "http://mywebsite.com" "c:\selenium\tests\mytest.html" "c:\selenium\results\chrome.html"
echo completed....
echo ---------------------------------------------------------------------------------
echo Launching Selenium under Opera
java -jar "c:\selenium\selenium-server-standalone-2.5.0.jar" -trustAllSSLCertificates -multiwindow -htmlSuite "*opera" "http://mywebsite.com" "c:\selenium\tests\mytest.html" "c:\selenium\results\opera.html"
echo completed....
echo ---------------------------------------------------------------------------------
echo Launching Selenium under Android
emulator -avd testdroid -no-boot-anim -scale .6
echo Waiting for device to connect...
adb wait-for-device
adb devices
echo Forwarding tcp port...
adb -s emulator-5554 forward tcp:8080 tcp:8080
echo Unlocking device...
adb shell input keyevent 82
echo Running Selenium...
java -jar c:\selenium\selenium-server-standalone-2.5.0.jar -proxyInjectionMode -trustAllSSLCertificates -htmlSuite "*custom adb -s emulator-5554 shell am start -a android.intent.action.VIEW -d http://localhost:4444/wd/hub/ -n org.openqa.selenium.android.app/org.openqa.selenium.android.app.MainActivity" "http://mywebsite.com" "c:\selenium\tests\mytest.html" "c:\selenium\results\android.html"
rem echo completed....
rem adb kill-server
就被它去,似乎工作,但: IE是早早就锁定了在测试中,将最终给脚本/内存警告,但整个应用程序变得没有反应。
Android SDK确实启动了我的测试AVD,解锁并启动webdriver。但这就是它所做的一切。
所以我主要关心的是如何让Android webdriver开始运行测试。 如果任何人有IE浏览器的想法,这将是很好,但Android是真正的问题。