How to press Go key on iOS keyboard?

I m trying to press the Go key on the iOS keyboard. I tried the below code but didn’t work


I m not sure whether this is the right one . Can anyone please help?

Appium Java client version 8.0.0
Appium version 1.21.0-1

your code works for Android but not for iOS. with iOS I use just tap last keyboard key whatever it is “Go”, “Next”, “Done”…

// java

WebElement keyboardLastKey = driver.findElement(AppiumBy.iOSNsPredicateString("**/XCUIElementTypeKeyboard[1]/**/XCUIElementTypeButton[-1]"));
// now tap on it whatever way you use in your code
1 Like

this worked similar to yours but it only clicks Go

driver.findElement(AppiumBy.iOSNsPredicateString(“label == “go””)).click();

Btw how did you get this? “/XCUIElementTypeKeyboard[1]//XCUIElementTypeButton[-1]”

what you mean? iOS keyboard visible in page source. while Android keyboard not available.

I couldnt find iOSNsPredicateString("/XCUIElementTypeKeyboard[1]//XCUIElementTypeButton[-1]") on inspecting from Appium inspector. Is there a way to build iOSNsPredicateString ,like xpath?

I do not use Appium inspector.
more to read: