How to suppress debug message on functional test with simple-phpunit - functional-testing

I'm just getting started with Symfony 4 and have this problem.
Is it normal to have debugged message printed on a console like this when running the functional test?
$ vendor/bin/simple-phpunit
PHPUnit 5.7.27 by Sebastian Bergmann and contributors.
Testing Functional Controller
2018-03-20T18:51:20+07:00 [debug] Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure".
2018-03-20T18:51:20+07:00 [debug] Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ValidateRequestListener::onKernelRequest".
2018-03-20T18:51:20+07:00 [debug] Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\TestSessionListener::onKernelRequest".
2018-03-20T18:51:20+07:00 [debug] Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\SessionListener::onKernelRequest".
2018-03-20T18:51:20+07:00 [debug] Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelRequest".
2018-03-20T18:51:20+07:00 [debug] Listener "Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelRequest" stopped propagation of the event "kernel.request".
2018-03-20T18:51:20+07:00 [debug] Listener "Symfony\Bundle\FrameworkBundle\EventListener\ResolveControllerNameSubscriber::onKernelRequest" was not called for event "kernel.request".
2018-03-20T18:51:20+07:00 [debug] Listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelRequest" was not called for event "kernel.request".
2018-03-20T18:51:20+07:00 [debug] Notified event "kernel.response" to listener "Symfony\Component\HttpKernel\EventListener\ResponseListener::onKernelResponse".
2018-03-20T18:51:20+07:00 [debug] Notified event "kernel.response" to listener "Symfony\Bundle\FrameworkBundle\DataCollector\RequestDataCollector::onKernelResponse".
2018-03-20T18:51:20+07:00 [debug] Notified event "kernel.response" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelResponse".
2018-03-20T18:51:20+07:00 [debug] Notified event "kernel.response" to listener "Symfony\Component\HttpKernel\EventListener\TestSessionListener::onKernelResponse".
2018-03-20T18:51:20+07:00 [debug] Notified event "kernel.response" to listener "Symfony\Component\HttpKernel\EventListener\SessionListener::onKernelResponse".
2018-03-20T18:51:20+07:00 [debug] Notified event "kernel.response" to listener "Symfony\Component\HttpKernel\EventListener\SaveSessionListener::onKernelResponse".
2018-03-20T18:51:20+07:00 [debug] Notified event "kernel.response" to listener "Symfony\Component\HttpKernel\EventListener\StreamedResponseListener::onKernelResponse".
2018-03-20T18:51:20+07:00 [debug] Notified event "kernel.finish_request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelFinishRequest".
2018-03-20T18:51:20+07:00 [debug] Notified event "kernel.finish_request" to listener "Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelFinishRequest".
2018-03-20T18:51:20+07:00 [debug] Notified event "kernel.terminate" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelTerminate".
F 1 / 1 (100%)
Time: 136 ms, Memory: 10.00MB
There was 1 failure:
1) App\Tests\Controller\HomeControllerTest::testHomepage
Failed asserting that 404 matches expected 200.
FAILURES!
Tests: 1, Assertions: 1, Failures: 1.
Can it be disabled/suppressed? It seems this message doesn't appear on unit testing.
Edit
by adding environment variable into phpunit.xml I got it suppressed but now it's showing uncaught exception when testing undefined route.
<phpunit>
...
<php>
<env name="APP_DEBUG" value="false" />
</php>
...
</phpunit>
Log
$ vendor/bin/simple-phpunit
PHPUnit 5.7.27 by Sebastian Bergmann and contributors.
Testing
.2018-03-21T11:22:50+07:00 [error] Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /"" at vendor/symfony/http-kernel/EventListener/RouterListener.php line 144
F.
Time: 124 ms, Memory: 8.00MB
There was 1 failure:
1) App\Tests\Controller\HomeControllerTest::testHomepage
Failed asserting that 404 matches expected 200.
...
Is it possible to hide this error message?
Update
It seems this problem occur when I delete vendor and bin directory in the root project. Trying to re-install all dependencies with composer install doesn't fix this problem, so I decide to re-create the project from start. This is the steps that I do :
create new symfony project with composer create-project symfony/skeleton my-project-name
adding other dependecies such as twig, maker, annotation etc with composer command. I'm not editing composer.json directly until all dependecies is installed and there's no problem with functional testing.
copy .git directory from previous project into new 're-created' project to import git history.
I'm letting composer (symfony recipe) to resolve all configuration, overwrite my previous config.
resolve other conflict before commiting
I'm letting this qustion open in case there's someone figure it out what's actually happen and how to resolve it without re-creating the project.

has the same issue and it was fixed with:
<env name="APP_ENV" value="test" />
in phpunit.xml file

Related

Akka.net Context.System.EventStream in aws lambda

