Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fluentlenium requires some config #230

Closed
Riduidel opened this issue Jun 17, 2014 · 9 comments
Closed

Fluentlenium requires some config #230

Riduidel opened this issue Jun 17, 2014 · 9 comments
Milestone

Comments

@Riduidel
Copy link
Contributor

It seems a valid firefox is required on path ...
I guess a maven enforcer rule could do the job ...

testFluentlenium(ui.NavigationIT)  Time elapsed: 0.63 sec  <<< ERROR!
org.openqa.selenium.WebDriverException: Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: VISTA
Build info: version: '2.41.0', revision: '3192d8a6c4449dc285928ba024779344f5423c58', time: '2014-03-27 11:29:39'
System info: host: 'ndx-PC-W7', ip: '172.27.63.110', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0'
Driver info: driver.version: FirefoxDriver
    at org.openqa.selenium.firefox.internal.Executable.<init>(Executable.java:72)
    at org.openqa.selenium.firefox.FirefoxBinary.<init>(FirefoxBinary.java:59)
    at org.openqa.selenium.firefox.FirefoxBinary.<init>(FirefoxBinary.java:55)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:95)
    at org.fluentlenium.adapter.FluentTest.getDefaultDriver(FluentTest.java:137)
    at org.fluentlenium.adapter.FluentTest.initFluentFromDefaultDriver(FluentTest.java:123)
    at org.fluentlenium.adapter.FluentTest.access$100(FluentTest.java:35)
    at org.fluentlenium.adapter.FluentTest$1.starting(FluentTest.java:74)
    at org.junit.rules.TestWatcher.startingQuietly(TestWatcher.java:102)
    at org.junit.rules.TestWatcher.access$000(TestWatcher.java:46)
    at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:53)
    at org.junit.rules.RunRules.evaluate(RunRules.java:20)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

testFluentlenium(ui.NavigationIT)  Time elapsed: 0.63 sec  <<< ERROR!
java.lang.NullPointerException: null
    at org.fluentlenium.core.Fluent.goTo(Fluent.java:336)
    at org.wisdom.test.parents.WisdomFluentLeniumTest.goTo(WisdomFluentLeniumTest.java:91)
    at ui.NavigationIT.testFluentlenium(NavigationIT.java:32)

