51Testing软件测试论坛

标题: 无效的调用MID函数 [打印本页]

作者: wuminru_01    时间: 2013-10-31 14:21
标题: 无效的调用MID函数
请大家帮忙看看执行QTP时系统提示如下错误
Dim strText
Dim Cus_Count_String
Dim Cus_Count_Pos
Dim Cus_Count_Len
Dim Cus_Count_Num
Cus_Count_String="Total Customer Count"

Dim Total_Tickets_String
Dim Total_Tickets_Pos
Dim Total_Tickets_Len
Dim Total_Tickets_Num
Total_Tickets_String="Total Tickets Count"

Dim Total_Sales_String
Dim Total_Sales_Pos
Dim Total_Sale_Len
Dim Total_Sale_Num
Total_Sales_String="Total Sales"

window("Flight Reservation").Activate
window("Flight Reservation").WinMenu("Menu").Select"Analysis;Reports..."
If window("记事本").Exist Then
        reporter.ReportEvent micPass,"报告","报告生成并被打开"
        strText=window("记事本").WinEditor("Edit").GetROProperty("text")
        Reporter.ReportEvent micPass,"报告文本","报告文本是:"&strText

        Cus_Count_Pos=cint(instr(1,strText,Cus_Count_String))+len(Cus_Count_String)
        Reporter.ReportEvent micPass,"顾客总数数值的位置","顾客总数数值的位置是:"&Cus_Count_Pos
        Total_Tickets_Pos=cint(instr(1,strText,Total_Tickets_String))+len(Total_Tickets_String)
        reporter.ReportEvent micPass,"订票总数数值的位置","订票总数数值的位置是:"&Total_Tickets_Pos
        Total_Sales_Pos=cint(instr(1,strText,Total_Sales_String))+len(Total_Sales_String)
        reporter.ReportEvent micPass,"订票总数数值的位置","订票总数数值的位置是:"&Total_Sales_Pos

   Cus_Count_Len=cint(Total_Tickets_Pos-Cus_Count_Pos)-len(Total_Tickets_String)
   Total_Tickets_Len=cint(Total_Sales_Pos-Total_Tickets_Pos)-len(Total_Sales_String)
   Total_Sale_Len=Len(StrText)-cint(Total_Sales_Pos)

        Cus_Count_Num=Cint(Trim(Mid(strText,Cint(Cus_Count_Pos),Cus_Count_Len)))
   reporter.ReportEvent micPass,"顾客总数数值","顾客总数数值是:"&Cus_Count_Num
   Total_Tickets_Num=Cint(trim(Mid(strText,Cint(Total_Tickets_Pos),Total_Tickets_Len)))
   reporter.ReportEvent micPass,"订票总数数值","订票总数数值是:"&Total_Tickets_Num
   Total_Sales_Num=Trim(Mid(strText,Cint(Total_Sales_Pos),Total_Sales_Len))
   reporter.ReportEvent micPass,"订票总价钱数值","订票总价钱数值是:"&Total_Sales_Num
        window("记事本").Close
else
   reporter.ReportEvent micFail,"报告","报告未被打开"
End If
在第55行
无效的过程调用或参数: 'Mid'
Line (55): "Cus_Count_Num=Cint(Trim(Mid(strText,Cint(Cus_Count_Pos),Cus_Count_Len)))".
第57行
类型不匹配: 'cint'
Line (57): "Total_Tickets_Num=Cint(trim(Mid(strText,Cint(Total_Tickets_Pos),Total_Tickets_Len)))".
请大家帮忙看看这是什么原因导致的呢?
作者: FighterLqs    时间: 2013-11-4 14:35
路过,占个沙发!!
作者: wuminru_01    时间: 2014-1-17 16:36
请问大家有什么方法解决这个问题吗?




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2