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

Make findElement return MobileElement #162

Closed
alexec opened this issue Mar 4, 2015 · 5 comments
Closed

Make findElement return MobileElement #162

alexec opened this issue Mar 4, 2015 · 5 comments

Comments

@alexec
Copy link

alexec commented Mar 4, 2015

I noticed in a presentation yesterday that they almost always casted to MobileElement. As MobileElement appears to be a sub-class of WebElement, you can modified the return type of findElement* to return MobileElement.

This would be backwards compatible.

If we want to get technical, we are dealing with covarient return types:

http://c2.com/cgi/wiki?CovariantReturnTypes

@Jonahss
Copy link
Member

Jonahss commented Mar 4, 2015

I totally agree!
For some reason when I tried to override the method originally I ran into compilation errors, but looking at it now it seems fine.

Care to submit a Pull Request?

@TikhomirovSergey
Copy link
Contributor

I think the better way is to propose PR to Selenium project. I've got the great idea how to implement this. If this PR will be rejected then it is easy to override find methods here.

So I think we should work on both these directions (I'm sorry for my English).

@TikhomirovSergey
Copy link
Contributor

PR proposed to Selenium: SeleniumHQ/selenium#327
If you consider that it is good please vote for this.

@Jonahss
Copy link
Member

Jonahss commented Mar 9, 2015

Great!
I've found that mentioning your pull request on the #selenium irc can get it merged quicker ^.^

@TikhomirovSergey
Copy link
Contributor

I thick this ticket should be closed

@Jonahss Jonahss closed this as completed Jun 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants