screenshotWaitTimeout not accepted as a capability?

Running Appium 1.3.4 with Python bindings and still receiving

Exception: Message: u"An unknown server-side error occurred while processing the command. (Original error: Timed out waiting for screenshot file. Error: ENOENT, open '/tmp/appium-instruments/Run 1/screenshot0c322ad9-4ea9-4ac2-b797-82185a8d3158.png')" 

I’m setting the following capabilities in the setUpClass methods:

def setUpClass(cls):

        cls.driver = webdriver.Remote(
            command_executor='http://127.0.0.1:4723/wd/hub',
            desired_capabilities={
                'app': os.environ.get('APPIUM_APP_PATH'),
                'platformName': 'iOS',
                'platformVersion': '7.1',
                'deviceName': '=iPad - Simulator - iOS 7.1',
                'showIOSLog': True,
                'processArguments': 'appium',
                'fullReset': True,
                'screenshotWaitTimeout': 20
            })

I see the following in the server log too:

info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : processArguments, screenshotWaitTimeout

Is anyone else still seeing issues with screenshotWaitTimeout caps?

I’m running in a CI environment with TeamCity.

This capability is in fact accepted server side. Proved by increasing the timeout to 60s will cause Instruments/Appium to exit and tests fail vs raising a TimeoutException

However, it looks like Appium will still timeout no matter the timeout setting - fails waiting for a screenshot from instruments. I constantly obtain the following:

WebDriverException: Message: u"An unknown server-side error occurred while processing the command. (Original error: Timed out waiting for screenshot file. Error: ENOENT, open '/tmp/appium-instruments/Run 1/screenshot16f05970-59a9-4fdd-bed8-4d75a5477d5f.png')" 

Are there any work arounds to this? I’m running the following configuration:

Native iOS app
XCode 5.1
Python
iPad Simulator - iOS 7.1

I’m too finding this issue, and one thing I have observed, this exact moment the inspector doesn’t shows the GUI though the page source exists.
and this issue wasn’t there in previous releases

appium 1.3.4
Xcode6.1
Java
iPhone 6- 8.1 simulator
native ios App

org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. (Original error: Timed out waiting for screenshot file. Error: ENOENT, open ‘/tmp/appium-instruments/Run 1/screenshot5d59025a-9a79-433f-bcb9-21bef14c3b6e.png’) (WARNING: The server did not provide any stacktrace information)

We are also experiencing this issue. I downloaded the hopeful fix for this based on a past issue (3130) from Appium 1.3.5 Beta version. The commit adds 3 retry’s to open the screenshot file. This still did not fix my issue. I even increased the retry’s to 5 and added a lot of wait time in between screenshots; however, I am still seeing this error:


WARN: Taking snapshot failed.  Selenium::WebDriver::Error::UnknownError: An unknown server-side error occurred while processing the command. (Original error: Timed out waiting for screenshot file. Error: ENOENT, open '/tmp/appium-instruments/Run 1/screenshot79b70972-9943-4850-b73e-ad44eff65b61.png')

What’s interesting is that all of the screenshots exist in the tmp/appium-instruments/Run 1/ file. In fact with the retry’s I am seeing 3 - 5 copies of the same screenshot, so I do not understand how it is getting this error.

Here is the Appium log:


info: [debug] Pushing command to appium work queue: "au.capture('screenshot79b70972-9943-4850-b73e-ad44eff65b61')"
info: [debug] Sending command to instruments: au.capture('screenshot79b70972-9943-4850-b73e-ad44eff65b61')
info: [debug] Socket data received (25 bytes)
info: [debug] Socket data being routed.
info: [debug] Got result from instruments: {"status":0,"value":""}
...
... 
info: [debug] Responding to client with error: {"status":13,"value":{"message":"An unknown server-side error occurred while processing the command. (Original error: Timed out waiting for screenshot file. Error: ENOENT, open '/tmp/appium-instruments/Run 1/screenshot79b70972-9943-4850-b73e-ad44eff65b61.png')","origValue":"Timed out waiting for screenshot file. Error: ENOENT, open '/tmp/appium-instruments/Run 1/screenshot79b70972-9943-4850-b73e-ad44eff65b61.png'"},"sessionId":"dd987f00-b08a-47d0-98ee-2cd2e657ebc3"}
info: <-- GET /wd/hub/session/dd987f00-b08a-47d0-98ee-2cd2e657ebc3/screenshot 500 63217.071 ms - 470 
info: --> GET /wd/hub/session/dd987f00-b08a-47d0-98ee-2cd2e657ebc3/screenshot {}

Setup:
appium 1.3.4 (with commit referenced above)
Xcode 6.1
iOS 8.1 (iPhone and iPad simulators)
MAC OS X 10.9.5
ruby 2.1.1p76

Hi @SuzanneM

I am also facing the same issues and I tried below code

File scrFile = ((TakesScreenshot) driver)
.getScreenshotAs(OutputType.FILE);
try {
System.out
.println("-----------------SCREENSHOT EXCEPTION-----------");
FileUtils.copyFile(scrFile, new File(
“FilePath\hello.png”));
} catch (IOException e) {
e.printStackTrace();
}

I can see that if Appium fails to take screenshot then above code is able to take screenshot. However screenshot is taken successfully then also exception “Time out waiting for screenshot file” is coming.

I don’t know how to ignore this exception. Is there any idea anyone?

Thanks
Chirag

@SuzanneM: Is the file name unchanged as well? I assume the files in the folder match those filenames that are in the logs?

I’ve never been able to investigate if the screenshot has made it into the tmp folder because I’ve not seen this issue locally. I only see it when running on our TeamCity agents (which I dont have access to for file browsing).

If this is the case - It seems like there should be a bug filed on GitHub - if there isn’t already one there?

@SquareTheBase : Yes, the file name is the same for the debug logs and what is in the tmp folder. However, my code renames the file for the Images directory, and that screenshot with the new name is not being ported over to the Images directory. Instead, I get the error message and that step fails in my test plan, even though I may have valid png screenshot files (sometimes 3 copies of the same thing) in the tmp folder with the Appium provided name, “screenshot.png”

I logged an issue in GitHub: https://github.com/appium/appium/issues/4539

1 Like

Here’s the latest update. Try turning up your Appium log level to ‘warn’ or ‘error’, i.e., --log-level error
This fixed all of my screenshot issues. I also noted this on the GitHub issue logged above.

1 Like

I have the same issue when taking many screenshots with default level, looks like this bug is going to be fixed in appium 1.5, thanks for this solution, help a lot