Do not mix implicit and explicit expectations. Part of the problem is that implicit expectations are often (but not always!) Implemented on the "remote" side of the WebDriver system. This means that they are βbakedβ in IEDriverServer.exe, chromedriver.exe, the Firefox WebDriver extension, which is installed in the anonymous Firefox profile and on the remote Java WebDriver server (selenium-server-standalone.jar). Explicit expectations are met exclusively in "local" language bindings. When using RemoteWebDriver, everything is more complicated, since you can use both the local and remote sides of the system several times.
Here's how it works: local code -> remote Java server -> local Java language bindings on the remote server -> "remote", such as the Firefox extension, chromedriver.exe, or IEDriverServer.exe. This is even more complicated with the grid, as there may be other transitions between them.
Thus, when you try to mix implicit and explicit expectations, you deviate into "undefined behavior". You may be able to figure out what the rules for this behavior are, but they can be changed as the details of the driver implementation change. So do not do this.
You should not experience βhangsβ when an item cannot be found unless you use implicit expectations. The driver should immediately throw a NoSuchElement exception.
JimEvans Mar 02 '13 at 13:24 2013-03-02 13:24
source share