TestProject 使用汇总

1. 截图

from addons.screenshot_utils import ScreenshotUtils
step_output = driver.addons().execute(
    ScreenshotUtils.takescreenshotweb(
        filePath="/Users/xxx/Downloads/images/screenshot",
        fileName="login_after01_tp",
        fileFormat="jpg"))

takescreenshotweb.py代码如下:
class TakeScreenshotWeb(ActionProxy):
    def __init__(self, filePath: str, fileName: str, fileFormat: str):
        super().__init__()
        self.proxydescriptor = ProxyDescriptor(
            guid="CHwK6NhvLUy-VJsv2atfcQ",
            classname="io.testproject.Addon.Actions.Web.TakeScreenshotWeb"
        )
        self.filePath = filePath
        self.fileName = fileName
        self.fileFormat = fileFormat
        self.resultPath = None

  

  

posted @ 2022-07-28 18:01  jiguanghover  阅读(535)  评论(0编辑  收藏  举报