|
#30发的SPY图片上显示 Tax date是WebEdit 类型,但我用
Browser("Service Management System").Page("Service Management System_2").Frame("mainFrame_2").WebEdit("Tax date").Object.Value = "18 Jan 2007" 运行时还是报错: The "Tax Date" object was not found in the Object Repository.
另外我需要显示的日期格式是 18 Jan 2007, 下面是我参照您#20的代码改写的,我还不会写代码,请帮我检查一下哪里有错好吗?非常感谢您的指教!
Dim CurrentDate
CurrentDate = FormatDateTime(Date, 2)
' GetCurrentDate = 2006-1-4
Dim ExpectedDate
'ExpectedDate = Mid( GetCurrentDate,3)
' ExpectedDate = 4 Jan 2006
Select Case Len(CurrentDate)
' CurrentDate = 2006-1-5(for instance) ' ExpectedDate = 5 Jan 2006(for instance)
Case 8
ExpectedDate = Cstr( Right(CurrentDate,1)) & "" & Cstr( Mid(CurrentDate,6,1)) & "" & Cstr( Mid(CurrentDate,3,2))
Case 9
Rem <<<<<<<<<<<Varchar(Mid(CurrentDate,6,2)) is the statement of the month of the date
' CurrentDate = 2006-10-5(for instance) ' ExpectedDate = 5 Oct (for instance)
If Varchar(Mid(CurrentDate,6,2)) Then
ExpectedDate = Cstr( Right(CurrentDate,1)) & "" & Cstr( Mid(CurrentDate,6,2)) & "" & Cstr( Mid(CurrentDate,3,2))
' CurrentDate = 2006-1-25(for instance) ' ExpectedDate = 25 Jan 2006 (for instance)
Else ExpectedDate = Cstr( Right(CurrentDate,2)) & "" & Cstr( Mid(CurrentDate,6,1)) & "" & Cstr( Mid(CurrentDate,3,2))
End If
Case 10
'CurrentDate = 2006-10-15(for instance) ' ExpectedDate = 15 Oct 2006 (for instance)
ExpectedDate = Cstr( Right(CurrentDate,2)) & "" & Cstr( Mid(CurrentDate,6,2)) & "" & Cstr( Mid(CurrentDate,3,2))
End Select
' Msgbox(Cstr(ExpectedDate))
Dim checkedDate
checkedDate = Cstr(ExpectedDate) |
|