18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
Test Adempiere with Sahi
Hi,
I test Adempiere via Sahi,test login and Product Creation.But met a problem.
My test:
The scripts,
adlogin_test.sah
create_product.sah
i put the scripts to my.suite and test.
test them by commandline with command:
passed test.Successful!
will load two browser's window.load one window when login,after login, then load a new window to create product.
But if test with Xvfb,has problem as follow:
run:
problem:
Xvfb start by(started before test):
Can anyone help me on this issue?
Thanks
sunny
I test Adempiere via Sahi,test login and Product Creation.But met a problem.
My test:
The scripts,
adlogin_test.sah
_setValue(_textbox(0), "SuperUser");
_setValue(_password(0), "System");
_click(_image(2),"Ok24.png");
_click(_image("spacer.gif"));
_click(_cell("GardenWorld Admin"));
_click(_image("spacer.gif[1]"));
_click(_image(5),"Ok24.png")
create_product.sah
_click(_span("z-tree-ico z-tree-root-close[7]"));
_click(_span("z-tree-ico z-tree-tee-close[23]"));
_click(_image("mWindow.png[186]"));
_click(_image("New24.png"));
_setValue(_textbox(5), "ProductA");
_click(_image("spacer.gif[3]"));
_setValue(_textbox(6), "create a product");
_click(_image("spacer.gif[6]"));
_click(_cell("Day"));
_click(_checkbox("on[4]"));
_click(_image("Save24.png"));
_click(_link(4));
i put the scripts to my.suite and test.
test them by commandline with command:
sahi # java -cp lib/ant-sahi.jar net.sf.sahi.test.TestRunner /mnt/sda4/Sahi/sahi/userdata/scripts/my.suite "/usr/bin/firefox" adurl /mnt/sda4/Sahi/sahi/default localhost 9999 1 firefox
passed test.Successful!
will load two browser's window.load one window when login,after login, then load a new window to create product.
But if test with Xvfb,has problem as follow:
run:
sahi # java -cp lib/ant-sahi.jar net.sf.sahi.test.TestRunner /mnt/sda4/Sahi/sahi/userdata/scripts/my.suite "/usr/bin/firefox" adurl /mnt/sda4/Sahi/sahi/default localhost 9999 1 firefox "--display=:99 -profile /mnt/sda4/Sahi/sahi/userdata/browser/ff/profiles/sahi1 -no-remote"
problem:
_click(_span("z-tree-ico z-tree-root-close[7]"));
Error: The parameter passed to _click was not found on the browser
Xvfb start by(started before test):
# cd /usr/bin/
bin #Xvfb :99 -auth /etc/X99.hosts -screen 0 800x600x24 &
Can anyone help me on this issue?
Thanks
sunny
This discussion has been closed.
Comments
create_product.sah,make it include adlogin_test.sah
my.suite
run the scripts,but also has problem:
I think no problem with my scripts,because sometimes they can passed test,
can pass test if run them by separated.
and if i reload the window manually after login,they can passed test
so i add script after login scripts.
but also can't pass test.
The above tests tested by Sahi Controller.
info:
Sahi
Version : V3
Build : 2010-03-21
Check for updates
Browser
UserAgent : Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.6) Gecko/2009030911 Gentoo Firefox/3.0.6
Name : Mozilla Firefox
Version : 5.0 (X11; en-US)
Native XmlHTTPRequest : true
Is Java enabled : true
Is cookie enabled : true
Operating System
Name : Linux
Version : 2.6.27-gentoo-r8
Architecture : i386
Is process list available : true
Java
Java Installed Directory : /opt/sun-jdk-1.6.0.11/jre
JRE Version : 1.6.0_11
Is keytool available : true
Can anyone help me?
We will investigate this and get back to you.
Regards,
Narayan
Instead of using profile sahi1, you should be using sahi$threadNo.
(Sahi will replace $threadNo with 0,1,2 etc. to use separate profiles.)
I am still checking the refresh related issue.
Regards,
Narayan
Your problem with Sahi hanging is that Sahi is waiting for one particular AJAX request to finish, while that request is actually a comet request (which will never finish).
I have added a condition to check for "comet" in XHR request URLs and not wait on them.
Open sahi/htdocs/spr/concat.js and search for
and replace it with:
We will add this to the coming build.
Regards,
Narayan
Thanks
Regards,
sunny
Could you confirm that it worked for you?
Regards,
Narayan
No. I will try your solution tomorrow!
Regards,
sunny
I try your solution that modifed sahi/htdocs/spr/concat.js,it worked now by Sahi Controller.
but if i test by coomandline:
has problem:
and using profile sahi1
works ok.
Thanks!
Regards,
sunny
Forgot that you are on linux.
Please use sahi\$threadNo instead of sahi$threadNo
Regards,
Narayan
Tested,works ok!
Thank you very much!
Regards,
sunny