我正在尝试在Robot Framework中上传此文件

时间:2019-07-17 12:58:14

标签: python selenium robotframework

我必须使用机器人框架在网站上上传文件 这是我的代码

*** Settings ***

Library         SeleniumLibrary

*** Variable ***
${file_path}        /home/pratyushpatwa/Downloads/XXXXX.pdf

*** Keywords ***
Open Browser And Convert

        Open Browser    https://smallpdf.com/pdf-to-excel       chrome
        Maximize Browser Window
        wait until element is visible      //*[@id="app"]/div/div[1]/div[4]/div/div/div/div[2]/form/label/div/div[3]
        click element       //*[@id="app"]/div/div[1]/div[4]/div/div/div/div[2]/form/label/div/div[3]
        sleep       2
        Choose File         //*[@id="app"]/div/div[1]/div[4]/div/div/div/div[2]/form/label/div/div[3]       ${filepath}
        sleep       5
        Click Element       //*[@id="app"]/div/div[1]/div[4]/div/div[1]/div/div/div[2]/div[1]/a

        Close Browser

这是我遇到的错误:

ElementNotInteractableException: Message: element not interactable
  (Session info: chrome=75.0.3770.100)
  (Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Linux 4.18.0-25-generic x86_64)
------------------------------------------------------------------------------
Test                                                                  | FAIL |
1 critical test, 0 passed, 1 failed
1 test total, 0 passed, 1 failed
==============================================================================

0 个答案:

没有答案