Skip to content

Common interface for By and jQueryBy #104

Open

Description

@SeriousM

Hi,

is it possible to have a common interface for TestStack.Seleno.PageObjects.Locators.By and TestStack.Seleno.PageObjects.Locators.By+jQueryBy?

The problem is that working with these selectors in a more abstract way is just tedious when we have to implement each functionality twice just to support both types.

Cheers

Activity

  1. robdmoore commented on Sep 26, 2013

    @robdmoore
    Member

    We can't have a common interface that both implementations implement, but we could certainly have a wrapper over the top that delegates to either the selenium version or the jQuery version depending on which method you selected. Might be a bit of fiddling around, but it probably would simplify a lot of our code since we have a lot of duplicate implementations currently.

    Would be a big breaking change so if we do want to do it then now is the time. Thoughts @MehdiK / @mwhelan / @JakeGinnivan?

  2. SeriousM commented on Sep 26, 2013

    @SeriousM
    Author

    ...but we could certainly have a wrapper over the top that delegates to either the selenium version or the jQuery version depending on which method you selected.

    That is exactly the same as I did now already. The problem here is that every time someone is facing this problem he/she has to do the same thing.
    I would prefer to DRY this on the framework side.
    Thanks

  3. MehdiK commented on Sep 26, 2013

    @MehdiK
    Member

    I think this is a good idea that will piss off a lot of users ;) but perhaps a worthwhile breaking change.

  4. SeriousM commented on Sep 26, 2013

    @SeriousM
    Author

    Great! When can we get it? :)
    Am 26.09.2013 19:22 schrieb "Mehdi Khalili" notifications@github.com:

    I think this is a good idea that will piss off a lot of users ;) but
    perhaps a worthwhile breaking change.

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/104#issuecomment-25186317
    .

  5. SeriousM commented on Sep 27, 2013

    @SeriousM
    Author

    Hey, I think I have an easy solution to that: jQuery selector can select for css, id and everything else. Why not just offering jQuery usage and thats it? All older usages can be marked as obsolete.
    What do you think about that?

  6. robdmoore commented on Sep 27, 2013

    @robdmoore
    Member

    Ill be honest; my personal preference is to not do that - I don't want to tie Seleno's search language to jQuery - as much as I love it I think it should also have an ability to be agnostic from it, plus I think the By.Id and By.ClassName are more readable on those situations personally.

    Happy for others to disagree with me though...

  7. SeriousM commented on Sep 27, 2013

    @SeriousM
    Author

    Well, using only jQuery does not mean that the method By.ClassName should be removed. It would then just act as jQuery("." + selector) 😄
    But you are right, it should play well in all sandboxes, not just on the cool ones.

  8. MehdiK commented on Sep 27, 2013

    @MehdiK
    Member

    I personally only use jQuery. The reason is that there are going to be elements I cannot select using Selenium selectors which means I do have to use jQuery. So I just keep it consistent and go all the way jQuery.

    WRT working on all sandboxes, if you use jQuery selector, even if you're not using jQuery in your website, we inject it to your page so your selector works.

    I personally think there should be one By selector that has everything the current By offers as well as a jQuery method.

  9. SeriousM commented on Dec 2, 2013

    @SeriousM
    Author

    hi! is there any update on this issue? I've noticed there is a new major release 8.1?

  10. robdmoore commented on Dec 2, 2013

    @robdmoore
    Member

    Hi @SeriousM. We haven't addressed this issue yet - you will more than likely reference this issue number in the commits when we do :)

    We released the 0.8 version this weekend just gone, which includes a version update for selenium web driver and also some new functionality to automatically take screenshots and log a message when there is an error within Seleno. We haven't blogged about it yet to explain the changes, but I imagine one of us will get around to it at some point :)

    Not sure when we will address this issue. How important is it for you? If it's causing you a lot of grief we can try and prioritise it higher?

  11. SeriousM commented on Dec 2, 2013

    @SeriousM
    Author

    Not sure when we will address this issue. How important is it for you? If it's causing you a lot of grief we can try and prioritise it higher?

    we managed to get a common selector-factory to create a by-selector-wrapper but when it comes to get the right underlying by-selector, its just a pain ita. a higher priority would be awesome ;)

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions