appium / appium/java-client

pushFile runs without error but file is not seen in the device

Open
#1,341 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.3k
Forks
752
Avg merge
6d 21h
Merged PRs (30d)
8

Description

Description

pushFile runs without error but file is not seen in the device

Environment

  • Java client build version or git revision if you use some snapshot: 7.0.0
  • Appium server version or git revision if you use some snapshot:1.4.13.0
  • Desktop OS/version used to run Appium if necessary:windows 10
  • Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe:v8.12.0
  • Mobile platform/version under test: Android 6.0.1
  • Real device or emulator/simulator: Real device - Panansonic Touchpad

Details

I have written below code:

AppiumDriver driver;

driver = new AndroidDriver(new URL(
"http://127.0.0.1:4723/wd/hub"), caps);
try {
AndroidDriver driver1 = (AndroidDriver) driver;
// given by amit
File fi = new File("./LocationServiceTestMode/3-MOTION START.TXT");
byte[] fileContent = Files.readAllBytes(fi.toPath());
driver1.pushFile("sdcard/LocationServiceTest/3-MOTION START.TXT",fileContent);
} catch (Exception e) {
System.out.println(e.getMessage());
}

Code To Reproduce Issue [ Good To Have ]

Given code above.

Exception Stacktraces

NA

Link To Appium Logs

NA

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the AndroidDriver pushFile call shown in the issue and reproduce it using the provided Java code on Android 6.0.1. Check the Appium server behavior and device filesystem to determine why no error is reported while the file is not visible; done means the pushed file is present at the requested device path or the failure is reported clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile-dev, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.