This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ElementProxy implements InvocationHandler { | |
private final WebElement element; | |
public ElementProxy(WebElement element) { | |
this.element = element; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 | |
} |