Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

        Miscellaneous

Eclipse

...

  • You need JavaService.exeThis is freely available at http://javaservice.objectweb.org/.
    Documentation and example code are also available
    Unzip the JavaService-bin-1.2.x.zip (or JavaService-2.0.x.zip)
  • Where should the expanded files be located?
    Set up and run your script with the appropriate path. Ex:
    Code Block
    javaservice -install OFBiz %java_home%\jre\bin\server\jvm.dll -Xms256M -Xmx512M
    -Djava.class.path=%java_home%\lib\tools.jar;%ofbiz_home%\ofbiz.jar
    -start org.ofbiz.base.start.Start
    -out %ofbiz_home%\logs\serviceLog.txt
    -err %ofbiz_home%\logs\serviceErr.txt
    -current %ofbiz_home%
    -manual
    

Note: If your java sdk is installed under a directory with a space in it, the service will install, but not start properly, unless you change java_home to the DOS 8.3 name. For example, if your java sdk is installed in C:\Program Files\Java\j2sdk1.4.2_xx then you would set java_home=C:\PROGRA~1\Java\j2sdk1.4.2_xx* Go to the win2k services app and you should now find a service 'OFBiz' set up to run manually (this of course can be changed to run automatically if so desired).

  • Alternatively, the service can be started with the command:net start OFBiz
  • And the service can then be stopped with the command:net stop OFBiz

...

Anchor
SomeSeleniumTips
SomeSeleniumTips

...

Due to some license issues with external libraries used in Selenium we cannot include this in the Apache trunk. However, a new component has been created which is free to download and use, but lives in an ofbizext repository.
https://svn.hotwaxmedia.com/svn/ofbizext/selenium Drop this in hot-deploy. If you want to know more, please look at https://issues.apache.org/jira/browse/OFBIZ-680

1) For running "successive" test cases I used browser "Refresh" button but I think there might be some better option to handle this. Is there any option exists in Selenium IDE ?
If you want to chain execution of different tests, there is the notion of test suite. A list of tests to run one after the other (see http://labs.libre-entreprise.org/plugins/scmcvs/cvsweb.php/ofbizNeogia/neogia/manufacturing/webapp/manufacturing/tests/ManufacturingTestSuite.html?rev=1.9;content-type=text%2Fplain;cvsroot=neogia)

...

Here an example based on one of my test (http://labs.libre-entreprise.org/plugins/scmcvs/cvsweb.php/ofbizNeogia/neogia/manufacturing/webapp/manufacturing/tests/TestCreateNomenclature.html?rev=1.6;content-type=text%2Fplain;cvsroot=neogia)

Code Block
<!-- create a variable named uid that contains an unique identifier -->
<tr>
       <td>store</td>
       <td>javascript{(new Date()).getTime() % 10000}</td>
       <td>uid</td>
</tr>

...

3) What is the difference between click and clickAndWait ? I would like to understand why I'm getting different behaviors from click and clickAndWait functions. Here is the scenario: I want to perform the login and then verify some text on the page (what should be pretty straight forward...) My first approach was  using the clickfunction + pause function. Something like below:

<tr>
<td>click</td>
<td>submit</td>
<td></td>
</tr><tr>
<td>pause</td>
<td>3000</td>
<td></td>
</tr>

The approach above worked fine and I was able to proceed with my test. However, I was looking the clickAndWait functionality and, per my understanding, this function should have a simlar behavior to my code above.. then I wrote the following:

Code Block
<tr>
<td>clickAndWait</td>
<td>submit</td>
<td></td>
</tr>

The code above is getting a "Permission Denied" message. I already check the URLs and I'm not launching a different domain (before I click I have http://domain/Login/ and after the submission I have http://domain/App/).
I think the right solution is to use clickAndWait command instead of click+pause because it always success contrary to click+pause (we dont known the page response time). I see no reason why you don't observe the same behavior with clickAndWait. Maybe it's because your are testing the login page that can be a little tricky to test due to the session handling.
To be sure to always start a test in a clean session, my tests always do the same actions :
1. logoff
2. login
3. check error
Here, an example of my standard login procedure under selenium  from (http://labs.libre-entreprise.org/plugins/scmcvs/cvsweb.php/ofbizNeogia/neogia/manufacturing/webapp/manufacturing/tests/TestProcessRouting.html?rev=1.2;content-type=text%2Fplain;cvsroot=neogia)

Code Block
<!-- Begin of standard login procedure -->
<tr>
 <td>open</td>
 <td>/manufacturing/control/logout</td>
 <td></td>
</tr>
<tr>
 <td>type</td>
 <td>USERNAME</td>
 <td>admin</td>
</tr>
<tr>
 <td>type</td>
 <td>PASSWORD</td>
 <td>ofbiz</td>
</tr>
<tr>
 <td>select</td>
 <td>locale</td>
 <td>value=fr</td>
</tr>
<tr>
 <td>clickAndWait</td>
 <td>submitButton</td>
 <td></td>
</tr>
<tr>
 <td>assertElementNotPresent</td>
 <td>//div[@class='errorMessage']</td>
 <td></td>
</tr>
<!-- End of standard login procedure -->

Advices from Peter Goron

Anchor
NativeDatabaseTip
NativeDatabaseTip

How to troubleshoot SQL Errors

If you receive an SQL error in ofbiz, it doesn't show the error from the database itself.  Instead, it shows a general error which isn't neccessarily clear.  Run the SQL directly on the database get a more helpful error message. AnchorNativeDatabaseTipNativeDatabaseTip