�[34m[INFO]  o.ow2.chameleon�[0;39m �[36m{main}�[0;39m - Stopping Chameleon 
17/06/14 11:39:33 (A) LoggerService.log : [WARNING]  : [org.wisdom.template.thymeleaf.tracker.TemplateDeployer-0] The dependency is not optional, however no service object can be injected in watcher -> org.ow2.chameleon.core.services.Watcher
�[34m[INFO]  o.w.r.RequestRouter�[0;39m �[36m{FelixStartLevel}�[0;39m - Removing routes from cache.CachedController@45a0ca8e 
�[34m[INFO]  o.w.r.RequestRouter�[0;39m �[36m{FelixStartLevel}�[0;39m - Removing routes from content.JsonController@d91a224 
�[34m[INFO]  o.w.r.RequestRouter�[0;39m �[36m{FelixStartLevel}�[0;39m - Removing routes from content.JsonPController@44b0d5f5 
�[34m[INFO]  o.w.r.RequestRouter�[0;39m �[36m{FelixStartLevel}�[0;39m - Removing routes from content.PersonController@28f76cfd 
�[34m[INFO]  o.w.r.RequestRouter�[0;39m �[36m{FelixStartLevel}�[0;39m - Removing routes from content.XMLController@5e697844 
�[34m[INFO]  o.w.r.RequestRouter�[0;39m �[36m{FelixStartLevel}�[0;39m - Removing routes from controllers.HelloController@3619a943 
�[34m[INFO]  o.w.r.RequestRouter�[0;39m �[36m{FelixStartLevel}�[0;39m - Removing routes from controllers.HttpParameterController@5b05510f 
�[34m[INFO]  o.w.r.RequestRouter�[0;39m �[36m{FelixStartLevel}�[0;39m - Removing routes from controllers.ParameterController@5791fc25 
�[34m[INFO]  o.w.r.RequestRouter�[0;39m �[36m{FelixStartLevel}�[0;39m - Removing routes from controllers.ResultController@26b804e6 
�[34m[INFO]  o.w.r.RequestRouter�[0;39m �[36m{FelixStartLevel}�[0;39m - Removing routes from controllers.UrlCodingController@79f5ce7b 
�[34m[INFO]  o.w.r.RequestRouter�[0;39m �[36m{FelixStartLevel}�[0;39m - Removing routes from controllers.ValidationController@6ca1e389 
�[34m[INFO]  o.w.r.RequestRouter�[0;39m �[36m{FelixStartLevel}�[0;39m - Removing routes from controllers.template.TemplateController@44519cd8 
�[34m[INFO]  o.w.r.RequestRouter�[0;39m �[36m{FelixStartLevel}�[0;39m - Removing routes from cookies.FlashController@512772cd 
�[34m[INFO]  o.w.r.RequestRouter�[0;39m �[36m{FelixStartLevel}�[0;39m - Removing routes from cookies.SessionController@47e9ff99 
�[34m[INFO]  o.w.t.t.t.TemplateTracker�[0;39m �[36m{FelixStartLevel}�[0;39m - Thymeleaf template deleted for bundle://53.0:0/templates/fragments.thl.html from org.wisdom.framework.integration.tests 
�[34m[INFO]  o.w.t.t.t.TemplateTracker�[0;39m �[36m{FelixStartLevel}�[0;39m - Thymeleaf template deleted for bundle://53.0:0/templates/htmlEscaping.thl.html from org.wisdom.framework.integration.tests 
�[34m[INFO]  o.w.t.t.t.TemplateTracker�[0;39m �[36m{FelixStartLevel}�[0;39m - Thymeleaf template deleted for bundle://53.0:0/templates/routing/reverse.thl.html from org.wisdom.framework.integration.tests 
17/06/14 11:39:36 (A) LoggerService.log : [WARNING]  : [WebSocketRouter] The dependency is not optional, however no service object can be injected in dispatcher -> org.wisdom.api.http.websockets.WebSocketDispatcher
�[34m[INFO]  o.ow2.chameleon�[0;39m �[36m{main}�[0;39m - Chameleon stopped 

Results :

Tests in error: 
  NavigationIT>FluentTest.access$100:35->FluentTest.initFluentFromDefaultDriver:123->FluentTest.getDefaultDriver:137 » WebDriver
  NavigationIT.testFluentlenium:32->WisdomFluentLeniumTest.goTo:91->Fluent.goTo:336 » NullPointer

Tests run: 64, Failures: 0, Errors: 2, Skipped: 0
@cescoffier
Copy link
Member

There are two things.

First we should be able to specify the 'browser' we want to use. This should be done using -Dfluentlenium.browser=chrome|safari|firefox|ie. Notice that chrome and internet explorer requires additional software (chrome driver and IEDriver). If not specified, we used the HTMLUnitDriver relying on Firefox.

Then, in the case of the main Wisdom build, just writing in the documentation that Firefox must be in the path.

@Riduidel
Copy link
Contributor Author

well, for those cases, i tend to write enforcer rules which message do not leave any confusion to mind ... As an example, to make sure Visual C++ is declared as a variable, I have the following rule

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <!-- Notice parent poms adds an execution for JNI header generation,
                hence the system.separator that gets redefined here -->
            <executions>
                <execution>
                    <id>enforce visual studio path property</id>
                    <goals>
                        <goal>enforce</goal>
                    </goals>
                    <configuration>
                        <rules>
                            <requireProperty>
                                <property>visual.studio.path</property>
                                <message>
                                    <![CDATA[
Your settings.xml does not declare the visual.studio.path property. Pleasse add to your <profiles>...</profiles> the following XML :


<profile>
    <id>visual.studio.developer</id>
    <activation>
        <activeByDefault>true</activeByDefault>
    </activation>
    <properties>
        <!-- Location to replace with your computer's Visual Studio location -->
        <visual.studio.path>C:\Program Files (x86)\Microsoft Visual Studio 9.0</visual.studio.path>
    </properties>
</profile>
                                    ]]>
                                </message>
                            </requireProperty>
                        </rules>
                    </configuration>
                </execution>

Could it be possible to have a comparable enforcer rule which would check that firefox.exe is on path and, if not, fail the build with the clearest message ?

@cescoffier
Copy link
Member

Is there a way to check if a program is in path without writing your own rule ? (we can still write one, that's not the issue, just don't want to reinvent the wheel).

@Riduidel
Copy link
Contributor Author

On 17/06/2014 14:18, Clement Escoffier wrote:

Is there a way to check if a program is in path without writing your own
rule ? (we can still write one, that's not the issue, just don't want to
reinvent the wheel).

Unfortunatly doesn't seems so : the nearest i've found in available
rules
is
"requireEnvironmentVariable" which only requires existence of an
environment variable, and not is content. And it doesn't seems like
requiresFilesExist
scans the path.

In fact, the best way would be to use a beanshell rule ...

Nicolas Delsaux

@cescoffier
Copy link
Member

Can you try to add https://gist.github.com/cescoffier/48b3a48ab1a14c196289 to your pom file ?

@Riduidel
Copy link
Contributor Author

On 17/06/2014 15:41, Clement Escoffier wrote:

Can you try to add
https://gist.github.com/cescoffier/48b3a48ab1a14c196289 to you pom file ?

OK, firefox is correctly detected as missing.
Is it possible to add in that error message a link to a web page
explaining how (and why) it should be in path ?

Nicolas Delsaux

@cescoffier
Copy link
Member

Yes it is planned, was just a first attempt (My beanshell skills are let’s say… inexistent). 

On 17 juin 2014 at 16:14:30, Nicolas Delsaux (notifications@github.com) wrote:

On 17/06/2014 15:41, Clement Escoffier wrote:

Can you try to add
https://gist.github.com/cescoffier/48b3a48ab1a14c196289 to you pom file ?

OK, firefox is correctly detected as missing.
Is it possible to add in that error message a link to a web page
explaining how (and why) it should be in path ?

Nicolas Delsaux

Reply to this email directly or view it on GitHub.

@Riduidel
Copy link
Contributor Author

On 17/06/2014 16:15, Clement Escoffier wrote:

Yes it is planned, was just a first attempt (My beanshell skills are
let’s say… inexistent).

Yeah it's a pity enforcer plugin doesn't support groovy :-)

Nicolas Delsaux

@cescoffier cescoffier added this to the 0.6 milestone Jun 17, 2014
cescoffier added a commit that referenced this issue Jun 17, 2014
Code approved by Mathilde !

Signed-off-by: Clement Escoffier <clement.escoffier@gmail.com>
Riduidel pushed a commit to Riduidel/wisdom that referenced this issue Jun 18, 2014
…efox.exe in my PATH (instead of %FIREFOX_HOME%), the enforcer rule is not satisfied and the build fail - without any output, but this is another issue.
@Riduidel
Copy link
Contributor Author

Seems like it do not work if I put specifically the firefox.exe on my path. I have a pull request ready for that.

cescoffier added a commit that referenced this issue Jun 18, 2014
Fixes a subpart of #230 : if I put %FIREFOX_HOME%\firefox.exe in my PATH...
cescoffier added a commit that referenced this issue Jun 19, 2014
Signed-off-by: Clement Escoffier <clement.escoffier@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants