[jira] [Commented] (OFBIZ-6618) Selenium test integration using XML files

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-6618) Selenium test integration using XML files

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-6618?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14965028#comment-14965028 ]

Jacques Le Roux commented on OFBIZ-6618:
----------------------------------------

Mmm, I'm maybe a bit touchy but some communication would have been good here. Why?
# I assigned myself and put the flag WIP on ("Start Progress") on. From our recent exchanges this is the way to say "I'm handling it, please let me know if you want to take over". So Hans, sorry to say, what you did was not polite. Maybe you did not follow recent exchanges and were unaware of this new policy. So just that you knows it now :)
# Yesterday, I tried to follow the installation indication in the README.TWT file. On my (Windows) installation I had an old Ant version installed (1.8). So I had to update because I could not run "ant install" and "..\..\ant install-test" worked but failed later still due to version issue. Not a big deal, better to have Ant 1.9 installed anyway.
# After upgrading Ant, when I ran "ant install-test" I got this error
{code}
C:\projectASF-Mars\ofbiz\hot-deploy\growerptest\build.xml:60: java.io.IOException: Cannot run program "patch" (in directory "C:\projectASF-Mars\ofbiz"): CreateProcess error=740, L'opération demandée nécessite une élévation
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
        at java.lang.Runtime.exec(Runtime.java:620)
        at org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:41)
        at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:434)
        at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:448)
        at org.apache.tools.ant.taskdefs.Patch.execute(Patch.java:200)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:435)
        at org.apache.tools.ant.Target.performTasks(Target.java:456)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
        at org.apache.tools.ant.Main.runBuild(Main.java:851)
        at org.apache.tools.ant.Main.startAnt(Main.java:235)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.io.IOException: CreateProcess error=740, LÆopÚration demandÚe nÚcessite une ÚlÚvation
        at java.lang.ProcessImpl.create(Native Method)
        at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
        at java.lang.ProcessImpl.start(ProcessImpl.java:137)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
        ... 21 more
{code}
Sorry for the (bad Windows translation) French, "L'opération demandée nécessite une élévation" actually means on Windows you need more privileges (should be in right French "L'opération demandée nécessite une élévation des privilèges") I guess you get it.
This is maybe a Windows only issue, but I decided to change a bit the "hot-deploy/growerptest/build.xml" file, see attached build.patch. The idea is to reuse the OOTB main patch target which uses svn if present. Patch is not easy on Windows OOTB.

Then running "ant run-test-suite -Dtest.component=growerptest -Dtest.suiteName=example-tests" I got this error.
{code}
     [java] 2015-10-20 13:52:59,337 |main                 |TestRunContainer              |I| [JUNIT] : webdriverexample2 starting...
     [java] 2015-10-20 13:52:59,341 |main                 |WebDriver                     |D| Starting function: openBrowser
     [java] Oct 20, 2015 1:53:19 PM org.openqa.selenium.os.UnixProcess checkForError
     [java] SEVERE: org.apache.commons.exec.ExecuteException: Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program "C:\projectASF-Mars\ofbiz\hot-deploy\growerptest\lib\c
hromedriver" (in directory "."): CreateProcess error=193, %1 n'est pas une application Win32 valide)
{code}
Did you try your code on Windows?

This said It looks like a promising way, thanks for the contribution!

> Selenium test integration using XML files
> -----------------------------------------
>
>                 Key: OFBIZ-6618
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-6618
>             Project: OFBiz
>          Issue Type: Test
>          Components: framework
>            Reporter: Ruud Griepsma
>            Assignee: Hans Bakker
>            Priority: Minor
>              Labels: selenium, test, webdriver
>             Fix For: Trunk
>
>         Attachments: ModelTestSuite.patch, test-suite.patch
>
>
> Added a new type of test, for testing with Selenium WebDriver, but without writing any Java code. This will help making GUI tests quicker and easier to create. Test steps and instances are defined in XML files, like example below, which tests the login procedure for the admin user.
> {code}
> <testcase>
>   <step function="openBrowser" datavalue="Firefox"/>
>   <step function="navigate" datavalue="https://localhost:8443/example/control/checkLogin/main"/>
>   <step function="writeInput" by="name" webobject="USERNAME" dataname="username"/>
>   <step function="writeInput" by="name" webobject="PASSWORD" dataname="password"/>
>   <step function="click" by="cssSelector" webobject="input[type=&quot;submit&quot;]"/>
>   <step function="checkExists" by="linkText" datavalue="Logout"/>
>   <step function="pause" datavalue="2"/>
>   <step function="closeBrowser"/>
>  
>   <testinstance>
>     <data name="username" value="admin"/>
>     <data name="password" value="ofbiz"/>
>   </testinstance>
> </testcase>
> {code}
> Git repository with example (put in 'hot-deploy' folder and check README.txt file):
> git clone https://gerrit.antwebsystems.com/growerptest



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)