如何用scripts获取Mac和Ubntu的路径
写了一下的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
谢谢
:) {:4_89:} 条件为真 :lol :o 判断条件为真 :) 不了解 学习
页:
[1]