Created
June 21, 2014 12:00
-
-
Save prashanth-sams/3883b17e5176944d63fd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pack; | |
import org.openqa.selenium.By; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.remote.CapabilityType; | |
import org.openqa.selenium.remote.DesiredCapabilities; | |
import org.openqa.selenium.remote.RemoteWebDriver; | |
import org.testng.annotations.AfterMethod; | |
import org.testng.annotations.BeforeMethod; | |
import org.testng.annotations.Test; | |
import java.net.URL; | |
import java.util.concurrent.TimeUnit; | |
public class Android_on_Sauce { | |
public WebDriver driver = null; | |
@BeforeMethod | |
public void setUp() throws Exception{ | |
DesiredCapabilities capabilities = new DesiredCapabilities(); | |
capabilities.setCapability(CapabilityType.BROWSER_NAME, ""); | |
capabilities.setCapability(CapabilityType.PLATFORM, "Mac"); | |
capabilities.setCapability("app", "sauce-storage:EriBank.apk"); | |
capabilities.setCapability("platformVersion", "4.2"); | |
capabilities.setCapability("deviceType", "phone"); | |
capabilities.setCapability("deviceName", "Android Emulator"); | |
capabilities.setCapability("appPackage", "com.experitest.ExperiBank"); | |
capabilities.setCapability("appActivity", "com.experitest.ExperiBank.LoginActivity"); | |
capabilities.setCapability("platformName", "Android"); | |
capabilities.setCapability("appium-version", "1.0"); | |
driver = new RemoteWebDriver(new URL("http://kimr01:[email protected]/wd/hub"), capabilities); | |
} | |
@AfterMethod | |
public void tearDown() throws Exception { | |
driver.quit(); | |
} | |
@Test | |
public void test01() throws InterruptedException { | |
driver.findElement(By.xpath("//android.widget.EditText[1]")).sendKeys("prashanth.sams"); | |
driver.findElement(By.xpath("//android.widget.EditText[2]")).sendKeys("password"); | |
driver.findElement(By.xpath("//android.widget.Button[1]")).click(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment