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

registering appium node with selenium server stopped working #8916

Closed
vikramvi opened this issue Jul 25, 2017 · 28 comments
Closed

registering appium node with selenium server stopped working #8916

vikramvi opened this issue Jul 25, 2017 · 28 comments
Labels
Bug a problem that needs fixing P0 W3C regarding W3C specification compliance

Comments

@vikramvi
Copy link
Contributor

The problem

  • not able to launch app on android simulator which is registered as node to selenium hub
  • appium 1.6.6-beta.3
  • selenium-server-standalone-3.4.0.jar
  • start selenium java -jar selenium-server-standalone-3.4.0.jar -role hub
  • register appium node appium --nodeconfig device_1.json -p 4723 -bp 4724 -U emulator-5554
    device_1.json
    {"capabilities":[{"browserName":"Android","platformName":"ANDROID","maxInstances":1,"applicationName":"dummy_Android_1"}],"configuration":{"proxy":"org.openqa.grid.selenium.proxy.DefaultRemoteProxy","cleanUpCycle":2000,"port":4700,"host":"127.0.0.1","maxSession":1,"hubHost":"192.168.178.21","registerCycle":5000,"hubPort":4444,"timeout":30000,"register":true}}

Environment

  • Appium version (or git revision) that exhibits the issue: 1.6.6-beta.3
  • Last Appium version that did not exhibit the issue (if applicable): NA
  • Desktop OS/version used to run Appium: Mac 10.12.5
  • Node.js version (unless using Appium.app|exe): v7.9.0
  • Mobile platform/version under test: Android simulator
  • Real device or emulator/simulator: simulator
  • Appium CLI or Appium.app|exe: CLI

Details

If necessary, describe the problem you have been experiencing in more detail.

Link to Appium logs

appium server for node log
https://gist.github.com/vikramvi/00c877d228edd1d0e8d74f7e984cc2de

Selenium Server log
https://gist.github.com/vikramvi/e564bf089f1c46487ff0d9d112e77e7d

Code To Reproduce Issue [ Good To Have ]

Please remember that with sample code it's easier to reproduce the bug and it's much faster to fix it.

Please git clone https://github.com/appium/sample-code and use one of your favourite languages and sample apps to reproduce the issue.

In case a similar scenario is missing in sample-code, please submit a PR with one of the sample apps provided.

@vikramvi
Copy link
Contributor Author

SeleniumHQ/selenium#4142

selenium team has confirmed it's appium related issue

@mykola-mokhnach
Copy link
Collaborator

What is the terminal output for the command /Users/vikram-anna/Library/Android/sdk/build-tools/25.0.0/aapt dump badging /Users/vikram-anna/Documents/Noa/Workspace/Mobile-Automation/Android-Automation/serenityAppiumFlipkart-JustinFrameworkMigrationToJava/ApiDemos-debug.apk ?

@mykola-mokhnach mykola-mokhnach added Android related to Android-native driver(s) Needs Info typically non-actionable; needs author to respond labels Jul 25, 2017
@mykola-mokhnach
Copy link
Collaborator

Also, why avd capability is not used to start emulator?

@vikramvi
Copy link
Contributor Author

vikramvi commented Jul 26, 2017

@mykola-mokhnach please find below clarification

  1. ApiDemos-debug.apk was not able to be installed on Android emulator; so I used another working one com.wunderkinder.wunderlistandroid.apk

1.1 With this apk does gets installed but still see the errors in selenium server logs
https://gist.github.com/vikramvi/731b286983640a784b9ddbb8f3c96fed

1.2 appium log
https://gist.github.com/vikramvi/bb1882a32ef42251e21a6c9d0bee9830

  1. As I've kept Android emulator in open state, didn't use avd caps

@mykola-mokhnach
Copy link
Collaborator

It looks like the grid didn't like our response for session creation request. @imurchie @jlipps Any thoughts?

@mykola-mokhnach mykola-mokhnach removed the Needs Info typically non-actionable; needs author to respond label Jul 26, 2017
@vikramvi
Copy link
Contributor Author

ping @imurchie @jlipps please review

@imurchie
Copy link
Contributor

The grid is getting the following capabilities:

{
  "capabilities": [
    {
      "desiredCapabilities": {
        "app": "/Users/vikram-anna/Documents/ApiDemos-debug.apk",
        "appPackage": "io.appium.android.apis",
        "noReset": true,
        "appWaitActivity": "io.appium.android.apis.ApiDemos",
        "platformName": "Android",
        "deviceName": "Android",
        "applicationName": "dummy_Android_1"
      }
    },
    {
      "requiredCapabilities": {}
    }
  ],
  "desiredCapabilities": {
    "app": "/Users/vikram-anna/Documents/ApiDemos-debug.apk",
    "appPackage": "io.appium.android.apis",
    "noReset": true,
    "appWaitActivity": "io.appium.android.apis.ApiDemos",
    "platformName": "Android",
    "deviceName": "Android",
    "applicationName": "dummy_Android_1"
  },
  "requiredCapabilities":{}
}

I have no idea why it is not liking this. The throwing code is https://github.com/SeleniumHQ/selenium/blob/master/java/server/src/org/openqa/grid/web/servlet/handler/WebDriverRequest.java#L66-L80

@yaphatak
Copy link
Contributor

Well, look like this PR broke backward compatibility. This is 7 days old PR. @vikramvi , if you want to unblock yourself you can use little older grid binaries. I believe it should work.
Its broken because of this https://github.com/SeleniumHQ/selenium/blob/49c043c90331d083a2b9f268e370e2e1a5f47628/java/server/src/org/openqa/selenium/remote/server/NewSessionPayload.java#L171-L253, but its difficult to guess as code is little complicated, need to debug.

