18 January 2026:


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.

2010-08-20 imposes minimum time between steps?

kchankchan Members
edited August 2010 in Sahi - Open Source
I've set the time between steps quite low, but watching the script run shows that it's actually roughly 100 milliseconds between steps.

It seems like each time I try to set a textbox via _setValue(_textbox(0, _near(_label("First Name"))))); the script seems to lag for 100 milliseconds. In older versions this was very fast.
But when I call _click(_submit("Save")); it seems to be quite fast at clicking the button.

I'm running IE7.
!**
! * Sahi - Web Automation and Test Tool
! * 
! * Copyright  2006  V Narayan Raman
! *
! * Licensed under the Apache License, Version 2.0 (the "License");
! * you may not use this file except in compliance with the License.
! * You may obtain a copy of the License at
! *
! *    http://www.apache.org/licenses/LICENSE-2.0
! *
! * Unless required by applicable law or agreed to in writing, software
! * distributed under the License is distributed on an "AS IS" BASIS,
! * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
! * See the License for the specific language governing permissions and
! * limitations under the License.
! **
# Sahi configuration file

proxy.port=9999

script.extension=sah;sahi;inc

# dirs. Relative paths are relative to userdata dir. Separate directories with semi-colon
scripts.dir=scripts;
# default log directory.
logs.dir=logs
# Directory where auto generated ssl cerificates are stored
certs.dir=certs


# Use external proxy server for http
ext.http.proxy.enable=true
ext.http.proxy.host=
ext.http.proxy.port=
ext.http.proxy.auth.enable=false
ext.http.proxy.auth.name=kamlesh
ext.http.proxy.auth.password=password

# Use external proxy server for https
ext.https.proxy.enable=true
ext.https.proxy.host=
ext.https.proxy.port=
ext.https.proxy.auth.enable=false
ext.https.proxy.auth.name=kamlesh
ext.https.proxy.auth.password=password

# There is only one bypass list for both secure and insecure.
ext.http.both.proxy.bypass_hosts=localhost|127.0.0.1|*.internaldomain.com

# Set the size of buffer for buffered input streams
io.buffer_size=8192

# Sets the hotkey which when pressed and doubleclicked,
# will open the Sahi controller window.
# Can specify ALT, SHIFT, CTRL or META
controller.hotkey=ALT

# Time (in milliseconds) between tests. Increase this if you get random connection refused exceptions or if tests hang after some time. units milliseconds
suite.time_between_tests=1000
# Inactive time in SECONDS after which browser should be killed. Will happen if browser has hung or page load has been manually aborted.
suite.max_inactive_time_for_script=60
# set suite.global_variables to true if you want variables set via _setGlobal to be accessible across tests in a suite. Advisable to keep false.
suite.global_variables=false

# Script execution params

#Time (in milliseconds) delay between steps
script.time_between_steps=25
#Time (in milliseconds) delay between retries once an error occurs
script.time_between_steps_on_error=25
#Number of retries once an error occurs
script.max_reattempts_on_error=3
#Number of cycles Sahi will wait for the page to load before it proceeds with execution
#Time spent is (script.max_cycles_for_page_load x script.time_between_steps) milliseconds
script.max_cycles_for_page_load=10
#No of times Sahi should wait for stability of AJAX and page loads before continuing. min value is 1
script.stability_index=3

# For automatic SSL keystore creation.
ssl.auto_create_keystore=true
# Set the algorithm. Example: For Sun's JDK use SunX509, for IBM use IbmX509
ssl.algorithm=SunX509
ssl.password=sahipassword
# Full file path to keytool utility if not in the system path
# This is generally in the <java_home>/bin directory
# On windows, keytool path, if specified, should have double backslashes without encompassing quotes. Eg. 
# keytool.path=D:\\java path\\bin\\keytool.exe
keytool.path=keytool

http.keep_alive=true

proxy.remote_socket_timeout=120000

ff.profiles.template=../config/ff_profile_template
ff.profiles.dir=browser/ff/profiles
ff.profiles.prefix=sahi
ff.profiles.max_number=10

response.modify_activex=true

debug.traffic.log=false

# Set this to true if Sahi should not click or do other actions on 
# elements (like menu items) which are not visible
element.visibility_check.strict=false

# Set this to true if files should automatically be downloaded when the Content-disposition response header is "attachment" 
download.download_if_contentdisposition_is_attachment=false

