Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I run an AndroidDriver test with Junit?
    primarykey
    data
    text
    <p>I've been following the instructions at:</p> <p><a href="http://code.google.com/p/selenium/wiki/AndroidDriver" rel="nofollow">http://code.google.com/p/selenium/wiki/AndroidDriver</a></p> <p>And I've managed to get the following working so far:</p> <ul> <li>Installed Android SDK</li> <li>Updated it</li> <li>Made and ran an AVD image</li> <li>Installed Eclipse and ADT plugin but haven't learnt Eclipse yet. (I'm trying to compile things from the command line only.)</li> <li>Ran the emulation on the Android emulator</li> <li>Install WebDriver APK on Emulation using adb -s -e install -r </li> <li>Set up portforwarding for the above</li> <li>Webdriver started is displayed on the emulator</li> <li>Downloaded selenium-java-x.jar</li> <li>Downloaded junit-x.jar</li> <li>Determined classpath for compiling the code</li> <li><p>Compiled using javac, I don't know if this is right:</p> <p>javac -classpath c:_projects\junit\junit-4.10.jar;c:_projects\selenium-java\selenium-java-2.17.0.jar OneTest.java</p></li> </ul> <p>Here is my test:</p> <pre><code>import junit.framework.TestCase; import org.openqa.selenium.WebDriver; //VERY IMPORTANT. This line is not in the example on the Selenium AndroidDriver website. import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.android.AndroidDriver; public class OneTest extends TestCase { public void testGoogle() throws Exception { WebDriver driver = new AndroidDriver(); // And now use this to visit Google driver.get("http://www.google.com"); // Find the text input element by its name WebElement element = driver.findElement(By.name("q")); // Enter something to search for element.sendKeys("Cheese!"); // Now submit the form. WebDriver will find the form for us from the element element.submit(); // Check the title of the page System.out.println("Page title is: " + driver.getTitle()); driver.quit(); } } </code></pre> <p>Now I'm stuck on this section: <a href="http://code.google.com/p/selenium/wiki/AndroidDriver#Build_the_Android_Code" rel="nofollow">http://code.google.com/p/selenium/wiki/AndroidDriver#Build_the_Android_Code</a></p> <p>Where do I run these commands? For example $./go android_client etc. I think I just need to know how to compile properly and how to forward this test to the emulator. But I could be totally on the wrong track.</p> <p>My versions are:</p> <ul> <li>Eclipse: 3.7.1</li> <li>Selenium server: 2.17.0</li> <li>AndroidDriver: 2.16.0</li> <li>Android SDK Tools Revision 16</li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload