0

Is it possible to debug a Javascript code(of webview) from Xcode/Swift debug. Using version xcode 12.

Similar to chrome inspect debugging in webview.

3
  • You can debug from Safari, the Xcode debugger works differently and I don't see how it can connect to the JS code being run. Commented Jan 24, 2021 at 11:04
  • and links for help, would be great Commented Jan 25, 2021 at 4:01
  • 1
    @shrw check this answer. Commented Jan 25, 2021 at 11:46

1 Answer 1

1

Yes it is possible. Furthermore you can even write a test for it. Suppose that you have a Webview which in textbox written by javascript codes then you need to find location of items with coordinates. Finally you can test it like this;

let textFieldVector = CGVector(dx: 247, dy: 436)
let textFieldCoordinate = app.coordinate(withNormalizedOffset: .zero).withOffset(textFieldVector)
textFieldCoordinate.tap()
app.typeText("your Login username")

Also my medium article can be useful if you proceed test cases for Webviews . Link is here.

Sign up to request clarification or add additional context in comments.

1 Comment

need a debugger like chrome inspect for webview .. don't know how this helps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.