diff --git c/index.js w/index.js
index 09a3b77..74e8833 100644
--- c/index.js
+++ w/index.js
@@ -142,6 +142,53 @@ var SeleniumGridInstance = function (name, baseBrowserDecorator, args, logger) {
 
   self.name = name;
 
+  const heartbeatFunction = () => {
+    log.debug('hearbeat for ' + self.name);
+    self.browser.getTitle()
+      .catch((err) => {
+        heartbeatErrors++;
+        log.error('Caught error for browser ' + self.name + ' during ' +
+          'heartbeat: ' + err);
+        if (heartbeatErrors >= 5) {
+          log.error('Too many heartbeat errors, attempting to stop ' + self.name);
+          args.heartbeatInterval && clearInterval(heartbeat);
+          self.browser.quit()
+            .then(() => {
+              log.info('Killed ' + self.name + '.');
+              self._done();
+              self._onProcessExit(self.error ? -1 : 0, self.error);
+            })
+            .catch(() => {
+              log.info('Error stopping browser ' + self.name);
+              self._done();
+              self._onProcessExit(self.error ? -1 : 0, self.error);
+            });
+        }
+      });
+  };
+
+  const promptFunction = (elId) => {
+    return new Promise((resolve, reject) => {
+      var windowRef = self.browser.getWindowHandle();
+      self.browser.switchTo().frame(0);
+      var query = self.browser.wait(until.elementLocated(wd.By.id(elId)))
+        .then(() => {
+          log.debug('Trying to focus ' + self.name + ' with an alert...');
+          self.browser.switchTo().frame(null);
+          self.browser.switchTo().window(windowRef).then(() => {
+            self.browser.executeScript("alert('test')").then(() => {
+              self.browser.switchTo().alert().then((alert) => {
+                alert.dismiss();
+                self.browser.switchTo().window(windowRef);
+                resolve();
+              });
+            })
+          });
+        })
+        .catch(() => reject('caught'));
+    });
+  };
+
   // This is done by passing the option on the url, in response the Karma server will
   // set the following meta in the page.
   //   <meta http-equiv="X-UA-Compatible" content="[VALUE]"/>
@@ -162,87 +209,69 @@ var SeleniumGridInstance = function (name, baseBrowserDecorator, args, logger) {
     log.debug('Grid URL: ' + gridUrl);
     log.debug('Browser capabilities: ' + JSON.stringify(capabilities));
 
     self.browser = new wd.Builder()
       .setChromeOptions(options[wd.Browser.CHROME])
       .setEdgeOptions(options[wd.Browser.EDGE])
       .setFirefoxOptions(options[wd.Browser.FIREFOX])
       .setIeOptions(options[wd.Browser.IE])
       .setSafariOptions(options[wd.Browser.SAFARI])
       .usingServer(gridUrl)
       .withCapabilities(capabilities)
       .build();
-    var heartbeatErrors = 0;
-    var heartbeat = args.heartbeatInterval && setInterval(function() {
-      log.debug('hearbeat for ' + self.name);
-      self.browser.getTitle()
-        .catch((err) => {
-          heartbeatErrors++;
-          log.error('Caught error for browser ' + self.name + ' during ' +
-            'heartbeat: ' + err);
-          if (heartbeatErrors >= 5) {
-            log.error('Too many heartbeat errors, attempting to stop ' + self.name);
-            args.heartbeatInterval && clearInterval(heartbeat);
-            self.browser.quit()
-              .then(() => {
-                log.info('Killed ' + self.name + '.');
-                self._done();
-                self._onProcessExit(self.error ? -1 : 0, self.error);
-              })
-              .catch(() => {
-                log.info('Error stopping browser ' + self.name);
-                self._done();
-                self._onProcessExit(self.error ? -1 : 0, self.error);
-              });
-          }
-        });
-    }, args.heartbeatInterval);
 
-    self.browser
-        .get(url)
-        .then(() => {
-          log.debug(self.name + ' started');
-          if (args.browserName !== 'safari') {
-            var windowRef = self.browser.getWindowHandle();
-            self.browser.switchTo().frame(0);
-            var query = self.browser.wait(until.elementLocated(wd.By.id('player')))
-              .then(() => {
-                log.debug('Trying to focus ' + self.name + ' with an alert...');
-                self.browser.switchTo().frame(null);
-                self.browser.switchTo().window(windowRef).then(() => {
-                  self.browser.executeScript("alert('test')").then(() => {
-                    self.browser.switchTo().alert().then((alert) => {
-                      alert.dismiss();
-                      self.browser.switchTo().window(windowRef);
-                    });
-                  });
-                });
-              })
-              .catch(() => log.error('caught'));
-          }
-        })
-        .catch((err) => {
-          log.error(self.name + ' was unable to start: ' + err);
-          self._done('failure');
-          self._onProcessExit(self.error ? -1 : 0, self.error);
-        });
+      var heartbeatErrors = 0;
+      var heartbeat;
 
-    self._process = {
-      kill: function() {
-        heartbeat && clearInterval(heartbeat);
-        self.browser.quit()
+    self.browser
+        .get(url)
           .then(() => {
-            log.info('Killed ' + self.name + '.');
-            self._done();
-            self._onProcessExit(self.error ? -1 : 0, self.error);
+            log.debug(self.name + ' started');
+            let promise = Promise.resolve();
+            if (args.windowGeometry) {
+              promise = promise.then(() => self.browser.manage().window().setRect(args.windowGeometry));
+            }
+            if (args.promptOn) {
+              promise = promise.then(() => promptFunction(args.promptOn));
+            }
+            if (args.heartbeatInterval) {
+              promise = promise.then(() => {
+                heartbeat = setInterval(heartbeatFunction, args.heartbeatInterval);
+                return Promise.resolve();
+              });
+            }
+            promise = promise.catch(err => log.error(args.browserName + ' caught err ' + err.toString()));
+            return promise;
           })
-          .catch(() => {
-            log.info('Error stopping browser ' + self.name);
-            self._done();
+          .catch((err) => {
+            log.error(self.name + ' was unable to start: ' + err);
+            self._done('failure');
             self._onProcessExit(self.error ? -1 : 0, self.error);
           });
-      }
-    };
+
+      self._process = {
+        kill: function() {
+          heartbeat && clearInterval(heartbeat);
+          self.browser.quit()
+            .then(() => {
+              log.info('Killed ' + self.name + '.');
+              self._done();
+              self._onProcessExit(self.error ? -1 : 0, self.error);
+            })
+            .catch(() => {
+              log.info('Error stopping browser ' + self.name);
+              self._done();
+              self._onProcessExit(self.error ? -1 : 0, self.error);
+            });
+        }
+      };
+    }, delayTime);
   };
 
   // We can't really force browser to quit so just avoid warning about SIGKILL