@mykola-mokhnach mykola-mokhnach added W3C regarding W3C specification compliance Bug a problem that needs fixing and removed Android related to Android-native driver(s) labels Jul 27, 2017
@imurchie
Copy link
Contributor

@dpgraham You were working on capability compatibility with the W3C spec and whatnot, right? I think this falls into that.

@dpgraham dpgraham added the P0 label Jul 28, 2017
@dpgraham
Copy link
Contributor

@imurchie It could be due to capabilities and desiredCapabilities both being defined and it not handling that.

I can look into that today. It shouldn't reject the capabilities. I'll use the caps provided in this issue as a test case.

@dpgraham dpgraham self-assigned this Jul 28, 2017
@jlipps
Copy link
Member

jlipps commented Jul 28, 2017

@imurchie @dpgraham both being defined should be ok. Unfortunately what's inside of capabilities is not correct. It should be the two properties alwaysMatch and firstMatch, along with their appropriate contents. I'd say it should probably look like:

{
  "capabilities": {
    "alwaysMatch": {
      "app": "/Users/vikram-anna/Documents/ApiDemos-debug.apk",
      "appPackage": "io.appium.android.apis",
      "noReset": true,
      "appWaitActivity": "io.appium.android.apis.ApiDemos",
      "platformName": "Android",
      "deviceName": "Android",
      "applicationName": "dummy_Android_1"
    }, "firstMatch": []
  },
  "desiredCapabilities": {
    "app": "/Users/vikram-anna/Documents/ApiDemos-debug.apk",
    "appPackage": "io.appium.android.apis",
    "noReset": true,
    "appWaitActivity": "io.appium.android.apis.ApiDemos",
    "platformName": "Android",
    "deviceName": "Android",
    "applicationName": "dummy_Android_1"
  },
  "requiredCapabilities":{}
}

Is this something we're creating, or what?

@TikhomirovSergey
Copy link

TikhomirovSergey commented Jul 28, 2017

I'm suspecting that there is the client-side issue. Or it is the issue of compatebility with the Selenium Server 3.x

@jlipps

both being defined should be ok. Unfortunately what's inside of capabilities is not correct. It should be the two properties alwaysMatch and firstMatch, along with their appropriate contents. I'd say it should probably look like...

It these parameters are not present due to this fix:
appium/java-client#597
it is related to this issue: appium/java-client#594

I am searching for the way to work out this issue.

@jlipps
Copy link
Member

jlipps commented Jul 28, 2017

excellent, thank you @TikhomirovSergey!

@TikhomirovSergey
Copy link

@jlipps
So what the solution? Should I correct the client? Does the appium server support the alwaysMatch and firstMatch? Please take a look at the appium/java-client#594

@jlipps
Copy link
Member

jlipps commented Jul 28, 2017

@TikhomirovSergey yes, the server has been updated to support the new-style capabilities object. So it should be safe to update the client, though it means the client will only work with newer servers of course.

@TikhomirovSergey
Copy link

TikhomirovSergey commented Jul 28, 2017

@jlipps
ok. We are planning to release 5.0.0 which has no deprecated code (it is really breaking release).

@jlipps
Copy link
Member

jlipps commented Jul 28, 2017

makes sense, hooray for deleting code!

@mykola-mokhnach
Copy link
Collaborator

shall we also update other clients in such case. How about Ruby client and Python? @KazuCocoa @dpgraham

@KazuCocoa
Copy link
Member

Ruby client hasn't supported the new capability yet, new style capability has been supported selenium-webdriver 3.4.1+, because we also need to update some methods to catch up with latest Ruby client version.

I've created issues for it, appium/ruby_lib#501 , appium/ruby_lib#558, and I'll start working to support it.

@vikramvi
Copy link
Contributor Author

@TikhomirovSergey can you please let me know tentative date for 5.0.0 release ?

@dpgraham
Copy link
Contributor

@mykola-mokhnach Yeah, we'll need to update the JS clients, PHP and Python

@jlipps jlipps added this to the Bishop [Sprint 13] milestone Jul 31, 2017
@KazuCocoa
Copy link
Member

When I run with selenium-webdriver3.4.3 and selenium grid 3.4.0, I encountered the following issue between selenium-webdriver's code and selenium grid's code.
So, in ruby client side, we should use under selenium grid 3.3.x until fix the following issue.

SeleniumHQ/selenium#3808 (comment)

@jlipps
Copy link
Member

jlipps commented Aug 14, 2017

@TikhomirovSergey any update on fixing the java client for this issue?

@dpgraham dpgraham removed their assignment Aug 17, 2017
@jlipps
Copy link
Member

jlipps commented Aug 29, 2017

@TikhomirovSergey with java-client 5.0.1 released, should this be considered resolved?

@jlipps jlipps modified the milestones: Kay-Em 14 [Sprint 14], DOR-15 Aug 29, 2017
@SrinivasanTarget
Copy link
Member

@jlipps Yes this is fixed in latest java-client.

@SrinivasanTarget
Copy link
Member

@jlipps Nope, it isn't.

@TikhomirovSergey
Copy link

Guys, please close it. It was resolved here appium/java-client#682

@dpgraham dpgraham closed this as completed Sep 9, 2017
@lock
Copy link

lock bot commented Apr 25, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug a problem that needs fixing P0 W3C regarding W3C specification compliance
Projects
None yet
Development

No branches or pull requests

9 participants