I'm working on a solution hosting asp.net core application in AWS lambda. This allows each team member to own an environment during development only. It will run in docker for integration and go live. Corporate knowledge means it has to run this way. It's a small actor system that must run one job at a time sequentially.
The issue is when local, all works fine, but when hosted in AWS lambda, the process which begins with a number of specific actorRef.Tell() calls, work until the first call to: Context.System.EventStream.Publish(). There's no warning or failure, it just stops until the lambda times out. It seems like Context.System.EventStream.Subscribe(Self, typeof(SomeEvent)); just doesn't work
I have included copious logging, so I see exactly where it stops. I've also enabled all the akka.net logging:
"debug": {
"autoreceive": "on",
"eventStream": "on",
"lifecycle": "on",
"receive": "on",
"unhandled": "on"
}
Is there something inherent in how Context.System.EventStream.Publish() that's different from actorRef.Tell() affected by hosting environment?
What about aws lambda environment would cause this behaviour?
Is there a way to configure akka.net to address any constraints in aws lambda?
Has anyone encountered problems of this sort?
EDIT
Any aspect of akka.net that relies on EventStream doesn't work. Even logging using the Context.GetLogger. The actors only started logging when I changed from the Context based logger to the injected ILogger<T>.
_logger.Info("Message {#msg} validated successfully, processing", e.MsgId); // this is shown in the logs also
Context.System.EventStream.Publish(new ProcessHl7MessageCommand(e.Body));
Below is the lifecycle of the lambda calls, from 13:09:07 to 13:09:12 everything is gravy, and then published event goes nowhere:
2021-03-08T13:09:07.017+00:00 START RequestId: a57732ba-4d37-46c1-b184-6f4c4b3dc438 Version: $LATEST
2021-03-08T13:09:07.019+00:00 13:09:06.996 [WARN] Microsoft.AspNetCore.DataProtection.Repositories.EphemeralXmlRepository - Using an in-memory repository. Keys will not be persisted to storage.
2021-03-08T13:09:07.155+00:00 13:09:07.000 [WARN] Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager - Neither user profile nor HKLM registry available. Using an ephemeral key repository. Protected data will be unavailable when application exits.
2021-03-08T13:09:07.182+00:00 13:09:07.152 [WARN] Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager - No XML encryptor configured. Key {d261dd3f-bbc7-4ad4-a0a5-20cac3e43970} may be persisted to storage in unencrypted form.
2021-03-08T13:09:07.182+00:00 Akka config journal: akka.persistence.journal.sqlServer
2021-03-08T13:09:07.457+00:00 Akka config SnapshotStore: akka.persistence.snapshot-store.sqlServer
2021-03-08T13:09:07.457+00:00 [DEBUG][3/8/2021 1:09:07 PM][Thread 0001][EventStream] subscribing [akka://all-systems/] to channel Akka.Event.Debug
2021-03-08T13:09:07.457+00:00 [DEBUG][3/8/2021 1:09:07 PM][Thread 0001][EventStream] subscribing [akka://all-systems/] to channel Akka.Event.Info
2021-03-08T13:09:07.458+00:00 [DEBUG][3/8/2021 1:09:07 PM][Thread 0001][EventStream] subscribing [akka://all-systems/] to channel Akka.Event.Warning
2021-03-08T13:09:07.458+00:00 [DEBUG][3/8/2021 1:09:07 PM][Thread 0001][EventStream] subscribing [akka://all-systems/] to channel Akka.Event.Error
2021-03-08T13:09:07.538+00:00 [DEBUG][3/8/2021 1:09:07 PM][Thread 0001][EventStream] StandardOutLogger started
2021-03-08T13:09:07.555+00:00 [DEBUG][3/8/2021 1:09:07 PM][Thread 0012][akka://P80System/system] Started (Akka.Actor.SystemGuardianActor)
2021-03-08T13:09:07.555+00:00 [DEBUG][3/8/2021 1:09:07 PM][Thread 0001][EventStream] subscribing [akka://P80System/system/UnhandledMessageForwarder#274328165] to channel Akka.Event.UnhandledMessage
2021-03-08T13:09:07.555+00:00 [DEBUG][3/8/2021 1:09:07 PM][Thread 0001][EventStream(P80System)] StandardOutLogger being removed
2021-03-08T13:09:07.555+00:00 [DEBUG][3/8/2021 1:09:07 PM][Thread 0001][EventStream] unsubscribing [akka://all-systems/] from all channels
2021-03-08T13:09:07.555+00:00 [DEBUG][3/8/2021 1:09:07 PM][Thread 0014][akka://P80System/] Started (Akka.Actor.GuardianActor)
2021-03-08T13:09:12.616+00:00 END RequestId: a57732ba-4d37-46c1-b184-6f4c4b3dc438
2021-03-08T13:09:12.616+00:00 REPORT RequestId: a57732ba-4d37-46c1-b184-6f4c4b3dc438 Duration: 4995.25 ms Billed Duration: 4996 ms Memory Size: 1024 MB Max Memory Used: 249 MB Init Duration: 2362.63 ms
********
2021-03-08T13:10:03.196+00:00 START RequestId: 76e19c6d-3265-4ef0-abfe-82bf68f01bf4 Version: $LATEST
2021-03-08T13:10:03.216+00:00 13:10:03.216 [INFO] P80.Api.Controllers.MessagesController - Received 8142
2021-03-08T13:10:03.277+00:00 13:10:03.277 [INFO] P80.Ordering.Hl7MessageManagerActor - Initializing P80.Models.Messages.Commands.StartProcessingCommand
2021-03-08T13:10:03.278+00:00 13:10:03.278 [INFO] P80.Ordering.MessageLoaderActor - Loading Message 8142
2021-03-08T13:10:03.278+00:00 13:10:03.278 [INFO] P80.Ordering.MessageLoaderActor - Loading 8142
2021-03-08T13:10:03.741+00:00 13:10:03.740 [INFO] P80.Data.Context.MessageResourceAccess - Message loaded: { MsgId = 8142, CustomerName = A PHARMACY IN JURIEN BAY }
2021-03-08T13:10:03.798+00:00 13:10:03.798 [INFO] P80.Ordering.MessageLoaderActor - Message loaded: 8142
2021-03-08T13:10:03.860+00:00 13:10:03.859 [INFO] P80.Ordering.Hl7MessageManagerActor - Message 8142 validated successfully, processing
******* Here's where the first call to EventStream.Publish() occurs and nothing happens again until the lambda closes.
2021-03-08T13:10:30.258+00:00 13:10:30.257 [INFO] P80.Api.Controllers.MessagesController - Message 8142 still processing after 00:00:27...
2021-03-08T13:10:30.262+00:00 END RequestId: 76e19c6d-3265-4ef0-abfe-82bf68f01bf4
2021-03-08T13:10:30.262+00:00 REPORT RequestId: 76e19c6d-3265-4ef0-abfe-82bf68f01bf4 Duration: 27063.17 ms Billed Duration: 27064 ms Memory Size: 1024 MB Max Memory Used: 285 MB

Pact provider doesn't send verification to Pact Broker

I am new in Pact (consumer-driven testing) and gradle, I used this famous workshop to try Pact with Java and Pact Brocker https://github.com/Mikuu/Pact-JVM-Example, but never works the final part when provider sends the verification to the Pact Broker. It works manually via REST API, but using the project never sends the verifications. Please help to understand what happens (probably something is missing, some library or annotation?)
I attach the debug log when producer tries to send the verification to the Pact Broker (local Broker in docker using gradle with ./gradlew :example-provider:pactVerify). I guess that the body of POST request is missing.
14:22:59.469 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Opening connection {}->http://localhost:80
14:22:59.469 [DEBUG] [org.apache.http.impl.conn.DefaultHttpClientConnectionOperator] Connecting to localhost/127.0.0.1:80
14:22:59.470 [DEBUG] [org.apache.http.impl.conn.DefaultHttpClientConnectionOperator] Connection established 127.0.0.1:55770<->127.0.0.1:80
14:22:59.470 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Executing request POST /pacts/provider/ExampleProvider/consumer/JunitRuleMultipleInteractionsConsumer/pact-version/e66d465478e1934bca0ad9b905a2f83835af481d/verification-results HTTP/1.1
14:22:59.470 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Target auth state: UNCHALLENGED
14:22:59.470 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Proxy auth state: UNCHALLENGED
14:22:59.492 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Connection can be kept alive indefinitely
14:22:59.493 [DEBUG] [org.apache.http.impl.conn.DefaultManagedHttpClientConnection] http-outgoing-255: Close connection
14:22:59.493 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Connection discarded
14:22:59.493 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection released: [id: 255][route: {}->http://localhost:80][total kept alive: 0; route allocated: 0 of 5; total allocated: 0 of 10]
14:22:59.493 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Completing Build operation 'Execute verifyPact for :example-provider:pactVerify_ExampleProvider'
14:22:59.493 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter] Removed task artifact state for {} from context.
14:22:59.493 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':example-provider:pactVerify_ExampleProvider'
14:22:59.493 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Completing Build operation 'Task :example-provider:pactVerify_ExampleProvider'
14:22:59.493 [null] [org.gradle.internal.progress.DefaultBuildOperationExecutor]
14:22:59.493 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Build operation 'Task :example-provider:pactVerify_ExampleProvider' completed
14:22:59.493 [INFO] [org.gradle.execution.taskgraph.DefaultTaskPlanExecutor] :example-provider:pactVerify_ExampleProvider (Thread[Task worker for ':',5,main]) completed. Took 0.96 secs.
The pact example seems to be missing one important step: Adding the #PactBroker annotation
Below the #Pact annotation, there should be an annotation
#PactBroker(port = PORT_NUM , host = HOST_NAME)
You can find an example here at the official repo

Chrome closes itself just after it loads for mobile web automation

Chrome browser opens and automatically closes while mobile web automation.
The code doesn't proceeds any further. I'm using real device and appium version 1.6 and chrome version 54.
Desired Capabilities :
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.BROWSER_NAME, "chrome");
capabilities.setCapability("deviceName", "Testing device");
capabilities.setCapability("platformVersion", "5.0");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 7200);
Driver Initialisation :
AndroidDriver<AndroidElement> aDriver = new AndroidDriver<AndroidElement>(new URL(
"http://127.0.0.1:4723/wd/hub"), setCapabilities());
System.out.println(aDriver.getSessionId());
aDriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
aDriver.get("https://www.google.com");
Appium log :
[debug] [UiAutomator] Moving to state 'online'
[AndroidBootstrap] Android bootstrap socket is now connected
[AndroidDriver] Starting a chrome-based browser session
[debug] [Chromedriver] Changed state to 'starting'
[Chromedriver] Set chromedriver binary as: /usr/local/lib/node_modules/appium/node_modules/appium-android-driver/node_modules/appium-chromedriver/chromedriver/mac/chromedriver
[Chromedriver] Killing any old chromedrivers, running: pkill -15 -f "/usr/local/lib/node_modules/appium/node_modules/appium-android-driver/node_modules/appium-chromedriver/chromedriver/mac/chromedriver.*--port=9515"
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] json loading complete.
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Registered crash watchers.
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Client connected
[Chromedriver] No old chromedrivers seemed to exist
[Chromedriver] Spawning chromedriver with: /usr/local/lib/node_modules/appium/node_modules/appium-android-driver/node_modules/appium-chromedriver/chromedriver/mac/chromedriver --url-base=wd/hub --port=9515 --adb-port=5037
[Chromedriver] [STDOUT] Starting ChromeDriver 2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4) on port 9515
Only local connections are allowed.
[JSONWP Proxy] Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
[Chromedriver] [STDERR] [warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
[JSONWP Proxy] Got response with status 200: "{\"sessionId\":\"\",\"stat...
[JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {"desiredCapabilities":{"ch...
[JSONWP Proxy] Got response with status 200: {"sessionId":"e1cc8c5acefcf...
[debug] [Chromedriver] Changed state to 'online'
[Appium] New AndroidDriver session created successfully, session 4cd47498-3a35-495e-8cdd-1fd02e69427c added to master session list
[MJSONWP] Responding to client with driver.createSession() result: {"platform":"LINUX","webSto...
[HTTP] <-- POST /wd/hub/session 200 21605 ms - 875
[HTTP] --> POST /wd/hub/session/4cd47498-3a35-495e-8cdd-1fd02e69427c/timeouts {"type":"implicit","ms":10000}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[JSONWP Proxy] Proxying [POST /wd/hub/session/4cd47498-3a35-495e-8cdd-1fd02e69427c/timeouts] to [POST http://127.0.0.1:9515/wd/hub/session/e1cc8c5acefcf0ef250abfcf6b59b61d/timeouts] with body: {"type":"implicit","ms":10000}
[JSONWP Proxy] Got response with status 200: {"sessionId":"e1cc8c5acefcf...
[JSONWP Proxy] Replacing sessionId e1cc8c5acefcf0ef250abfcf6b59b61d with 4cd47498-3a35-495e-8cdd-1fd02e69427c
[HTTP] <-- POST /wd/hub/session/4cd47498-3a35-495e-8cdd-1fd02e69427c/timeouts 200 12 ms - 220
Could it be the some version problem of chrome installed or chrome-driver?

Error: Log capture did not start in a reasonable amount of time #472

I am new to Appium and I am trying to run the appium.app with iOS option using stimulator.I have selected the app path and show stimulator log with platform version as 8.1.
I have also added appium.txt file with the following content in the appium installation directory.
[caps]
platformName = "ios"
deviceName = "iPhone 6"
platformVersion = "8.1"
app = “/Users/dhanasekarbabu/downloads/untitled/UICatalog.app"
Also please find the following log,
Launching Appium with command: '/Applications/Appium.app/Contents/Resources/node/bin/node' lib/server/main.js --command-timeout "7200" --platform-version "8.1" --platform-name "iOS" --app "/Users/dhanasekarbabu/Downloads/untitled/UICatalog.app" --show-ios-log --default-device
info: Welcome to Appium v1.3.6 (REV 004f52f249d3513809e7d0734d9205d1fec19f8e)
info: Appium REST http interface listener started on 0.0.0.0:4723
info: [debug] Non-default server args: {"app":"/Users/dhanasekarbabu/Downloads/untitled/UICatalog.app","platformName":"iOS","platformVersion":"8.1","defaultDevice":true,"showIOSLog":true,"defaultCommandTimeout":7200}
info: Console LogLevel: debug
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.6","revision":"004f52f249d3513809e7d0734d9205d1fec19f8e"}}}
info: <-- GET /wd/hub/status 200 13.582 ms - 104 {"status":0,"value":{"build":{"version":"1.3.6","revision":"004f52f249d3513809e7d0734d9205d1fec19f8e"}}}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.6","revision":"004f52f249d3513809e7d0734d9205d1fec19f8e"}}}
info: <-- GET /wd/hub/status 200 4.070 ms - 104 {"status":0,"value":{"build":{"version":"1.3.6","revision":"004f52f249d3513809e7d0734d9205d1fec19f8e"}}}
info: --> GET /wd/hub/sessions {}
info: [debug] Responding to client with success: {"status":0,"value":[]}
info: <-- GET /wd/hub/sessions 200 1.517 ms - 23 {"status":0,"value":[]}
info: --> POST /wd/hub/session {"desiredCapabilities":{"platformName":"iOS","platformVersion":"8.1","newCommandTimeout":"999999","automationName":"Appium"}}
error: The following desired capabilities are required, but were not provided: deviceName
info: Client User-Agent string: Appium (unknown version) CFNetwork/720.2.4 Darwin/14.1.0 (x86_64)
info: [debug] Got configuration error, not starting session
info: [debug] Cleaning up appium session
info: [debug] Error: The following desired capabilities are required, but were not provided: deviceName
at Capabilities.checkValidity (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/server/capabilities.js:143:13)
at Appium.configure (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/appium.js:238:35)
at null. (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/appium.js:118:10)
at Appium.start (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/appium.js:129:5)
at Object.exports.createSession as handle
at next_layer (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/express/lib/router/route.js:113:13)
at Route.dispatch (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/express/lib/router/route.js:117:5)
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/express/lib/router/index.js:222:24
at Function.proto.process_params (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/express/lib/router/index.js:288:12)
at next (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/express/lib/router/index.js:216:19)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: The following desired capabilities are required, but were not provided: deviceName)","origValue":"The following desired capabilities are required, but were not provided: deviceName"},"sessionId":null}
info: <-- POST /wd/hub/session 500 16.616 ms - 286
error: Failed to start an Appium session, err was: Error: The following desired capabilities are required, but were not provided: deviceName
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.6","revision":"004f52f249d3513809e7d0734d9205d1fec19f8e"}}}
info: <-- GET /wd/hub/status 200 1.698 ms - 104 {"status":0,"value":{"build":{"version":"1.3.6","revision":"004f52f249d3513809e7d0734d9205d1fec19f8e"}}}
Also if i select force device and provided a UDID after selecting the UDID I'm getting the issue "Failed to start an Appium session, err was: Error: Log capture did not start in a reasonable amount of time".
I have changed the stuimulator devices and i am facing the same issue.
Also please find the following go for your reference.
Launching Appium with command: '/Applications/Appium.app/Contents/Resources/node/bin/node' lib/server/main.js --command-timeout "7200" --platform-version "8.1" --platform-name "iOS" --app "/Users/dhanasekarbabu/Downloads/untitled/UICatalog.app" --udid "F07654AE-E9B5-4A5F-956A-D20091413DAB" --show-ios-log --device-name "iPhone 5 (F07654AE-E9B5-4A5F-956A-D20091413DAB)"
info: Welcome to Appium v1.3.6 (REV 004f52f249d3513809e7d0734d9205d1fec19f8e)
info: Appium REST http interface listener started on 0.0.0.0:4723
info: [debug] Non-default server args: {"app":"/Users/dhanasekarbabu/Downloads/untitled/UICatalog.app","udid":"F07654AE-E9B5-4A5F-956A-D20091413DAB","deviceName":"iPhone 5 (F07654AE-E9B5-4A5F-956A-D20091413DAB)","platformName":"iOS","platformVersion":"8.1","showIOSLog":true,"defaultCommandTimeout":7200}
info: Console LogLevel: debug
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.6","revision":"004f52f249d3513809e7d0734d9205d1fec19f8e"}}}
info: <-- GET /wd/hub/status 200 12.528 ms - 104 {"status":0,"value":{"build":{"version":"1.3.6","revision":"004f52f249d3513809e7d0734d9205d1fec19f8e"}}}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.6","revision":"004f52f249d3513809e7d0734d9205d1fec19f8e"}}}
info: <-- GET /wd/hub/status 200 4.022 ms - 104 {"status":0,"value":{"build":{"version":"1.3.6","revision":"004f52f249d3513809e7d0734d9205d1fec19f8e"}}}
info: --> GET /wd/hub/sessions {}
info: [debug] Responding to client with success: {"status":0,"value":[]}
info: <-- GET /wd/hub/sessions 200 1.527 ms - 23 {"status":0,"value":[]}
info: --> POST /wd/hub/session {"desiredCapabilities":{"platformName":"iOS","platformVersion":"8.1","newCommandTimeout":"999999","automationName":"Appium","deviceName":"iPhone 5 (F07654AE-E9B5-4A5F-956A-D20091413DAB)"}}
info: Client User-Agent string: Appium (unknown version) CFNetwork/720.2.4 Darwin/14.1.0 (x86_64)
info: [debug] Using local app from command line: /Users/dhanasekarbabu/Downloads/untitled/UICatalog.app
info: [debug] Creating new appium session 8a4d5f38-d574-4338-85e3-443e04a26ed8
info: [debug] Removing any remaining instruments sockets
info: [debug] Cleaned up instruments socket /tmp/instruments_sock
info: [debug] Setting Xcode folder
info: [debug] Setting Xcode version
info: [debug] Setting iOS SDK Version
info: [debug] Getting sdk version from xcrun with a timeout
info: [debug] iOS SDK Version set to 8.2
info: [debug] Not checking whether simulator is available since we're on a real device
info: [debug] Detecting automation tracetemplate
info: [debug] Not auto-detecting udid, running on sim
info: [debug] Parsed app Info.plist (as binary)
info: [debug] Parsed app Localizable.strings
info: [debug] Getting bundle ID from app
info: [debug] Parsed app Info.plist (as binary)
info: [debug] Creating instruments
info: On some xcode 6 platforms, instruments-without-delay does not work. If you experience this, you will need to re-run appium with the --native-instruments-lib flag
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir: /Users/dhanasekarbabu/Library/Application Support/appium/bootstrap
info: [debug] Dynamic env: {"nodePath":"/Applications/Appium.app/Contents/Resources/node/bin/node","commandProxyClientPath":"/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js","instrumentsSock":"/tmp/instruments_sock","interKeyDelay":null,"justLoopInfinitely":false,"autoAcceptAlerts":false,"autoDismissAlerts":false,"sendKeyStrategy":"grouped"}
info: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!
...
info: [debug] Dynamic bootstrap path: /Users/dhanasekarbabu/Library/Application Support/appium/bootstrap/bootstrap-2911698fabce8e2c.js
info: [debug] Reusing dynamic bootstrap: /Users/dhanasekarbabu/Library/Application Support/appium/bootstrap/bootstrap-2911698fabce8e2c.js
info: [debug] Getting device string from opts: {"forceIphone":false,"forceIpad":false,"xcodeVersion":"6.2","iOSSDKVersion":"8.2","deviceName":"iPhone 5 (F07654AE-E9B5-4A5F-956A-D20091413DAB)","platformVersion":"8.1"}
info: [debug] fixDevice is on
info: [debug] Final device string is: 'iPhone 5 (F07654AE-E9B5-4A5F-956A-D20091413DAB) (8.1 Simulator)'
info: [debug] Not setting device type since we're on a real device
info: [debug] Checking whether we need to set app preferences
info: [debug] Not setting iOS and app preferences since we're on a real device
info: [debug] Running ios sim reset flow
info: [debug] Killing the simulator process
info: [debug] Killall iOS Simulator
info: [debug] Killing any other simulator daemons
info: [debug] On a real device; cannot clean device state
info: [debug] Not setting locale because we're using a real device
info: [debug] No iOS / app preferences to set
info: [debug] Starting iOS device log capture via deviceconsole
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.6","revision":"004f52f249d3513809e7d0734d9205d1fec19f8e"},"isShuttingDown":false},"sessionId":"8a4d5f38-d574-4338-85e3-443e04a26ed8"}
info: <-- GET /wd/hub/status 200 2.968 ms - 178 {"status":0,"value":{"build":{"version":"1.3.6","revision":"004f52f249d3513809e7d0734d9205d1fec19f8e"},"isShuttingDown":false},"sessionId":"8a4d5f38-d574-4338-85e3-443e04a26ed8"}
info: [debug] Cleaning up appium session
info: [debug] Error: Log capture did not start in a reasonable amount of time
at null._onTimeout (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/ios/ios-log.js:137:10)
at Timer.listOnTimeout (timers.js:110:15)
error: Log capture did not start in a reasonable amount of time
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Log capture did not start in a reasonable amount of time)","origValue":"Log capture did not start in a reasonable amount of time"},"sessionId":null}
info: <-- POST /wd/hub/session 500 10325.771 ms - 234
info: [debug] Not pre-launching simulator
info: [debug] Creating iDevice object with udid F07654AE-E9B5-4A5F-956A-D20091413DAB
info: [debug] Checking app install status using: /Applications/Appium.app/Contents/Resources/node_modules/appium/build/fruitstrap/fruitstrap isInstalled --id F07654AE-E9B5-4A5F-956A-D20091413DAB --bundle com.example.apple-samplecode.UICatalog
error: Failed to start an Appium session, err was: Error: Log capture did not start in a reasonable amount of time
Please help me to solve this issue.
Thanks in Advance
Regards,
Rajesh D

Cannot get protractor to run Firefox

I have tried many versions of Firefox, but can’t get protractor to run them. I have followed the installation steps on their site and I downgraded to Firefox 31.0.
Currently it will begin properly, then swap the app icon in the dock 2x then do nothing, not even open a browser window. After aprox. one minute and then it will timeout and quit.
The first line hangs, lines two and after came about a minute later.
$ protractor conf.js
Using the selenium server at http://localhost:4444/wd/hub
A Jasmine spec timed out. Resetting the WebDriver Control Flow.
The last active task was:
WebDriver.createSession()
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
at <anonymous>
FF
/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/error.js:113
var template = new Error(this.message);
^
UnknownError: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
kipping unavailable install location app-system-share
1414172895384 addons.xpi DEBUG Ignoring file entry whose name is not a valid add-on ID: /var/folders/55/rcwf6nxx41nctw5qgtln0zqw0000gn/T/anonymous999359446682165432webdriver-profile/extensions/webdriver-staging
1414172895398 addons.xpi DEBUG checkForChanges
1414172895404 addons.xpi DEBUG Directory state JSON differs: cache [] state [{"name":"app-system-local","addons":{"web2pdfextension#web2pdf.adobedotcom":{"descriptor":"/Library/Application Support/Mozilla/Extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/web2pdfextension#web2pdf.adobedotcom","mtime":1411008686000,"rdfTime":1348459481000}}},{"name":"app-global","addons":{"{972ce4c6-7e08-4474-a285-3208198ce6fd}":{"descriptor":"/Applications/Firefox.app/Contents/MacOS/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}","mtime":1405567571000,"rdfTime":1405565774000}}},{"name":"app-profile","addons":{"fxdriver#googlecode.com":{"descriptor":"/var/folders/55/rcwf6nxx41nctw5qgtln0zqw0000gn/T/anonymous999359446682165432webdriver-profile/extensions/fxdriver#googlecode.com","mtime":1414172895000,"rdfTime":1414172895000}}}]
1414172895408 addons.xpi-utils DEBUG Opening XPI database /var/folders/55/rcwf6nxx41nctw5qgtln0zqw0000gn/T/anonymous999359446682165432webdriver-profile/extensions.json
1414172895409 addons.xpi DEBUG New add-on fxdriver#googlecode.com installed in app-profile
*** Blocklist::_loadBlocklistFromFile: blocklist is disabled
1414172895423 addons.xpi-utils DEBUG Make addon app-profile:fxdriver#googlecode.com visible
1414172895424 DeferredSave.extensions.json DEBUG Save changes
1414172895424 DeferredSave.extensions.json DEBUG Save changes
1414172895424 addons.xpi DEBUG New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} installed in app-global
1414172895426 addons.xpi-utils DEBUG Make addon app-global:{972ce4c6-7e08-4474-a285-3208198ce6fd} visible
1414172895426 DeferredSave.extensions.json DEBUG Save changes
1414172895426 DeferredSave.extensions.json DEBUG Save changes
1414172895426 addons.xpi DEBUG New add-on web2pdfextension#web2pdf.adobedotcom installed in app-system-local
1414172895428 addons.xpi-utils DEBUG Make addon app-system-local:web2pdfextension#web2pdf.adobedotcom visible
1414172895429 DeferredSave.extensions.json DEBUG Save changes
1414172895429 DeferredSave.extensions.json DEBUG Save changes
1414172895432 addons.xpi DEBUG Updating database with changes to installed add-ons
1414172895432 addons.xpi-utils DEBUG Updating add-on states
1414172895433 addons.xpi-utils DEBUG Writing add-ons list
1414172895513 DeferredSave.extensions.json DEBUG Starting timer
1414172895529 addons.manager DEBUG shutdown
1414172895529 addons.xpi DEBUG shutdown
1414172895529 addons.xpi-utils DEBUG shutdown
1414172895530 DeferredSave.extensions.json DEBUG Flush called while data is dirty
1414172895538 DeferredSave.extensions.json DEBUG Starting write
1414172895593 DeferredSave.extensions.json DEBUG Write succeeded
1414172895593 addons.xpi-utils DEBUG XPI Database saved, setting schema version preference to 16
1414172895593 addons.xpi DEBUG Notifying XPI shutdown observers
1414172895595 addons.manager DEBUG Async provider shutdown done
1414172895795 addons.manager DEBUG Loaded provider scope for resource://gre/modules/addons/XPIProvider.jsm: ["XPIProvider"]
1414172895797 addons.manager DEBUG Loaded provider scope for resource://gre/modules/LightweightThemeManager.jsm: ["LightweightThemeManager"]
1414172895798 addons.xpi DEBUG startup
1414172895799 addons.xpi DEBUG Skipping unavailable install location app-system-share
1414172895800 addons.xpi DEBUG Ignoring file entry whose name is not a valid add-on ID: /var/folders/55/rcwf6nxx41nctw5qgtln0zqw0000gn/T/anonymous999359446682165432webdriver-profile/extensions/webdriver-staging
1414172895814 addons.xpi DEBUG checkForChanges
1414172895820 addons.xpi DEBUG No changes found
1414172895906 addons.manager DEBUG shutdown
1414172895906 addons.xpi DEBUG shutdown
1414172895906 addons.xpi DEBUG Notifying XPI shutdown observers
1414172895912 addons.manager DEBUG Async provider shutdown done
at new bot.Error (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/error.js:113:18)
at Object.bot.response.checkResponse (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/atoms/response.js:106:9)
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:151:24
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:1582:15
at [object Object].webdriver.promise.ControlFlow.runInNewFrame_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1640:20)
at notify (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:444:12)
at notifyAll (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:422:7)
at resolve (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:400:7)
at fulfill (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:512:5)
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/goog/base.js:1582:15
at [object Object].webdriver.promise.ControlFlow.runInNewFrame_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1640:20)
at notify (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:444:12)
at notifyAll (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:422:7)
at resolve (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:400:7)
at [object Object].fulfill (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:512:5)
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:703:49
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/http/http.js:96:5
at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:131:7)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:920:16
at process._tickCallback (node.js:415:13)
==== async task ====
WebDriver.navigate().to(data:text/html,<html></html>)
at [object Object].webdriver.WebDriver.schedule (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:302:15)
at [object Object].webdriver.WebDriver.Navigation.to (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:969:23)
at [object Object].webdriver.WebDriver.get (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:661:26)
at [object Object].Protractor.get (/usr/local/lib/node_modules/protractor/lib/protractor.js:1221:15)
at [object Object].<anonymous> (/Users/kirkstrobeck/git/tipfortip/www/public/index-spec.js:14:13)
at /usr/local/lib/node_modules/protractor/node_modules/jasminewd/index.js:94:14
at [object Object].webdriver.promise.ControlFlow.runInNewFrame_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1640:20)
at [object Object].webdriver.promise.ControlFlow.runEventLoop_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1505:8)
at [object Object].wrapper [as _onTimeout] (timers.js:252:14)
at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
==== async task ====
Asynchronous test function: it()
at [object Object].<anonymous> (/usr/local/lib/node_modules/protractor/node_modules/jasminewd/index.js:93:33)
at [object Object].<anonymous> (/usr/local/lib/node_modules/protractor/node_modules/minijasminenode/lib/async-callback.js:45:37)
at [object Object].jasmine.Block.execute (/usr/local/lib/node_modules/protractor/node_modules/minijasminenode/lib/jasmine-1.3.1.js:1174:17)
at [object Object].jasmine.Queue.next_ (/usr/local/lib/node_modules/protractor/node_modules/minijasminenode/lib/jasmine-1.3.1.js:2209:31)
at [object Object].jasmine.Queue.start (/usr/local/lib/node_modules/protractor/node_modules/minijasminenode/lib/jasmine-1.3.1.js:2162:8)
at [object Object].jasmine.Spec.execute (/usr/local/lib/node_modules/protractor/node_modules/minijasminenode/lib/jasmine-1.3.1.js:2503:14)
at [object Object].jasmine.Queue.next_ (/usr/local/lib/node_modules/protractor/node_modules/minijasminenode/lib/jasmine-1.3.1.js:2209:31)
at onComplete (/usr/local/lib/node_modules/protractor/node_modules/minijasminenode/lib/jasmine-1.3.1.js:2205:18)
at [object Object].jasmine.Spec.finish (/usr/local/lib/node_modules/protractor/node_modules/minijasminenode/lib/jasmine-1.3.1.js:2477:5)
at [object Object].onComplete (/usr/local/lib/node_modules/protractor/node_modules/minijasminenode/lib/jasmine-1.3.1.js:2504:10)
at [object Object].jasmine.Queue.next_ (/usr/local/lib/node_modules/protractor/node_modules/minijasminenode/lib/jasmine-1.3.1.js:2219:14)
at [object Object]._onTimeout (/usr/local/lib/node_modules/protractor/node_modules/minijasminenode/lib/jasmine-1.3.1.js:2199:18)
at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)==== async task ====
Error
at [object Object].<anonymous> (/Users/kirkstrobeck/git/tipfortip/www/public/index-spec.js:13:3)
at [object Object].jasmine.Env.describe_ (/usr/local/lib/node_modules/protractor/node_modules/minijasminenode/lib/jasmine-1.3.1.js:913:21)
at [object Object].jasmine.Env.describe (/usr/local/lib/node_modules/protractor/node_modules/minijasminenode/lib/jasmine-1.3.1.js:898:15)
at describe (/usr/local/lib/node_modules/protractor/node_modules/minijasminenode/lib/jasmine-1.3.1.js:658:27)
at Object.<anonymous> (/Users/kirkstrobeck/git/tipfortip/www/public/index-spec.js:1:63)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.exports.executeSpecs (/usr/local/lib/node_modules/protractor/node_modules/minijasminenode/lib/index.js:130:7)
at /usr/local/lib/node_modules/protractor/lib/frameworks/jasmine.js:49:12
at _fulfilled (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:797:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:826:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:759:13)
at /usr/local/lib/node_modules/protractor/node_modules/q/q.js:525:49
at flush (/usr/local/lib/node_modules/protractor/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:415:13)
at Function.Module.runMain (module.js:499:11)
at startup (node.js:119:16)
at node.js:902:3
$
If you encounter this issue in 2016, try updating Firefox to the latest, precisely to
Firefox v47.0.1
and your protractor tests should run again; no need to go to an older versions as of today, 07/28/2016 :)
Also note that Firefox comes prepackaged with the selenium server jar so you don't need to declare an explicit driver for it as you do with chrome, so in your protractor configuration file,
just declare browser name like below and it should work:
capabilities: {
'browserName': 'firefox'
},

Resources