Skip to content

[Enhancement] Spring configuration, beans and aspects vs EventFiringWebdriver  #242

Closed

Description

@TikhomirovSergey

The Selenium project has an interesting solution,
EventFiringWebDriver:

Everything is cool but I think there are disadvantages for Appium users:

  • this implementation restricts the using of mobile-specific functions till
AppiumDriver d = (AppiumDriver) eventFiringWebDriver.getWrappedDriver();

The same is true for elements

MobileElement e = (MobileElement) ((WrapsElement) element).getWrappedDriver();
  • almost all interfaces which are nested in WebDriver has protected/private implementations here. So an end user has to duplicate the present code when there is need to extend it

What is supposed to be designed:

  • it is supposed that the WebDriverEventListener interface will be reused. Also it would be cool if there were interfaces whose implementations allow to listen to (optionally) events of alerts, windows, contexts and so on.
  • To design a solution which has linear architecture. It would be cool to use Spring & AspectJ here.
    http://www.mkyong.com/spring3/spring-aop-aspectj-annotation-example/

Activity

  1. Gpap84 commented on Sep 15, 2015

    @Gpap84
    Contributor

    Isn't it very strict to depend on Spring and AspectJ for proxifying objects for logging and other features?

  2. TikhomirovSergey commented on Sep 15, 2015

    @TikhomirovSergey
    ContributorAuthor

    @GiannisPapadakis
    Why not? :)

    It would be good to have same AndroidDriver/IOSDriver or MobileElement with subclasses that also provide an ability to log events implicitly. Spring and AspectJ provide ability to create proxies of whole classes (not only interfaces) and implement that logging architecture in transparent and linear style.

    There are probably another suitable tools...

  3. Gpap84 commented on Sep 15, 2015

    @Gpap84
    Contributor

    It is ok with this solution of course. There are a lot of possibilities for Spring AOP to cover. You need of course to have a bean lifecycle. I could try some examples and review together if you want.

  4. TikhomirovSergey commented on Sep 15, 2015

    @TikhomirovSergey
    ContributorAuthor

    @GiannisPapadakis
    So do you consider that Spring could be more widely used in java_client? You are right definitely. The logging is just the most obvious capability :)

  5. Gpap84 commented on Sep 15, 2015

    @Gpap84
    Contributor

    Of course it would be great to have Spring features into java_client. But careful design should be approached in order to expose ApplicationContext and referenced beans correctly.

  6. TikhomirovSergey commented on Sep 15, 2015

    @TikhomirovSergey
    ContributorAuthor

    Ok. I've got and this will be kept in mind.
    For now this feature is being just imagined. Also there is some dependency on few PR's to Selenium...

  7. added this to the 4.0.0 milestone on Mar 7, 2016
  8. modified the milestones: 4.1.0, 4.0.0 on Apr 21, 2016
  9. added a commit that references this issue on Jul 19, 2016
  10. added 8 commits that reference this issue on Jul 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions