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
<dependency> | |
<groupId>org.apache.logging.log4j</groupId> | |
<artifactId>log4j-api</artifactId> | |
<version>2.3</version> | |
</dependency> | |
<dependency> | |
<groupId>org.apache.logging.log4j</groupId> | |
<artifactId>log4j-core</artifactId> | |
<version>2.3</version> | |
</dependency> |
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
protected WebDriver createDriver(Logger myLogger) throws AWTException, InterruptedException { | |
// the following 2 lines will dismiss the Windows crash alert dialog | |
AlertThread tAlertThread = new AlertThread("tAlertThread"); | |
tAlertThread.start(); | |
WebDriver localDriver = new FirefoxDriver(); // using this to see if bug goes away | |
localDriver.manage().timeouts().implicitlyWait(WAIT_TIME, TimeUnit.SECONDS); //for the entire test run | |
return localDriver; | |
} |
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
class AlertThread extends Thread { // Dismiss the Firefox crash alert | |
public AlertThread (String tname) { | |
super(tname); | |
} | |
@Override | |
public void run(){ | |
System.out.println("Inside run() of AlertThread method."); | |
try { | |
Thread.currentThread(); |
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
import com.sun.jna.platform.win32.User32; | |
import com.sun.jna.platform.win32.WinDef.HWND; | |
import com.sun.jna.platform.win32.WinUser; | |
....... | |
protected static void dismissFirefoxCrashAlert() { | |
bLogger.info("Inside dismissFirefoxCrashAlert"); | |
HWND hwnd = User32.INSTANCE.FindWindow (null, "Firefox"); // window title | |
if (hwnd == null) { |
NewerOlder