Problem overriding getDefaultDriver()

205 views
Skip to first unread message

johan.r...@gmail.com

unread,
Dec 3, 2013, 3:23:23 AM12/3/13
to fluent...@googlegroups.com
Hi,

I'm having a n00b problem overriding getDefaultDriver(), hoping someone could help me.

In my test project I have two important classes:
- FluentTestBase extends org.fluentlenium.adapter.FluentTest
- AbstractPage extends org.fluentlenium.core.FluentPage

The idea is to let every test extend FluentTestBase (to get common behaviour like properties like @SharedDriver, driver settings etc.), while every page object extends AbstractPage to get common page objects (like site navigation, site URL etc.)

Now I want to be able to control which driver is used, which by the documentation https://github.com/FluentLenium/FluentLenium#driver is achieved by overriding getDefaultDriver() in the test. Hence I did this in my base test class, FluentTestBase (I've taken away details for clarity):

public class FluentTestBase extends FluentTest {
...
@Override
public final WebDriver getDefaultDriver() {
return new ChromeDriver();
}
...
}

The strange thing is that when my test boots up I FIRST get a empty Firefox window after which a Chrome window appears. The tests are all run in Chrome, which then closes. The Firefox window is still open and the test execution never finishes until I close the Firefox window manually.

Can anyone please point me in the direction of a solution to this problem?

Regards,
Johan Rydström

Johan Rydström

unread,
Dec 12, 2013, 6:25:33 AM12/12/13
to fluent...@googlegroups.com
And I found the reason, nothing related to FluentLenium. I was using an enumerator for the different Drivers which always instantiated a new driver, like so:
public enum Driver {
chrome(new ChromeDriver), firefox(new FirefoxDriver), ...
}

Problem solved by not instantiating in the enum "constructor".

Regards,
Johan Rydström

Mathilde Rigabert Lemée

unread,
Dec 12, 2013, 9:14:26 AM12/12/13
to Johan Rydström, fluent...@googlegroups.com
Good news :)

Regards.
Mathilde Lemée


2013/12/12 Johan Rydström <johan.r...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "FluentLenium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fluentlenium...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages