Skip to content

Widget class cannot be in Groovy #340

Closed

Description

@aznime

Description

When creating a widget, code must be in Java. An illegal access exception is thrown if it is coded in Groovy.

Environment

  • java client build version or git revision if you use some shapshot: 3.3.0
  • Appium server version or git revision you is use some shapshot: 1.14.16
  • Desktop OS/version used to run Appium if necessary: OSX El Capitan (10.11.1)
  • Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe: 0.12.7
  • Mobile platform/version under test: iOS 9.2
  • Real device or emulator/simulator: Simulator

Exception stacktraces

https://gist.github.com/aznime/54263754d2a312ffb1bc

Activity

  1. TikhomirovSergey commented on Mar 15, 2016

    @TikhomirovSergey
    Contributor

    @aznime
    Could you share a gist with code of this class?
    com.jumbo.shared.widgets.PlayWidget

    It looks like a bug but I don't know how to reproduce it. Java client widget tests use objects with protected constructors and private/protected fields which are populated and everything is ok.

  2. TikhomirovSergey commented on Mar 15, 2016

    @TikhomirovSergey
    Contributor

    @aznime
    Also.
    How should I check it? Have you a Groovy project?

  3. aznime commented on Mar 16, 2016

    @aznime
    Author

    Sorry for the late reply. I was trying to create a demo project for this purpose.

    You can find it here: https://github.com/aznime/jumbo-mobile-tests

  4. TikhomirovSergey commented on Mar 16, 2016

    @TikhomirovSergey
    Contributor

    @aznime
    Thank you. I've started to search for the root cause of the error.

  5. TikhomirovSergey commented on Mar 17, 2016

    @TikhomirovSergey
    Contributor

    @aznime
    Ok. It seems I know the root cause. I think that cglib and reflection are not used properly at some cases and I'm going to fix it.

    As a workaround I can advice you to change class modifiers to public.

    public class UICatalogWidget extends Widget {
    ...
    }

    Can you do it and send a message about the result.

  6. aznime commented on Mar 18, 2016

    @aznime
    Author

    @TikhomirovSergey
    I got the same exception after explicitly using the public modifier.

  7. added this to the 3.4.x-4.0.0 milestone on Mar 22, 2016
  8. TikhomirovSergey commented on Mar 23, 2016

    @TikhomirovSergey
    Contributor

    @aznime
    The fix is going to be included at 3.4.1 very soon!

  9. added a commit that references this issue on Mar 27, 2016
  10. TikhomirovSergey commented on Mar 27, 2016

    @TikhomirovSergey
    Contributor

    The fix has been merged and it is going to be published

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions