Here is the first project assignment for everyone to complete. This is intended as a group exercise to get everyone setup with the latest code. The assignment will also help everyone learn some of the basics of creating a new test with Selenium XML.
Updating to latest seleniumXml Improvements
Assuming you have already installed ofbiz from the trunk. Here is the next group task.
I need everyone to get the most updated seleniumXml code. I have applied a patch to the ofbiz trunk but the patch requires merging with the code base. To make this easier I would like everyone to do the following:
1. Down load the attached zip file which contains the lastest seleniumXml code.
2. Update your version of ofbiz to revision 818045 to match the code in the zip file.
svn update -r 818045
3. Unzip the file from step 1 on top of your ofbiz directory. It expects the parent directory to be called "ofbiz" so if you have a different directory you may have to move the files manually.
4. Now build ofbiz again:
ant
5. Now install the latest selenium-server jar file with the following steps:
- remove the existing selenium-server.jar from testtools/lib
- run: ant install-seleniumxml
This will copy the newest selenium-server.jar file to your testtools/lib directory.
6. Now start ofbiz from the command line:
startofbiz.sh or startofbiz.bat
7. Now start the selenium-server from another command window
/framework/testtools/ant run-seleniumserver
8. Now run the example seleniumXml test from another command window (you should have three windows open)
/framework/testtools/ant run-seleniumxml
The example test should bring up an instance of firefox and login to the ofbiz example. The example test runs through the following simple test cases:
- example_start.xml
- example_login.xml
- example_new.xml
- example_search.xml
If you have any problems getting this working please send me an email or post the question to the forum.
Assignment
There is a problem with the example_search test case. The search button has moved to another screen. Your assignment is to find the ID for the search button and change the example_search.xml test to use this new button. I recommend you install the firebug plugin in firefox as it is the best tool for examining web pages and debug HTML/JavaScript. Let me know if you have found a fix for the search screen.
After you have fixed the example_search test case look at creating a brand new test case for testing other features of the example application.
Brett
Zip file of updated source code
By brettgpalmerPlease disregard the .txt extension. I had to use that extension to attach the zip file to this document. You should be able to unzip the attached file as instructed.
Brett
problem with zip file uploads - resolved
By sandyThere was a restriction on type of files that can be uploaded. zip, gzip, tar are now allowed file formats.
problem in running seleniumserver & seleniumxml
By zohaibhi there,
I have done everything upto step 6
but ant running of seleniumserver and seleniumxml are showing me errors.
i have ant properly installed..
the errors in running seleniumxml are :
Buildfile: build.xml
init:
classes:
[javac15] Compiling 12 source files to C:\eclipse\workspace\ofbiz\framework\testtools\build\classes
[javac15] C:\eclipse\workspace\ofbiz\framework\testtools\src\org\ofbiz\testtools\ModelTestSuite.java:71: cannot find symbol
[javac15] symbol : method getGenericDelegator(java.lang.String)
[javac15] location: interface org.ofbiz.entity.GenericDelegator
[javac15] this.delegator = GenericDelegator.getGenericDelegator(this.originalDelegatorName).makeTestDelegator(this.originalDelegatorName + uniqueSuffix);
[javac15] ^
[javac15] Note: C:\eclipse\workspace\ofbiz\framework\testtools\src\org\ofbiz\testtools\seleniumxml\SeleniumXml.java uses unchecked or unsafe operations.
[javac15] Note: Recompile with -Xlint:unchecked for details.
[javac15] 1 error
and the error in installing seleniumserver are
Buildfile: build.xml
init:
prepare:
classes:
[javac15] Compiling 12 source files to C:\eclipse\workspace\ofbiz\framework\testtools\build\classes
[javac15] C:\eclipse\workspace\ofbiz\framework\testtools\src\org\ofbiz\testtools\ModelTestSuite.java:71: cannot find symbol
[javac15] symbol : method getGenericDelegator(java.lang.String)
[javac15] location: interface org.ofbiz.entity.GenericDelegator
[javac15] this.delegator = GenericDelegator.getGenericDelegator(this.originalDelegatorName).makeTestDelegator(this.originalDelegatorName + uniqueSuffix);
[javac15] ^
[javac15] Note: C:\eclipse\workspace\ofbiz\framework\testtools\src\org\ofbiz\testtools\seleniumxml\SeleniumXml.java uses unchecked or unsafe operations.
[javac15] Note: Recompile with -Xlint:unchecked for details.
[javac15] 1 error
It appears that there is error in ModelTestSuite.java
yes me too facing same
By rashmi.singhyes me too facing same problem
the step which i have taken is
i had replaced all the file of old ofbiz/framework from new ofbiz/framework(which i got from download)
and there is no such Zar file "selenium-server.zar" in my testtools/lib folder I found
and then i went to the path where my ofbiz setup is and run this command
R:\testing\testing_project\ofbiz-trunk>ant
r:
epare:
asses:
rc-available:
r:
epare:
asses:
rc-available:
r:
epare:
asses:
[javac15] Compiling 12 source files to R:\testing\testing_project\ofbiz-trunk\
amework\testtools\build\classes
[javac15] R:\testing\testing_project\ofbiz-trunk\framework\testtools\src\org\o
iz\testtools\VerifySeleniumSetups.java:17: package javax.servlet.http does not
xist
[javac15] import javax.servlet.http.HttpServletRequest;
[javac15] ^
[javac15] R:\testing\testing_project\ofbiz-trunk\framework\testtools\src\org\o
iz\testtools\VerifySeleniumSetups.java:18: package javax.servlet.http does not
xist
[javac15] import javax.servlet.http.HttpServletResponse;
[javac15] ^
[javac15] R:\testing\testing_project\ofbiz-trunk\framework\testtools\src\org\o
iz\testtools\VerifySeleniumSetups.java:50: cannot find symbol
[javac15] symbol : class HttpServletRequest
[javac15] location: class org.ofbiz.testtools.VerifySeleniumSetups
[javac15] public static String verifyConfig(HttpServletRequest request, Ht
ServletResponse response){
[javac15] ^
[javac15] R:\testing\testing_project\ofbiz-trunk\framework\testtools\src\org\o
iz\testtools\VerifySeleniumSetups.java:50: cannot find symbol
[javac15] symbol : class HttpServletResponse
[javac15] location: class org.ofbiz.testtools.VerifySeleniumSetups
[javac15] public static String verifyConfig(HttpServletRequest request, Ht
ServletResponse response){
[javac15] ^
[javac15] R:\testing\testing_project\ofbiz-trunk\framework\testtools\src\org\o
iz\testtools\VerifySeleniumSetups.java:97: cannot find symbol
[javac15] symbol : class HttpServletRequest
[javac15] location: class org.ofbiz.testtools.VerifySeleniumSetups
[javac15] public static void doDownload( HttpServletRequest request, Http
rvletResponse response){
[javac15] ^
[javac15] R:\testing\testing_project\ofbiz-trunk\framework\testtools\src\org\o
iz\testtools\VerifySeleniumSetups.java:97: cannot find symbol
[javac15] symbol : class HttpServletResponse
[javac15] location: class org.ofbiz.testtools.VerifySeleniumSetups
[javac15] public static void doDownload( HttpServletRequest request, Http
rvletResponse response){
[javac15] ^
[javac15] R:\testing\testing_project\ofbiz-trunk\framework\testtools\src\org\o
iz\testtools\VerifySeleniumSetups.java:143: cannot find symbol
[javac15] symbol : class HttpServletRequest
[javac15] location: class org.ofbiz.testtools.VerifySeleniumSetups
[javac15] public static String checkProgressDownloadStatus(HttpServletRequ
t request, HttpServletResponse response){
[javac15] ^
[javac15] R:\testing\testing_project\ofbiz-trunk\framework\testtools\src\org\o
iz\testtools\VerifySeleniumSetups.java:143: cannot find symbol
[javac15] symbol : class HttpServletResponse
[javac15] location: class org.ofbiz.testtools.VerifySeleniumSetups
[javac15] public static String checkProgressDownloadStatus(HttpServletRequ
t request, HttpServletResponse response){
[javac15]
^
[javac15] R:\testing\testing_project\ofbiz-trunk\framework\testtools\src\org\o
iz\testtools\VerifySeleniumSetups.java:155: cannot find symbol
[javac15] symbol : class HttpServletResponse
[javac15] location: class org.ofbiz.testtools.VerifySeleniumSetups
[javac15] public static void toJsonObject(Map attrMap, Http
rvletResponse response){
[javac15] ^
[javac15] Note: R:\testing\testing_project\ofbiz-trunk\framework\testtools\src
rg\ofbiz\testtools\seleniumxml\SeleniumXml.java uses unchecked or unsafe opera
ons.
[javac15] Note: Recompile with -Xlint:unchecked for details.
[javac15] 9 errors
ILD FAILED
\testing\testing_project\ofbiz-trunk\build.xml:154: The following error occurr
while executing this line:
\testing\testing_project\ofbiz-trunk\framework\build.xml:141: The following er
r occurred while executing this line:
\testing\testing_project\ofbiz-trunk\macros.xml:27: The following error occurr
while executing this line:
\testing\testing_project\ofbiz-trunk\framework\testtools\build.xml:62: Compile
ailed; see the compiler error output for details.
thanks and regards
Rashmi Singh
2008074
IIIT Bangalore
Errors while doing the first assignment
By manishHi,
I am getting errors while doing step 4 and 5th. Following are the errors which i got while doing the same. need help on the same.
BUILD FAILED
C:\IIITB\3rdSem\SoftwareTesting\ofbiz-trunk-current\ofbiz-trunk\build.xml:154: T
he following error occurred while executing this line:
C:\IIITB\3rdSem\SoftwareTesting\ofbiz-trunk-current\ofbiz-trunk\framework\build.
xml:141: The following error occurred while executing this line:
C:\IIITB\3rdSem\SoftwareTesting\ofbiz-trunk-current\ofbiz-trunk\macros.xml:27: T
he following error occurred while executing this line:
C:\IIITB\3rdSem\SoftwareTesting\ofbiz-trunk-current\ofbiz-trunk\framework\testto
ols\build.xml:62: Compile failed; see the compiler error output for details.
Total time: ४३ seconds
C:\IIITB\3rdSem\SoftwareTesting\ofbiz-trunk-current\ofbiz-trunk\framework\testto
ols>"C:\Program Files\Java\jdk1.6.0_14/bin/java.exe" -Dselenium.config=./config/
seleniumXml.properties -cp ./build/lib/ofbiz-testtools.jar;./lib/httpclient-4.0-
beta1.jar;./lib/selenium-java-client-driver.jar;../../framework/base/lib/jdom-1.
1.jar;../../framework/base/lib/scripting/jython-nooro.jar;../../framework/base/l
ib/junit.jar;../../framework/base/lib/commons/commons-lang-2.3.jar;../../framewo
rk/base/lib/log4j-1.2.15.jar org.ofbiz.testtools.seleniumxml.SeleniumXml
Please include a path for the selenium XML test file.
Thanks and Regards,
Manish Agrawal
IIIT Bangalore
Fix for build error
By brettgpalmerSorry, there is a VerifySeleniumSetups.java file that was added by the community that is requiring a j2ee library. This file isn't necessary to run our tests but I'm attaching an updated build.xml file.
The new file has the following line added:
^M
Replace the framework/testtools/build.xml with this new one and then run the build again. This should fix the compile error.
Note: I had to rename the build.xml file to build.xml.txt to post to the forum. Please rename it back to build.xml after you have downloaded it.
Brett
Here is the new line that didn't show up in my last post
By brettgpalmer< fileset dir="../base/lib/j2eespecs" includes="*.jar"/ >
Error while executing Step6
By Aparana_GuptaSir,
I was able to follow till Step 5 successfully.
On following the step 6: it gave me the following error
E:\ofbiz>startofbiz.bat
E:\ofbiz>echo off
E:\ofbiz>"C:\Program Files\Java\jdk1.6.0_07\\bin\java" -Xms128M -Xmx512M -jar of
biz.jar 1>runtime\logs\console.log
Exception in thread "main" java.lang.IncompatibleClassChangeError: Found class o
rg.ofbiz.entity.GenericDelegator, but interface was expected
at org.ofbiz.entity.model.ModelEntityChecker.checkEntities(ModelEntityCh
ecker.java:43)
at org.ofbiz.entity.GenericDelegator.(GenericDelegator.java:254)
at org.ofbiz.entity.GenericDelegator.getGenericDelegator(GenericDelegato
r.java:141)
at org.ofbiz.catalina.container.CatalinaContainer.init(CatalinaContainer
.java:171)
at org.ofbiz.base.container.ContainerLoader.loadContainer(ContainerLoade
r.java:190)
at org.ofbiz.base.container.ContainerLoader.load(ContainerLoader.java:66
)
at org.ofbiz.base.start.Start.initStartLoaders(Start.java:259)
at org.ofbiz.base.start.Start.init(Start.java:97)
at org.ofbiz.base.start.Start.main(Start.java:408)
E:\ofbiz>
I have added the line mentioned by you in 'build.xml' file.
Kindly guide how to proceed with this.
Thank you,
Regards,
Aparana Gupta
Did it successfully...
By zohaibHi brett, thanks for the build.xml file you sent, it solved my problem.
I have done everything that you said.
when i start example_start it starts a new session of firefox.
but inspite of the fact that i have already installed seleniumIDE it does not appear in this session. So I am not able to record anything. Here is a snapshot of what messages i get in selenium_server console after running example_start.xml
02:29:06.796 INFO - Preparing Firefox profile...
AskSearch Module returned back when NSGetModule is called during initialization
AskSearchModule: Registration Successful
AskObserverFactory Successful {00000000-0000-0000-c000-000000000046}
AskObserverObject: QueryInterface successful
AskObserverObject: QueryInterface successful
AskObserverObject: QueryInterface successful
AskObserverObject: QueryInterface successful
Observe: topic = xpcom-startup
AskObserverObject: QueryInterface successful
Added Observer : domwindowopened
Observer: Successful
02:29:09.718 INFO - Launching Firefox...
02:29:13.250 INFO - Got result: OK,2f939ce1aed24b9ba94f0abe072b6ef9 on session 2
f939ce1aed24b9ba94f0abe072b6ef9
02:29:13.265 INFO - Command request: open[/example/control/logout, ] on session
2f939ce1aed24b9ba94f0abe072b6ef9
02:29:17.234 INFO - Got result: OK on session 2f939ce1aed24b9ba94f0abe072b6ef9
Problem with startup.bat
By nabilaHi i am having the same problem as Aparana, have followed the same steps as indicated by you.
The selenium-server.jar file seems to have some problem as it gives a question mark next to the file in \ofbiz\framework\testtools\lib
Could you guide us through this.
Few Tips to get things running
By zohaibI assume that everybody is getting upto step 3
1. Unzip the file that brett has given (somewhere but not directly to ofbiz-trunk)
2. Copy only the contents of extracted folder ofbiz\framework\testtools\(config,src,testdef,build) to your ofbiz trunk's framework\testtools, let it overwrite the build.xml file.
3. now build ofbiz through ant command.
4. check that u have the new seleniumserver.jar file from step 5 in testtools\lib
5. Start ofbiz.
6. In another cmd prompt go to testtools folder where runSeleniumXml.bat, runSeleniumServer.bat etc files are present and typerunSeleniumServer.bat, it should start the server on port 4444
7. Now from the new command prompt and same path as above type runSeleniumXml testdef\seleniumxml\example\example_start.xml.
An instance of firefox should start........
Tell me if it solves the problem..
Note: We are getting most of the errors because our ofbiz-trunk is being overwritten.
i m able to do it thank you
By rashmi.singhi m able to do it
thank you zoheb
this steps working for me!!
Rashmi Singh
2008074
IIIT Bangalore
Problem in proceeding further
By anenthi have followed what zohaib has specified until step 5. when i start ofbiz with the bat file,
i get the error that Aparana has indicated.
I agree with aparna &
By ReenaI agree with aparna & anenth,even i am getting errors after step 5.Please suggest how to proceed after that ?
Problem continues
By nabilaAs anenth has indicated, I am facing the same problem. Have followed what zohaib indicated but starting ofbiz gives the same error (As before).
Solution
By nabilaHey guys try this solution and see if it works. I tried and it worked for me.. Searched and got the answer.
before starting you ofbiz(the bat file)
run the following commands :
ant clear
ant build
then start the bat file and see if the error goes... Rest just follow the steps indicated above.
Above solution works
By arijitmitsi was able to startup the firefox instance of OfBiz and the selenium remote control after the clean & build commands.
i guess a typo is there, it should be
ant clean
ant build
Furthermore, can anyone help me find out the other test xml's (cant find the example_search.xml) or is it running on the instance itself.
regards,
arijit
Everyone working all right?
By brettgpalmerSorry for the confusion there. Just wanted to check if everyone was able to run the example test script and has started on fixing the search test.
Brett
Regarding problem with search test case
By keerthi_iiitbHi..
Search button is available in two pages of Example i.e, main and Find example pages.
By clicking search button in main the control is going to Find example page........Is it the case that we have to change it accordingly that the control should go to same main page and display search results.... and one more issue is Selenium IDE and Firebug are not working in Firefox instance of OFbiz. Kindly guide us regarding this.
Thanks and Regards
Keerthika
I agree with keerthika
By zohaibSeleniumIDE and Firebug does not appear in ofbiz instance of firefox.
But a work-around is to open a firefox yourself and copy that web-address from firefox instance and paste on it.
Moreover I still am not able to figure out where the search button might go.
Thanks for work-around
By keerthi_iiitbZohaib ,Thanks for work-around for SeleniumIDE and Firebug for Firefox instance of Ofbiz......but even after tracking them Iam not sure what to do actually regarding search button.
Thanks
Keerthika
wholesale designer handbags
By gchtfgThis website can be a
By christimgThat is the proper blog for
By amandahc3E car insurance
By amandahc3Chicago illinois personal
By catheriypNu skin 180 system with
By catheriypNude teen sex cams krypton
By darlenefwVolume Pills permutation
By lindsayjqhydroxatone tenuous Follower
By catheriypElectronic Cigarette
By christimgAmbien lunesta Bromide
By florencjnWhere to buy b12 fat burner
By christimgparty dresses for women
By lindsayjqSearch meridia panmyeloid
By catheriypvery good submit, i actually
By darlenefwA formidable share, I simply
By amandahc3