Webview help please

I’m having problems closing a webview in iOS,
so i’ve tried running page from arc pry (returns nill) and also tried using the inspector to tap/swipe/precise tap the ‘close’ and the ‘continue’ link - the xpath the inspector provides is
xpath: //UIAApplication[1]/UIAWindow[3]/UIAScrollView[1]/UIAWebView[1]/UIALink[1]/UIAStaticText[1]

name: Continue
type: UIAStaticText
value:
label: Continue
enabled: true
visible: false
valid: true
location: {130, 524}
size: {61, 16}
xpath: //UIAApplication[1]/UIAWindow[3]/UIAScrollView[1]/UIAWebView[1]/UIALink[1]/UIAStaticText[1]

so i’ve tried copying that xpath into the code with a.click
i’ve also tried find_element(:name, “Continue”).click

and i just get the error info: [debug] Got result from instruments: {“status”:13,“value”:“elementId 23 could not be tapped”}
info: [debug] Responding to client with error: {“status”:13,“value”:{“message”:“An unknown server-side error occurred while processing the command.”,“origValue”:“elementId 23 could not be tapped”},“sessionId”:“d8c33628-0f5d-46e9-ae9b-5d44ac870d16”}
info: <-- POST /wd/hub/session/d8c33628-0f5d-46e9-ae9b-5d44ac870d16/element/23/click 500 307.476 ms - 201

info: [debug] [INST] 2014-12-04 15:21:28 +0000 Error: VerboseError: elementId 23 could not be tapped

Very grateful if anyone can shed some light!

Bump - anyone? still getting nowhere with this!

I came upon this on stack overflow, but still not working.

"For webview you cannot access your element which you find through appium inspector. Instead get the page source access the element as shown below

findElement(By.xpath("//input[@name=‘firstName’]"))"

  1. Ensure that you use AppiumDriver instead of RemoteWebDriver;
  2. Switch into WebView (use driver.context(“Name_of_context”) command))
  3. Get page source or use Safari inspector. Then you should write correct selector using xpath or css (I prefer the last one).
    It should work.

Good luck!

  1. Ensure that you use AppiumDriver instead of RemoteWebDriver; - I call the appium driver at the start
    like this:
    Appium::Driver.new(caps: capabilities).start_driver
    Appium.promote_appium_methods Object
  2. Switch into WebView (use driver.context(“Name_of_context”) command))
    to switch into webview i have:
    driver.context(“WEBVIEW_1”)
  3. Then you should write correct selector using xpath or css - for this I have
    findElement(By.cssSelector("//input[.class=‘btn-close’]")).click

but the above doesn’t work - i’m just aiming to click the close button to close the webview. Very grateful if anyone can correct the above.