Skip to content

Instantly share code, notes, and snippets.

@virenv
virenv / gist:6a24b4fb882e47540d148c4581e6e5ea
Created July 28, 2018 08:51
A small change to apply retry when a pop up appears
public class ElementProxy implements InvocationHandler {
private final WebElement element;
public ElementProxy(WebElement element) {
this.element = element;
}
// Bad example of static variable, In this case the
// driver instance can be accessed by multiple threads and
// potentially can be changed by multiple threads.
// This results into an unexpected behaviour at runtime when
// this code runs in parallel
class WebDriverContainer
{
public static WebDriver driver; // No thread safety
}