标题: 如何用scripts获取Mac和Ubntu的路径 [打印本页] 作者: mulan_zhi 时间: 2018-9-10 10:56 标题: 如何用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 EndIf
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" endif 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" endif 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" endif EndIf