Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermittently seeing DeviceAgent is not running error while executing tests #665

Open
skhand001 opened this issue Jan 19, 2018 · 5 comments

Comments

@skhand001
Copy link

Some times while executing tests, when we are querying using device_agent.query or device_agent.touch or device_agent.keyboard_visible?, it throws error The DeviceAgent is not running. These are the elements safari web view hence, unable to query or touch using the core methods.
Our understanding is that when a scenario is running, ideally the device_agent should always be running.

Xcode - 9.2
iOS 11
run_loop - 2.6.2, 2.6.3
calabash - 0.21.1

@jmoody
Copy link
Member

jmoody commented Jan 22, 2018

Please update to most recent Calabash and run-loop.

Our understanding is that when a scenario is running, ideally the device_agent should always be running.

This probably means that DeviceAgent has crashed. Please look at your devices for crash reports or your simulator logs.

If possible, please provide an app with steps to reproduce.

@skhand001
Copy link
Author

@jmoody We tried with latest run-loop, issue is still there. However, i don't have any specific steps to reproduce, it just happens randomly at places where we are querying/touching using device agent methods.

Attaching logs for one such failed scenario. Application under test, was still running in foreground. But, script threw the error The Device Agent is not running

Page on which we are querying the elements is a safari web view.

Session-Unnamed-Test-Run-2018-01-25_095800-FLtWOY.log
StandardOutputAndStandardError.txt

Also, i didn't see any crash logs for either device agent or the app we are testing, could you please point out where i should be looking for those logs. I looked at ./Library/Logs/CrashReporter/MobileDevice

@jmoody
Copy link
Member

jmoody commented Jan 26, 2018

Crash reports are found in Xcode > Window > Devices and Simulator > right click on the device to view logs => those are the crash reports.

@jmoody
Copy link
Member

jmoody commented Jan 26, 2018

I am probably going to need your app + steps to reproduce to debug this issue.

@skhand001
Copy link
Author

@jmoody I did some further debugging for the issue and ran some tests.
Commented the code in core.rb where is checks if automator is running.

   if !automator.running?
        raise RuntimeError, %Q[The DeviceAgent is not running.]
    else

After commenting this i didn't see the issue, ran on a bunch of devices & multiple number of times. I think the device agent was running fine, but for some reason the code above was returning false which is causing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants