Closed vaadin-bot closed 12 years ago
Originally by mgrankvi
Changes in times would seem to be negligible even if Augmenter is run for all RemoteWebDriver instances.
For both solutions tried so far (adding the augmentation in
TestBench {
public static WebDriver createDriver(WebDriver driver) {
if(driver instanceof RemoteWebDriver) {
driver = new Augmenter().augment((RemoteWebDriver) driver);
}
...
}
...
}
OR
TestBenchCommandExecutor {
public TestBenchCommandExecutor(WebDriver actualDriver,
ImageComparison imageComparison,
ReferenceNameGenerator referenceNameGenerator) {
if (actualDriver instanceof RemoteWebDriver) {
this.actualDriver = new Augmenter().augment(actualDriver);
} else {
this.actualDriver = actualDriver;
}
...
}
}
The diver will begin opening multiple browser instances and loose the pointer to one of the first windows leaving it open after closing down the rest. This opening takes some time and will also fill the machine up with open instances when lots of tests are executed.
Augmenting in setDriver() did not work.
Originally by mgrankvi
Median times for running tests with (manual add to tests) and without augmentation of RemoteWebDriver
-Augmentation only on ScreenchotITCase ::*
com.vaadin.testbenchexample.AdvancedCommandsITCase :: 6.607 sec com.vaadin.testbenchexample.LoopingCalculatorITCase :: 3.672 sec com.vaadin.testbenchexample.ScreenshotITCase :: 6.491 sec com.vaadin.testbenchexample.SelectorExamplesITCase :: 4.285 sec com.vaadin.testbenchexample.SimpleCalculatorITCase :: 2.117 sec com.vaadin.testbenchexample.UsingHubITCase :: 0.002 sec com.vaadin.testbenchexample.VerifyExecutionTimeITCase :: 2.214 sec
-total* :: 31.057 sec
-Augmentation on all tests ::*
com.vaadin.testbenchexample.AdvancedCommandsITCase :: 6.754 sec com.vaadin.testbenchexample.LoopingCalculatorITCase :: 3.519 sec com.vaadin.testbenchexample.ScreenshotITCase :: 6.268 sec com.vaadin.testbenchexample.SelectorExamplesITCase :: 4.296 sec com.vaadin.testbenchexample.SimpleCalculatorITCase :: 2.109 sec com.vaadin.testbenchexample.UsingHubITCase :: 0.000333... sec com.vaadin.testbenchexample.VerifyExecutionTimeITCase :: 2.199 sec
-total* :: 31.002 sec
Originally by mgrankvi
Got automatic augmentation in createDriver to work as normal without leaving extra browser instances. Ran tests for comparable median times for the automatic augmentation.
-Automatic Augmentation on all tests ::*
com.vaadin.testbenchexample.AdvancedCommandsITCase :: 6.781 sec com.vaadin.testbenchexample.LoopingCalculatorITCase :: 3.630 sec com.vaadin.testbenchexample.ScreenshotITCase :: 6.482 sec com.vaadin.testbenchexample.SelectorExamplesITCase :: 4.526 sec com.vaadin.testbenchexample.SimpleCalculatorITCase :: 2.152 sec com.vaadin.testbenchexample.UsingHubITCase :: 0.001 sec com.vaadin.testbenchexample.VerifyExecutionTimeITCase :: 2.277 sec
total :: 31.497 sec
Originally by @zch
Introduced a small tweak to Mikael's patch: only augment if the driver does not implement TakesScreenshot. This takes care of windows that are left open in some cases.
Originally by @zch
When running tests on a remote machine, you need to augment the
RemoteWebDriver
instance in order to be able to e.g. grab screen shots.Augmenting an instance of
WebDriver
is done as follows:Test whether always augmenting
RemoteWebDriver
s is an acceptable performance hit or not. If always augmenting is no big deal, modify theTestBenchTestCase.setDriver()
to always augmentRemoteWebDriver
instances.Update the manual (and javadoc) according to the findings.