-
Notifications
You must be signed in to change notification settings - Fork 572
Closed
Description
The problem
is there any way that pushing a zip file to my Android device? When using push_file() I found that it can push file such as text, but except zip file. I use python to write my scripts.
Environment
- Appium version (or git revision) that exhibits the issue: 1.9.0
- Desktop OS/version used to run Appium: Ubuntu 18.04
- Node.js version (unless using Appium.app|exe): v8.12.0
- Mobile platform/version under test: Android 5.0
This is my code:
try:
driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
except Exception as e:
print(("WebDriverException Error : ", e))
with open('E:\\myupdate_318.zip', 'rb') as zip_file:
data = zip_file.read()
driver.push_file('/storage/sdcard1/myupdate.zip', data.encode('base64'))
zip_file.close()
This is server log:
Traceback (most recent call last): File "/home/user/Project/Appium/AutoInstallSoftWare/AutoInstallSoftWare.py", line 30, in test_unintall_old_package self.driver.push_file('/storage/sdcard1/myupdate.zip', data.encode('base64')) AttributeError: 'bytes' object has no attribute 'encode'
What should I do?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels