Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Start QuickTest
qtApp.Visible = True ' Make the QuickTest application visible
' Make changes in a test on Quality Center with version control
qtApp.TDConnection.Connect "http://alm11.ca.com/qcbin", "MFSO", "CA_Gen_QA", "kumbh05", "Bharat037*", True ' Connect to Quality Center
If qtApp.TDConnection.IsConnected Then ' checking condition
Set qtResult = CreateObject("QuickTest.RunResultsOptions") 'Object created
qtResult.ResultsLocation = "D:\Temp\" ' My results location
qtApp.Open "[ALM] ' Subject\MASTER_SCRIPTS\ARTS85\REGRESSION\DISTRIBUTED\INST_EXEC\WIN_ASP\bharath_Test", True ' Open the test
Set objTest = qtApp.Test 'Object test
objTest.Run qtResult ' Running the script
objTest.SaveAs "D:\Temp\" ' I am getting ERROR MESSAGE HERE
qtResult.ResultsLocation = "D:\Temp\" ' Set the results location
End If ' If CLOSED
qtApp.TDConnection.Disconnect 'Disconnecting
qtApp.Quit 'quit
Set qtApp = Nothing 'object set to nothing
在SaveAs
方法中,我收到错误
指定的测试名称无效。名称不能为空。
答案 0 :(得分:3)
您:
Slider value is now - 6
表示“D:\ Temp \”是一个文件夹。添加文件名。
答案 1 :(得分:0)
SaveAs方法应该采用文件名而不是文件夹名称。
您必须为该功能提供文件名
删除
try {
URI uri = new URI("http://www.google.com");
Desktop desktop = null;
if (Desktop.isDesktopSupported()) {
desktop = Desktop.getDesktop();
}
if (desktop != null)
desktop.browse(uri);
} catch (IOException ioe) {
ioe.printStackTrace();
} catch (URISyntaxException use) {
use.printStackTrace();
}
试试这个:
objTest.SaveAs "D:\Temp\"