DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "iOS");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "11.0");
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "Safari");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone 8");
Sunday, February 16, 2020
Appium - iOS Safari Browser Capabilities
Thursday, February 13, 2020
Appium - Android Mobile Chrome Browser Desired Capabilities
public WebDriver mobileChromeDriver() throws MalformedURLException {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("chromedriverExecutable",
"C:\\eclipse-workspace\\AppiumTestCases\\chromedriver.exe");
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, BrowserType.CHROME);
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "my phone");
capabilities.setCapability(MobileCapabilityType.VERSION, "8.0");
URL url = new URL("http://127.0.0.1:4723/wd/hub");
driver = new AndroidDriver(url, capabilities);
return driver;
}
Monday, February 10, 2020
Appium XPaths
Appium X-Paths
Android
Widget with Using class with index
driver.findElement(By.xpath("//android.widget.EditText[1]"));
Widget with Using class, text attribute
driver.findElement(By.xpath("//android.widget.Button[@text='Login']));
Widget with Using class and Resource ID
driver.findElement(By.xpath("//android.widget.Button[@resource-id='com.pkgname.xxx']));
Widget with Using text attribute and with different approaches.
//*[@text="foo"]));
//*[contains(@text, "fo")]
//*[@text='Text1' and ../*[@text='Text2']]
Widget with ID
//*[@id='ABC']
iOS
//UIAApplication[1]/UIAWindow[1]/UIAButton
//XCUIElementTypeStaticText[@name="YourText"]
//XCUIElementTypeButton[@name="YourText"]
Android
Widget with Using class with index
driver.findElement(By.xpath("//android.widget.EditText[1]"));
Widget with Using class, text attribute
driver.findElement(By.xpath("//android.widget.Button[@text='Login']));
Widget with Using class and Resource ID
driver.findElement(By.xpath("//android.widget.Button[@resource-id='com.pkgname.xxx']));
Widget with Using text attribute and with different approaches.
//*[@text="foo"]));
//*[contains(@text, "fo")]
//*[@text='Text1' and ../*[@text='Text2']]
Widget with ID
//*[@id='ABC']
iOS
//UIAApplication[1]/UIAWindow[1]/UIAButton
//XCUIElementTypeStaticText[@name="YourText"]
//XCUIElementTypeButton[@name="YourText"]
Wednesday, February 5, 2020
Android ADB Command - Get current application Package name and Activity name
ADB get package name and activity name in windows machine
Package Name
adb shell "dumpsys activity | grep top-activity"
Activity Name
adb shell "dumpsys activity activities | grep 'Hist #' | grep 'YOUR_PACKAGE_NAME'"
Package Name
adb shell "dumpsys activity | grep top-activity"
Activity Name
adb shell "dumpsys activity activities | grep 'Hist #' | grep 'YOUR_PACKAGE_NAME'"
Subscribe to:
Posts (Atom)