TA的每日心情 | 衰 2015-11-23 12:13 |
---|
签到天数: 1 天 连续签到: 1 天 [LV.1]测试小兵
|
写了一下的scripts,但是在Mac和Unbntu上运行时,还是走得 if fso.FileExists("C:\Button.bmp") then 这个分支, 大侠帮看看:
Dim fso, windowsDirName, linuxDirName
windowsDirName = "C:"
linuxDirName = "/tmp"
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FolderExists(windowsDirName)) Then
if fso.FileExists("C:\Button.bmp") then
Set file = fso.GetFile("C:\Button.bmp")
file.Delete
End If
Browser("index").Page("Buttons").WebButton("Push me!").CaptureBitmap "C:\Button.bmp"
if fso.FileExists("C:\Button.bmp") then
Set file = fso.GetFile("C:\Button.bmp")
file.Delete
Reporter.ReportEvent micPass, "Button.CaptureBitmap", "The method passed"
else
Reporter.ReportEvent micFail, "Button.CaptureBitmap", "The method failed"
end if
ElseIf (fso.FolderExists(linuxDirName)) Then
Browser("index").Page("Buttons").WebButton("Push me!").CaptureBitmap "/tmp/Button.bmp"
if fso.FileExists("/tmp/Button.bmp") then
Set file = fso.GetFile("/tmp/Button.bmp")
file.Delete
Reporter.ReportEvent micPass, "Button.CaptureBitmap", "The method passed"
else
Reporter.ReportEvent micFail, "Button.CaptureBitmap", "The method failed"
end if
else
Browser("index").Page("Buttons").WebButton("Push me!").CaptureBitmap "/usr/Button.bmp"
if fso.FileExists("/usr/Button.bmp") then
Set file = fso.GetFile("/usr/Button.bmp")
file.Delete
Reporter.ReportEvent micPass, "Button.CaptureBitmap", "The method passed"
else
Reporter.ReportEvent micFail, "Button.CaptureBitmap", "The method failed"
end if
End If
谢谢
|
|