UITest with WkWebview

Hi I want to perform UITest with WKWebview but getting the following issues:

  1. Not able to fill the text in textfiled.
  2. Not able to tap on buttons. Once tap on the button programmatically, app getting crashed.

Please suggest the best approach.

I am doing like :

if (self.app.textFields.firstMatch.placeholderValue == "Email address" ) {             app.webViews.element(matching: .textField, identifier: "email").typeText("emailID")      } let webViewsQuery = XCUIApplication().webViews.webViews.webViews let logInButton = webViewsQuery.buttons[" Log In"] logInButton.tap()

UITest with WkWebview
 
 
Q