TestGen4Web-Python不支持中文
.安装 TestGen4Web-Python
svn checkout http://testgen4web-python.googlecode.com/svn/trunk/ testgen4web-python-read-only
cd testgen4web-python-read-only
python setup.py install
.用TestGen4Web录制脚本
cat googlecn.xml
<?xml version='1.0' encoding='UTF-8'?>
<![CDATA[window.location.href]]>
<![CDATA[http://www.google.cn/]]>
<![CDATA[]]>
<![CDATA[Google]]>
<![CDATA[/TABLE[1]/TBODY[1]/TR[1]/TD[3]//A[@CDATA="高级搜索"]]]>
<![CDATA[]]>
<![CDATA[]]>
<![CDATA[Google 高级搜索]]>
.转成twill 脚本报错:
-bash-3.1# testgen-convert twill-shell code googlecn.xmlecn.xml
Traceback (most recent call last):
File "/usr/local/bin/testgen-convert", line 5, in
pkg_resources.run_script('TestGen4Web-Python==0.2.2', 'testgen-convert')
File "/usr/local/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/pkg_resources.py", line 448, in run_script
File "/usr/local/lib/python2.5/site-packages/setuptools-0.6c8-py2.5.egg/pkg_resources.py", line 1173, in run_script
File "/usr/local/bin/testgen-convert", line 89, in
File "build/bdist.linux-x86_64/egg/testgen/twillshell.py", line 35, in process
File "build/bdist.linux-x86_64/egg/testgen/handler.py", line 39, in process
File "build/bdist.linux-x86_64/egg/testgen/twillshell.py", line 69, in click
File "build/bdist.linux-x86_64/egg/testgen/parser.py", line 179, in getLinkName
File "build/bdist.linux-x86_64/egg/testgen/parser.py", line 176, in getLinkPath
File "build/bdist.linux-x86_64/egg/testgen/parser.py", line 130, in _getSubPath
File "build/bdist.linux-x86_64/egg/testgen/parser.py", line 32, in stringifyTokens
UnicodeEncodeError: 'ascii' codec can't encode characters in position 1-4: ordinal not in range(128)