Rajesh Chopra
posted this on October 15, 2011 01:39
Some common Twist issues and solutions
Problem #1
It seems to be using Sahi even though I chose Selenium 2 in the project setup.
Answer:
Twist uses Sahi underneath to record Selenium 2 scripts. When recorder window shows 'Sahi driver' even when your project was created to use Selenium driver, it is not creating a Sahi project and can be ignored.
===============================
Problem #2
Corresponding error trace #1:
Twist cannot toggle the proxy. Please set the proxy manually for recording.
You will also have to unset it after recording
socket closed
Corresponding error trace #2:
>>>> Sahi started. Listening on port: 9999
>>>> Configure your browser to use this server and port as its proxy
Answer:
Sahi runs on port 9999 on the machine where Twist is installed. Please list localhost and port 9999 in your local browser settings.
Browsers like Internet Explorer, Google Chrome and Safari requires proxy to be set to "localhost" as the proxy host and "9999" as the proxy port.
===============================
Problem #3
Primary consideration when executing test scenarios outside the firewall:
Answer:
If you are trying to test a web application and your setup is behind an external proxy (System wide proxy) and you will need to ask you system admin for the proxy host and port name, edit the userdata.properties file and enter values for :
If a non-secure proxy is used:
ext.http.proxy.host=
ext.http.proxy.port=
If a secure proxy is used:
ext.https.proxy.host=
ext.https.proxy.port=
The userdata.properties file can be found at:
Sahi user properties file = <project path in your workspace>\sahi\userdata\config\userdata.properties
===================================================
Problem #4
Associated error trace #1:
Sahi user properties file = C:\Program
Files\twist\plugins\com.thoughtworks.webdriver.recorder_1.0.0.11290\sahi\userdata\config\userdata.properties
*java.io.IOException*: The system cannot find the path specified
Associated error trace #2:
*java.io.FileNotFoundException*: C:\Program
Files\twist\plugins\com.thoughtworks.webdriver.recorder_1.0.0.11290\sahi\userdata\config\browser_types.xml
(The system cannot find the file specified)
Answer:
1. Ensure you have sufficient privileges to read files from the location where you installed Twist. Ensure you are running as the same user that installed Twist
2. It was found that it is best to create the workspace in a personal directory and not in the default location of Program Files.
3. Make sure the browser launch location, provided along with browser type, is correct .i.e In case of Windows 64-bit OS this needs to be changed from ...\Program Files\... to ...\Program Files (x86)\...
4. Right click on project and refresh and this will take care of issues where the reference to userdata.properties/browser_types.xml from older projects (and possibly a deleted project) is the problem.
=======================
Problem #5
Corresponding error trace:
[pool-3-thread-1] ERROR com.thoughtworks.twist.remote - Unable to record scenario
[X:\Users\bbegy\workspace\TestProj1\scenarios\NewScenario.scn]
Answer:
While it is known that the Sahi/userdata/config/userdata.properties should be edited to tell Twist to use a HTTP/HTTPS proxy when executing a scenario, note that the recorder should be configured as well.
Without the recorded configured for proxy, when Twist launches the Sahi recorder, that instance can not get to sites outside the firewall in case you are launching sites outside the company firewall.
In order to set the recorder to deal with the proxy, you have to modify the following file:
<project path in your workspace>\sahi\userdata\config\userdata.properties