Selenium-Foundation
Selenium-Foundation copied to clipboard
ContainerMethodInterceptor.loadIsComplete() performs an unchecked cast to DetectsLoadCompletion
The loadIsComplete() 'wait' proxy method an unchecked cast from SearchContext to DetectsLoadCompletion. This presents the very real risk of triggering a ClassCastException by being invoked within a context that doesn't implement this interface. To resolve this, the implementation of the 'wait' proxy apply() method should ensure that the supplied context is instanceof DetectsLoadCompletion, If it's not, log a warning and return true to abort the load completion check gracefully.