Hi all,
I’ve been testing Youtube application in my Nexus 4. The application info is as following
package name - com.google.android.youtube
apk name - com.google.android.youtube-2.apk
main activity- com.google.android.youtube.HomeActivity
I have successfully made a search string with appium, but after that I am unable to find any element to get the list of results in the suggestion provider popup. I am using uiautomatorviewer on ubuntu 14 and windows 7 as well
Here is the sample code
public WebDriver setUp() throws MalformedURLException {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
capabilities.setCapability("deviceName", "LG Nexus 4");
capabilities.setCapability("platformVersion", "4.4");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("appPackage", "com.google.android.youtube");
capabilities.setCapability("appActivity", "com.google.android.youtube.HomeActivity");
/*capabilities.setCapability("appPackage", "com.android.calculator2");
capabilities.setCapability("appActivity", "com.android.calculator2.Calculator");*/
WebDriver driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
return driver;
}
public void testYoutube(WebDriver driver) throws Exception
{
WebElement searchButton = driver.findElement(By.id("com.google.android.youtube:id/menu_search"));
searchButton.click();
WebElement searchQueryText = driver.findElement(By.id("android:id/search_src_text"));
searchQueryText.sendKeys("spring framework");
}
/**
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
YoutubeDriver appDriver = new YoutubeDriver();
WebDriver driver = appDriver.setUp();
appDriver.testYoutube(driver);
}
Here is the screen shot taken from uiautomatorviewer
Now how can I access the elements in the suggestion provider box ?
Thanks