如何使用python语言通过appiumwebdriver在saucelabs虚拟机的iOS和Android模拟器中上传图像

2024-10-04 05:31:26 发布

您现在位置:Python中文网/ 问答频道 /正文

在这里,我试图上传一个图像到sauce实验室的虚拟机(iOS和Android)。你知道吗

我试过了`元素。发送密钥(本地机器映像的路径),但未上载映像。你知道吗

photo_url=str(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))))

photo_url = os.path.join(photo_url, "car.png")


def enter_fileUploadCntl_with(self, photo_url, wait):
    self._wait_and_complete_type(self._fileUploadCntl, photo_url, wait)

def _wait_and_complete_type(self, locator, input_text, wait_before_type):
    time.sleep(wait_before_type)
    self._type(locator, input_text)

def _type(self, locator, input_text):
   self._find(locator).send_keys(input_text)

def _find(self, locator):
    return self.driver.find_element(locator['by'], locator['value'])

有谁能告诉我用python上传saucelabs appiumweb驱动程序中运行测试用例的另一种方法吗?你知道吗


Tags: andpathtextselfurlinputosdef