小编Wer*_*Kop的帖子

Robotframework“选择文件”导致 AttributeError: module 'base64' has no attribute 'encodestring' in docker

我正在尝试在 docker 容器中运行测试,该容器在本地运行没有问题:我想从“正确”目录上传正确的.csv 文件

*** Keyword ***
Upload file
    [Arguments]    ${directory}    ${file}
    Choose File    ${choose_file_input}    ${EXECDIR}/Files/${directory}/${file}

** Test case ***
Upload
    Upload file    correct    correct.csv
Run Code Online (Sandbox Code Playgroud)

但是,当在 docker 中运行测试时,我收到 AttributeError: module 'base64' has no attribute 'encodestring' 的失败。是因为docker中没有GUI吗?或者需要修复编码?或者最终也许还有另一种解决方案可以用来上传文件?

15:20:01.250    INFO    Sending /App/Files/correct/correct.csv to browser.  
15:20:01.251    DEBUG   POST http://192.168.1.29:4444/wd/hub/session/4b6d453b394adaaa51bb4149e9ba8678/elements {"using": "xpath", "value": "//div[@id=\"upload\"]//input"}  
15:20:01.252    DEBUG   Starting new HTTP connection (1): 192.168.1.29:4444 
15:20:01.305    DEBUG   http://192.168.1.29:4444 "POST /wd/hub/session/4b6d453b394adaaa51bb4149e9ba8678/elements HTTP/1.1" 200 90   
15:20:01.305    DEBUG   Finished Request    
15:20:01.618    FAIL    AttributeError: module 'base64' has no attribute 'encodestring' 
15:20:01.619 …
Run Code Online (Sandbox Code Playgroud)

python upload base64 robotframework docker

3
推荐指数
1
解决办法
6796
查看次数

标签 统计

base64 ×1

docker ×1

python ×1

robotframework ×1

upload ×1