...
- OFBiz's Data File Tools
- How to use EntityWhereString
- How to troubleshoot SQL errors
- Tips for View Entities
- How to connect to an External Database
MySQL
...
- Create Financial Account:
https://demo.hotwaxmedia.com/accounting/control/EditFinAccount
Fin Account Type Id = Gift Certificate
Status = Active
Fin Account Code = 12345
Fin Account Pin = 123 - Create Fin Account Transaction:
https://demo.hotwaxmedia.com/accounting/control/EditFinAccountTrans?finAccountId=10010
Fin Account Trans Type Id = Deposit
Amount = 1000 (this amount should be grated that the order total)
After that Fin Account available balance will be 1000. You can check this here:
https://demo.hotwaxmedia.com/accounting/control/EditFinAccount?finAccountId=10000 - field "Available Balance".
...
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 | ||||
---|---|---|---|---|
|
...
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.
Anchor | ||||
---|---|---|---|---|
|
How to connect to an External Database
- Create entity definitions for the external database like you would for an OFBiz entity (except use the no-auto-stamp="true" attribute).
- Assign the entities to a different group (in entitygroup.xml), "advertpro" for example.
- Assign the "mysql-advertpro" datasource the the default delegator: <group-map group-name="myExternalDB" datasource-name="myExternalDB"/>
- Use the delegator to access the external database.