今天用Soap UI测试API,出现几个问题现在分享一下
这是处理内存和编码的问题
如果SoapUI正在处于运行的状态,那么先请关闭,再进行下面的操作。
操作方法:
查找SoapUI的安装的路径,点击路径下的bin目录,对SoapUI.bat文件进行编辑,找到相应语句并修改成以下语句:
set JAVA_OPTS=
-Xms128m -Xmx1024m
-Dsoapui.properties=soapui.properties "-Dsoapui.home=%SOAPUI_HOME%\" -splash:soapui-pro-splash.png
-Dsun.jnu.encoding=UTF-8 -Dfile.encoding=UTF-8
注明:修改蓝色内容可解决内存溢出问题;
新增红色内容可解决中文乱码问题。
SoapUI.bat文件修改完成之后,进行保存。
修改内存之后,如果想要开启SoapUI,务必点击
SoapUI.bat文件,千万别点击
SoapUI应用程序,避免应用程序出错
进入SoapUI应用程序之后,点击Help-System properties,即可看到修改后的内容。
其次是Socket Timeout
Default socket timeout is set to 60000 milliseconds. You can change it:
File -> Preferences -> HTTP Settings -> Socket Timeout
下面这个方法我没有试过,不知道可不可行
You can also edit this setting directly in the soapui-settings.xml
<con:setting id="HttpSettings@socket_timeout">120000</con:setting>
You can also set the value to 0 and then it doesn't time out. Tested it with SoapUI 4.5.0
设置为0永远不超时