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.

zeytin
  • 5,545
  • 4
  • 14
  • 38
shrw
  • 1,719
  • 5
  • 27
  • 50

1 Answers1

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.

zeytin
  • 5,545
  • 4
  • 14
  • 38