You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Sergey Grebnov (JIRA)" <ji...@apache.org> on 2015/01/26 17:22:35 UTC

[jira] [Comment Edited] (CB-8080) After migrating to 3.6.3 from 3.4.0, Appium (Android) tests fail because of open dialog

    [ https://issues.apache.org/jira/browse/CB-8080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14292009#comment-14292009 ] 

Sergey Grebnov edited comment on CB-8080 at 1/26/15 4:21 PM:
-------------------------------------------------------------

Made a quick test and see exactly the same error if I use NodeJS driver for appium and *window.location.reload()*

{code}

 Apache Cordova simple test should find an element:
     Error: [elementById("deviceready")] Error response status: 26, , UnexpectedAlertOpen - A modal dialog was open, blocking this operation Selenium error: A modal dialog was open, blocking this operation
      at exports.newError (C:\temp\appium\node_modules\wd\lib\utils.js:139:13)
      at C:\temp\appium\node_modules\wd\lib\callbacks.js:75:19
      at C:\temp\appium\node_modules\wd\lib\webdriver.js:174:5
      at Request._callback (C:\temp\appium\node_modules\wd\lib\http-utils.js:85:7)
      at Request.self.callback (C:\temp\appium\node_modules\wd\node_modules\request\request.js:364:22)
      at Request.emit (events.js:98:17)
      at Request.<anonymous> (C:\temp\appium\node_modules\wd\node_modules\request\request.js:1318:14)
      at Request.emit (events.js:117:20)
      at IncomingMessage.<anonymous> (C:\temp\appium\node_modules\wd\node_modules\request\request.js:1266:12)
      at IncomingMessage.emit (events.js:117:20)
      at _stream_readable.js:938:16
      at process._tickCallback (node.js:419:13)
{code}

Trace from appium server
{code}
info: [debug] [CHROMEDRIVER] Starting ChromeDriver (v2.10.267521) on port 9515
Only local connections are allowed.
info: [debug] Making http request with opts: {"url":"http://127.0.0.1:9515/wd/hub/session","method":"POST","json":{"sessionId":null,"desiredCapabilities":{"chromeOptions":{"androidPackage":"io.cordova.hellocordova","androidUseRunningApp":true,"androidDeviceSerial":"192.168.56.101:5555"}}}}
info: [debug] Successfully started chrome session c0b9013506c37e0d41a86f1e51b9792c
info: [debug] Setting proxy session id to c0b9013506c37e0d41a86f1e51b9792c
info: [debug] Overriding session id with "c0b9013506c37e0d41a86f1e51b9792c"
info: [debug] Device launched! Ready for commands
info: [debug] Setting command timeout to the default of 60 secs
info: [debug] Appium session started with sessionId c0b9013506c37e0d41a86f1e51b9792c
info: <-- POST /wd/hub/session 303 40334.034 ms - 9
info: --> POST /wd/hub/session/c0b9013506c37e0d41a86f1e51b9792c/timeouts/implicit_wait {"ms":3000}
info: [debug] Proxying command to 127.0.0.1:9515
info: [debug] Making http request with opts: {"url":"http://127.0.0.1:9515/wd/hub/session/c0b9013506c37e0d41a86f1e51b9792c/timeouts/implicit_wait","method":"POST","json":{"ms":3000}}
info: [debug] Proxied response received with status 200: {"sessionId":"c0b9013506c37e0d41a86f1e51b9792c","status":0,"value":null}
info: <-- POST /wd/hub/session/c0b9013506c37e0d41a86f1e51b9792c/timeouts/implicit_wait 200 8.770 ms - 72
info: --> POST /wd/hub/session/c0b9013506c37e0d41a86f1e51b9792c/element {"using":"id","value":"deviceready"}
info: [debug] Proxying command to 127.0.0.1:9515
info: [debug] Making http request with opts: {"url":"http://127.0.0.1:9515/wd/hub/session/c0b9013506c37e0d41a86f1e51b9792c/element","method":"POST","json":{"using":"id","value":"deviceready"}}
info: [debug] Responding to client with error: {"status":26,"value":{"message":"A modal dialog was open, blocking this operation","origValue":"unexpected alert open\n  (Session info: webview=)\n  (Driver info: chromedriver=2.10.267521,platform=Windows NT 6.3 x86_64)"},"sessionId":"c0b9013506c37e0d41a86f1e51b9792c"}
info: <-- POST /wd/hub/session/c0b9013506c37e0d41a86f1e51b9792c/element 500 3429.796 ms - 269
info: --> DELETE /wd/hub/session/c0b9013506c37e0d41a86f1e51b9792c {}
info: Shutting down appium session
{code}


was (Author: sgrebnov):
Made a quick test and see exactly the same error if I use NodeJS driver for appium and *window.location.reload()*

{code}

 Apache Cordova simple test should find an element:
     Error: [elementById("deviceready")] Error response status: 26, , UnexpectedAlertOpen - A modal dialog was open, blocking this operation Selenium error: A modal dialog was open, blocking this operation
      at exports.newError (C:\temp\appium\node_modules\wd\lib\utils.js:139:13)
      at C:\temp\appium\node_modules\wd\lib\callbacks.js:75:19
      at C:\temp\appium\node_modules\wd\lib\webdriver.js:174:5
      at Request._callback (C:\temp\appium\node_modules\wd\lib\http-utils.js:85:7)
      at Request.self.callback (C:\temp\appium\node_modules\wd\node_modules\request\request.js:364:22)
      at Request.emit (events.js:98:17)
      at Request.<anonymous> (C:\temp\appium\node_modules\wd\node_modules\request\request.js:1318:14)
      at Request.emit (events.js:117:20)
      at IncomingMessage.<anonymous> (C:\temp\appium\node_modules\wd\node_modules\request\request.js:1266:12)
      at IncomingMessage.emit (events.js:117:20)
      at _stream_readable.js:938:16
      at process._tickCallback (node.js:419:13)
{code}

> After migrating to 3.6.3 from 3.4.0, Appium (Android) tests fail because of open dialog
> ---------------------------------------------------------------------------------------
>
>                 Key: CB-8080
>                 URL: https://issues.apache.org/jira/browse/CB-8080
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android, CordovaJS
>    Affects Versions: 3.6.3
>         Environment: Basic Appium test on Android webview based app. The test on Appium works until the app issues a `window.location.reload()` or a `window.location.href = 'something'`.
>            Reporter: Andrea Tino
>              Labels: appium, chromedriver, javascript, selenium
>         Attachments: MyApp-debug.apk
>
>
> After upgrading to Cordova 3.6.3 from Cordova 3.4.0; my Appium tests cannot go on because of a strange error. The error can be reproed very easily by creating a basic web-view based app on Android which issues a {{window.location.reload()}} after a while that the test starts.
> I could assess that the problem is one particular file: {{cordova.js}} which becomes part of the js files in my app when I build it with Cordova. My app loads only one javascript file: {{cordova.js}}, I removed all other dependencies to other js files. When that file is in my app (even though {{index.html}} does not use any function defined in there), my tests fails. If I remove the dependencies to that file, tests go ok!
> The problem is that when my app issues a {{window.location.reload()}}; my test fail with this error message:
> {code}
> info: [debug] Responding to client with error: {"status":26,"value":{"message":"A modal dialog was open, blocking this operation","origValue":"unexpected alert open\n (Session info: webview=)\n (Driver info: chromedriver=2.10.267521,platform=Windows NT 6.3 x86_64)"},"sessionId":"965ba51e54f682559e5b8378095bc3d4"}
> {code}
> *Test*
> The APK to repro this is in attachments. It is possible to run a simple Appium test to repro the problem:
> {code}
> [Test]
>         public void SimpleTest()
>         {
>             this.appPackage = "com.myorg.myapp";
>             this.appActivity = "myapp";
>             BeforeAll();
>             Thread.Sleep(3000);
>             var submitAddressButton = driver.FindElementByClassName("testClass");
>             submitAddressButton.Click();
>             Thread.Sleep(3000);
>             submitAddressButton = driver.FindElementByClassName("testClass");
>             Expect(submitAddressButton, Is.Not.Null);
>         }
> {code}
> *Important*
> The fact that a dialog is reported is actually very strange. After inspecting a lot I could verify that no native/webview dialog is being shown on my app. In fact I cannot see any dialog and if I try to dismiss this ghost dialog using Appium and WebDriver APIs, the command fail as no dialog can be found.
> *Notes*
> Consider that the problem is not in the APIs I use in my test (C# dotnet driver for Appium). Everything happens on my Appium server running on a Mac.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org