Please note that Sahi's development and support teams do not actively monitor this. This is more a community forum. If you are a Sahi Pro user looking for commercial support, please email support @ sahipro.com with your query.

browser.close() is not closing the browser with the build 20101103

venusvenus Members
I use Sahi with the tests written in java.
browser.close() is not closing the browser (firefox).

With earlier build {20100611}, the browser used to get closed.

Comments

  • narayannarayan Administrators
    Are you running both builds on the same machine? Does Sahi print the PID of the process on its console?
  • I have my java tests written in testng and invoked through ant.

    Scenario 1: {With environment variable SAHI_HOME set to D:\sahi_20100611\sahi & using the corresponding build sahi.jar file}

    Open a new command prompt in Win XP.
    The target gives the following:
    [testng] [Parser] Running:
    [testng] Ant suite
    [testng]
    [testng] Sahi properties file = D:\sahi_20100611\sahi\config\sahi.properties
    [testng] Sahi user properties file = D:\sahi_20100611\sahi\userdata\config\userdata.properties
    [testng] 15:32:08.465 INFO - "C:\Program Files\Mozilla ..........
    [testng] >>>> Sahi started. Listening on port: 9999
    [testng] >>>> Configure your browser to use this server and port as its proxy
    [testng] >>>> Browse any page and CTRL-ALT-DblClick on the page to bring up the Sahi Controller
    [testng] 15:32:09.996 INFO - PIDs: []; 1594 ms
    [testng] 15:32:15.482 INFO - Kill: []

    BROWSER GETS CLOSED IN THIS CASE.


    Scenario 2: {With environment variable SAHI_HOME set to D:\sahi_20101103\sahi & using the corresponding build sahi.jar file}

    Open a new command prompt in Win XP.
    The target gives the following:


    [testng] [Parser] Running:
    [testng] Ant suite
    [testng]
    [testng] Sahi properties file = D:\sahi_20101103\sahi\config\sahi.properties
    [testng] Sahi user properties file = D:\sahi_20101103\sahi\userdata\config\userdata.properties
    [testng] 15:41:42.623 INFO - "C:\Program Files\Mozilla ..................
    [testng] >>>> Sahi started. Listening on port: 9999
    [testng] >>>> Configure your browser to use this server and port as its proxy
    [testng] >>>> Browse any page and CTRL-ALT-DblClick on the page to bring up the Sahi Controller
    [testng] 15:41:43.716 INFO - No SSL Client Cert specified
    [testng] 15:41:44.029 INFO - PIDs: []; 1453 ms
    [testng] 15:42:07.593 INFO - Kill: []

    BROWSER DOES NOT GET CLOSED IN THIS CASE.
  • I have my java tests written in testng and invoked through ant.

    Scenario 1: {With environment variable SAHI_HOME set to D:\sahi_20100611\sahi & using the corresponding build sahi.jar file}

    Open a new command prompt in Win XP.
    The target gives the following:
    [testng] [Parser] Running:
    [testng] Ant suite
    [testng]
    [testng] Sahi properties file = D:\sahi_20100611\sahi\config\sahi.properties
    [testng] Sahi user properties file = D:\sahi_20100611\sahi\userdata\config\userdata.properties
    [testng] 15:32:08.465 INFO - "C:\Program Files\Mozilla ..........
    [testng] >>>> Sahi started. Listening on port: 9999
    [testng] >>>> Configure your browser to use this server and port as its proxy
    [testng] >>>> Browse any page and CTRL-ALT-DblClick on the page to bring up the Sahi Controller
    [testng] 15:32:09.996 INFO - PIDs: []; 1594 ms
    [testng] 15:32:15.482 INFO - Kill: []

    BROWSER GETS CLOSED IN THIS CASE.


    Scenario 2: {With environment variable SAHI_HOME set to D:\sahi_20101103\sahi & using the corresponding build sahi.jar file}

    Open a new command prompt in Win XP.
    The target gives the following:


    [testng] [Parser] Running:
    [testng] Ant suite
    [testng]
    [testng] Sahi properties file = D:\sahi_20101103\sahi\config\sahi.properties
    [testng] Sahi user properties file = D:\sahi_20101103\sahi\userdata\config\userdata.properties
    [testng] 15:41:42.623 INFO - "C:\Program Files\Mozilla ..................
    [testng] >>>> Sahi started. Listening on port: 9999
    [testng] >>>> Configure your browser to use this server and port as its proxy
    [testng] >>>> Browse any page and CTRL-ALT-DblClick on the page to bring up the Sahi Controller
    [testng] 15:41:43.716 INFO - No SSL Client Cert specified
    [testng] 15:41:44.029 INFO - PIDs: []; 1453 ms
    [testng] 15:42:07.593 INFO - Kill: []

    BROWSER DOES NOT GET CLOSED IN THIS CASE.
  • narayannarayan Administrators
    In both cases, PIDs do not seem to be gathered correctly. Can you please check if tasklist and taskkill commands are available on a command prompt?
  • both tasklist and taskkill /? on the command prompt is available.
  • I had tried running the Sahi tests on another desktop with Windows 2008 Server installed. browser.close() is NOT closing the browser on that machine also.
  • Used the latest sahi build 20110213, the corresponding jar files and set the SAHI_HOME environment variable to D:\sahi_20110213\sahi\. browser.close() still does not close the browser.

    I have JDK version "1.6.0_18"
    and jruby 1.5.6 (ruby 1.8.7 patchlevel 249) (2010-12-03 9cf97c3) (Java HotSpot(TM) Client VM 1.6.0_18) [x86-java]
  • Used the latest sahi build 20110213, the corresponding jar files and set the SAHI_HOME environment variable to D:\sahi_20110213\sahi\. browser.close() still does not close the browser.

    I have JDK version "1.6.0_18"
    and jruby 1.5.6 (ruby 1.8.7 patchlevel 249) (2010-12-03 9cf97c3) (Java HotSpot(TM) Client VM 1.6.0_18) [x86-java]
  • narayannarayan Administrators
    Hi Venus,

    Could you please paste the contents of your Controller's Info tab here?

    Thanks,
    Narayan
  • [Parser] Running:

    Sahi properties file = D:\sahi_20110213\sahi\config\sahi.properties
    Sahi user properties file = D:\sahi_20110213\sahi\userdata\config\userdata.properties
    >>>> Sahi started. Listening on port: 9999
    >>>> Configure your browser to use this server and port as its proxy
    >>>> Browse any page and CTRL-ALT-DblClick on the page to bring up the Sahi Controller
    Reading browser types from: D:\sahi_20110213\sahi\userdata\config\browser_types.xml
    Firefox 4 was not found at C:\Program Files\Mozilla Firefox 4.0 Beta 7\firefox.exe
    Chrome was not found at $LOCALAPPDATA\Google\Chrome\Application\chrome.exe
    13:07:27.203 INFO - No SSL Client Cert specified
    13:07:30.031 INFO - "C:\Program Files\Mozilla Firefox\firefox.exe" "http://sahi.example.com/_s_/dyn/Driver_start?sahisid=sahi_84806c720f6d404e71090240e21cfb285ad1__SahiAmpersandSahi__startUrl=http%3A%2F%2Fsahi.example.com%2F_s_%2Fdyn%2FDriver_initialized%3FstartUrl%3Dhttp%253A%252F%252Fsahi.example.com%252F_s_%252Fdyn%252FDriver_initialized"
    13:07:42.781 INFO - PIDs: []; 15375 ms
    13:08:16.250 INFO - Kill: []
    13:08:21.828 INFO - Kill: []
Sign In or Register to comment.