Closed govindd06 closed 2 years ago
For your case, you can use native locator strategy directly without any code. Refer documentation for locating element. For example:
my.ele.loc = -android uiautomator=new UiScrollable(new UiSelector().scrollable(true)).scrollToEnd(10)
care.book.appointment.btn=-android uiautomator=new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().textContains("Book an appointment").instance(0))
you can use this locator as usual. For example:
driver.findElement("my.ele.loc")
//or
$("my.ele.loc").isPresent();
For other cases, If you are not using remote driver and you want to use under laying driver object you can use getUnderLayingDriver()
method. For example, when you are using driver.name=appiumDriver
and providing driver class in capability like example here, you can access AppiumDriver as below
AppiumDriver<WebElement> driver = (AppiumDriver<WebElement>)getDriver().getUnderLayingDriver();
Hi cjayswal,
Thanks a lot for your quick support. It is working for me. I have done the following changes.
MobileElement element = (MobileElement) getAppiumDriver().findElement(MobileBy.AndroidUIAutomator( "new UiScrollable(new UiSelector().scrollable(true))" + ".scrollIntoView(new UiSelector().text(\"Your_Text_to_Search\"))")); element.click();
Thanks 👍
QAF Version
Steps To Reproduce
Expected behavior
Using AndroidUIAutomator, it has to scroll/ swipe the till the end of the page
Actual behavior
It is not scrolling till the end of the page instead It is throwing error "The class com.qmetry.qaf.automation.ui.webdriver.QAFExtendedWebDriver of the given context doesn't implement io.appium.java_client.FindsByAndroidUIAutomator nor io.appium.java_client.FindsByFluentSelector"
Is the issue reproducible on runner?
Test case sample
But it is throwing error "The class com.qmetry.qaf.automation.ui.webdriver.QAFExtendedWebDriver of the given context doesn't implement io.appium.java_client.FindsByAndroidUIAutomator nor io.appium.java_client.FindsByFluentSelector"
Ref: http://appium.io/docs/en/writing-running-appium/tutorial/swipe/android-tricks/