Troubleshooting

Articles to help with common installation issues and questions

This is a public Discussion Area  publicRSS

Post

    Sarita Pol
    Problem : Twist2.3.1 scenarios not running using apache ant...
    Post posted September 14, 2011 by Sarita Pol, last edited February 9, 2012
    596 Views, 2 Comments
    Topic:
    Problem : Twist2.3.1 scenarios not running using apache ant for Firefox6 browser
    Body:

    I have installed twist2.3.1 as standalone application. I have migrated the project(created in twist2.3.0) to current version of twsit which is 2.3.1. When I run the twist scenarios using the apache ant for Firefox6.0.2 browser, it opens the firefox browser but the URL(http://www.google.com) is not getting opened. Blank URL is displayed. But it works absolutely fine for IE8. Also, If I run the twist scenarios through Twist it works fine. It gives exceptions only when I run through apache ant.

    The exception is :

    [twist.runner] org.openqa.selenium.firefox.NotConnectedException: Unable to connect to hos
    t localhost on port 7055 after 45000 ms
    [twist.runner]  at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.star
    t(NewProfileExtensionConnection.java:98)
    [twist.runner]  at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.jav
    a:148)
    [twist.runner]  at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:
    86)
    [twist.runner]  at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:127
    )
    [twist.runner]  at com.thoughtworks.webdriver.recorder.StandaloneDriverFactory.createFireF
    oxDriver(StandaloneDriverFactory.java:126)
    [twist.runner]  at com.thoughtworks.webdriver.recorder.StandaloneDriverFactory.createWebdriverBrowser(StandaloneDriverFactory.java:126)

    But If I create a new project and run through apache ant it works fine for firefox browser. I am running the twist scenarios externally.

    My environment:

    Windows XP

    Firefox 6.0.2
    Twist version - 2.3.1.11290
    JDK: 1.6
    Apache ant:1.8.2
    Operating system: Windows XP

    Any help in this regards will be appreciated.

    Thanks,

    Sarita.

    Comment

     

    • angshuman
      posted September 14, 2011 by angshuman

      Hi, 

      I assume that you have exported ant build file in Twist 2.3.0 - in that case, the ant file will have direct reference to libraries of that version. 

      for e.g. in build.xml, there can be references like 

      <pathelementlocation="${ECLIPSE_HOME}/plugins/com.thoughtworks.twist.driver.webdriver_2.5.0.11220.jar"/>

      whereas when you upgrade, you should export the libraries again, and update or re-generate the ant build file. 

      <pathelementlocation="${ECLIPSE_HOME}/plugins/com.thoughtworks.twist.driver.webdriver_2.5.0.11290.jar"/>

      (note: there are other ways to achieve this as well)

      If you open your failing scenarios within Twist and click the "execute" button, do they run? If yes, then the above is a likely problem and solution.

       

      Alternative, if you have gone with the "Export Twist libraries" options, then you should do the same again for running tests with new version. 

    • Sarita Pol
      posted September 14, 2011 by Sarita Pol

       Thanks angshuman for the quick reply.

      I had re-generated the build.xml and also exported the libraries again.  But still faced the same issue.

      But these scenarios passed when ran successfully within twist.

      What I observed is twist-libs folder had both the jars

      com.thoughtworks.twist.driver.webdriver_2.5.0.11220.jar and com.thoughtworks.twist.driver.webdriver_2.5.0.11290.jar. I deleted the entire contents from the twist-libs folder and again exported the twist libraries.

      With this it worked.

      Your reply helped me to locate the issue.

      Thanks,

      Sarita.