kif-framework / KIF

Keep It Functional - An iOS Functional Testing Framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KIF causes exception on using WKWebView

gerchicovy opened this issue · comments

I add empty fullscreen empty WKWebView and try to click it but get exception:
Thread 1: "[<WKWebView 0x7fcdf002f600> valueForUndefinedKey:]: this class is not key value coding-compliant for the key _internal."
Sources:
https://github.com/kif-framework/KIF/blob/master/Sources/KIF/Additions/UIView-KIFAdditions.m

Let check:

BOOL isWebView = [self isKindOfClass:[WKWebView class]]; //YES
...
if ([NSStringFromClass([self class]) isEqual:@"UIWebBrowserView"]) { //NO
} else if (isWebView) { //YES
  id webViewInternal = [self valueForKey:@"_internal"]; //Exception
  ...
}

What is @"_internal" for WKWebView?

This was likely an ivar, but i don't know what it was used for. This was last updated 9 years ago… Might not really be necessary to check for it anymore at all

@dostrander could you please fix it? I don't know concrete steps which cause this problem but it obviously always will crash here on using WKWebView