# Set this to 2 if browser seems to be idle for a long time during to AJAX calls.
# Use 1,2,3 for ZK apps. Just 2 for gmail (and comet based applications).
# Can be controlled in the script using _sahi.waitWhenReadyState1, _sahi.waitWhenReadyState2, _sahi.waitWhenReadyState3
xhr.wait_ready_states=1,2,3

# This is the first n bytes of response data used to determine response type. 
# Change this to some other nearby value if you get "java.io.IOException: Resetting to invalid mark" errors on the console  
response.sample_length=400

# Uncomment the following lines to use a client certificate.
# If there is no password, do not uncomment the password line.
# keystore type can be JKS, PKCS12 etc. 
#ssl.client.keystore.type=JKS
#ssl.client.cert.path=../certs/sahi_example_com
#ssl.client.cert.password=sahipassword

# Specifies the controller to be used
# Takes java, ruby and sahi as valid values; default is sahi
# Set this to java for recorder in java mode.
controller.mode=sahi

# Set Rhino optimizationLevel. 
# Change to -1 to beat 64K script limit. This will reduce performance though.
rhino.optimization_level=1

# Set to true to escape unicode characters to \u00xx syntax
script.escape_unicode=false

# Turns on/off some filters. Used for debugging pages which do not render properly through proxy.
filters.addCharacterFilter=true
filters.addJSModifierFilter=true
filters.addHTMLModifierFilter=true

# Common domain on which cookies are set. Use sahi.example.com
sahi.common_domain=sahi.example.com

Comments

  • JohanJohan Members
    edited November 2010
    I have the opposite problem. My settings:

    script.max_cycles_for_page_load=1200
    script.time_between_steps=100

    According to the comments, this should allow a max of 2 minutes wait for the page to load after clicking a button. Well, I just ran the script and it carried on immediately even though the page was still loading.

    What gives? How do I get Sahi to wait for the page to finish loading after clicking a button?

    Here's my config file:
    !**
    ! * Sahi - Web Automation and Test Tool
    ! * 
    ! * Copyright  2006  V Narayan Raman
    ! *
    ! * Licensed under the Apache License, Version 2.0 (the "License");
    ! * you may not use this file except in compliance with the License.
    ! * You may obtain a copy of the License at
    ! *
    ! *    http://www.apache.org/licenses/LICENSE-2.0
    ! *
    ! * Unless required by applicable law or agreed to in writing, software
    ! * distributed under the License is distributed on an "AS IS" BASIS,
    ! * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    ! * See the License for the specific language governing permissions and
    ! * limitations under the License.
    ! **
    # Sahi configuration file
    
    proxy.port=9999
    
    script.extension=sah;sahi;inc
    
    # dirs. Relative paths are relative to userdata dir. Separate directories with semi-colon
    scripts.dir=scripts;
    # default log directory.
    logs.dir=logs
    # Directory where auto generated ssl cerificates are stored
    certs.dir=certs
    
    
    # Use external proxy server for http
    ext.http.proxy.enable=false
    ext.http.proxy.host=
    ext.http.proxy.port=
    ext.http.proxy.auth.enable=false
    ext.http.proxy.auth.name=kamlesh
    ext.http.proxy.auth.password=password
    
    # Use external proxy server for https
    ext.https.proxy.enable=false
    ext.https.proxy.host=
    ext.https.proxy.port=
    ext.https.proxy.auth.enable=false
    ext.https.proxy.auth.name=kamlesh
    ext.https.proxy.auth.password=password
    
    # There is only one bypass list for both secure and insecure.
    ext.http.both.proxy.bypass_hosts=localhost|127.0.0.1|*.internaldomain.com
    
    # Set the size of buffer for buffered input streams
    io.buffer_size=8192
    
    # Sets the hotkey which when pressed and doubleclicked,
    # will open the Sahi controller window.
    # Can specify ALT, SHIFT, CTRL or META
    controller.hotkey=ALT
    
    # Time (in milliseconds) between tests. Increase this if you get random connection refused exceptions or if tests hang after some time. units milliseconds
    suite.time_between_tests=1000
    # Inactive time in SECONDS after which browser should be killed. Will happen if browser has hung or page load has been manually aborted.
    suite.max_inactive_time_for_script=60
    # set suite.global_variables to true if you want variables set via _setGlobal to be accessible across tests in a suite. Advisable to keep false.
    suite.global_variables=true
    
    # Script execution params
    
    #Time (in milliseconds) delay between steps
    script.time_between_steps=100
    #Time (in milliseconds) delay between retries once an error occurs
    script.time_between_steps_on_error=2000
    #Number of retries once an error occurs
    script.max_reattempts_on_error=5
    #Number of cycles Sahi will wait for the page to load before it proceeds with execution
    #Time spent is (script.max_cycles_for_page_load x script.time_between_steps) milliseconds
    script.max_cycles_for_page_load=1200
    #No of times Sahi should wait for stability of AJAX and page loads before continuing. min value is 1
    script.stability_index=5
    
    # For automatic SSL keystore creation.
    ssl.auto_create_keystore=true
    # Set the algorithm. Example: For Sun's JDK use SunX509, for IBM use IbmX509
    ssl.algorithm=SunX509
    ssl.password=sahipassword
    # Full file path to keytool utility if not in the system path
    # This is generally in the <java_home>/bin directory
    # On windows, keytool path, if specified, should have double backslashes without encompassing quotes. Eg. 
    # keytool.path=D:\\java path\\bin\\keytool.exe
    keytool.path=C:/progra~1/Java/jre6/bin/keytool
    
    http.keep_alive=true
    
    proxy.remote_socket_timeout=120000
    
    ff.profiles.template=../config/ff_profile_template
    ff.profiles.dir=browser/ff/profiles
    ff.profiles.prefix=sahi
    ff.profiles.max_number=10
    
    response.modify_activex=true
    
    debug.traffic.log=false
    
    # Set this to true if Sahi should not click or do other actions on 
    # elements (like menu items) which are not visible
    element.visibility_check.strict=false
    
    # Set this to true if files should automatically be downloaded when the Content-disposition response header is "attachment" 
    download.download_if_contentdisposition_is_attachment=false
    
    # Set this to 2 if browser seems to be idle for a long time during to AJAX calls.
    # Use 1,2,3 for ZK apps. Just 2 for gmail (and comet based applications).
    # Can be controlled in the script using _sahi.waitWhenReadyState1, _sahi.waitWhenReadyState2, _sahi.waitWhenReadyState3
    xhr.wait_ready_states=1,2,3
    
    # This is the first n bytes of response data used to determine response type. 
    # Change this to some other nearby value if you get "java.io.IOException: Resetting to invalid mark" errors on the console  
    response.sample_length=400
    
    # Uncomment the following lines to use a client certificate.
    # If there is no password, do not uncomment the password line.
    # keystore type can be JKS, PKCS12 etc. 
    #ssl.client.keystore.type=JKS
    #ssl.client.cert.path=../certs/sahi_example_com
    #ssl.client.cert.password=sahipassword
    
    # Specifies the controller to be used
    # Takes java, ruby and sahi as valid values; default is sahi
    # Set this to java for recorder in java mode.
    controller.mode=sahi
    
    # Set Rhino optimizationLevel. 
    # Change to -1 to beat 64K script limit. This will reduce performance though.
    rhino.optimization_level=-1
    
    # Set to true to escape unicode characters to \u00xx syntax
    script.escape_unicode=false
    
    # Turns on/off some filters. Used for debugging pages which do not render properly through proxy.
    filters.addCharacterFilter=true
    filters.addJSModifierFilter=true
    filters.addHTMLModifierFilter=true
    
    # Common domain on which cookies are set. Use sahi.example.com
    sahi.common_domain=sahi.example.com
    
    reports.filesystem.html.enabled=false
    reports.filesystem.xml.enabled=false
    reports.db.enabled=true
    reports.sql.enabled=false
    
    # Database logging. 
    # Tables are created using sahi/userdata/config/db/create_report_tables.sql
    db.driver_name=org.h2.Driver
    db.jdbc_url=jdbc:h2:$userDir/database/db0;DB_CLOSE_DELAY=-1
    db.user_name=sa
    db.password=
    db.script_gen_xsl=$userDir/config/db/script_sql_gen.xsl
    
  • I changed script.stability_index to 50 (it was 5)

    This seems to make it more stable. Are there any possible negative consequences from this? What does this setting actually do?
Sign In or Register to comment.