Uh oh!
There was an error while loading. Please reload this page.
Generic AppiumDriver #178 #162 fix - #182
Conversation
TikhomirovSergey
commented
Apr 2, 2015
TikhomirovSergey
commented
Apr 2, 2015
It would be cool to resolve the issue 147 before the new release... |
bootstraponline
commented
Apr 6, 2015
I'll rely on @Jonahss for a detailed review. I'm not sure that the test code is any cleaner as a result of this. I see |
TikhomirovSergey
commented
Apr 6, 2015
Ok @bootstraponline WebElemente = driver.findElement(By.id("id"));
List<WebElement> e2 = e.findElements(By.id("id2"));I can improve test code if it is really needed. I think it is better to replace ? by WebElement. |
Jonahss
commented
Apr 6, 2015
I'm still concerned with the need to do casting on the "chains" of finding. It's unpredictable to have to cast in that case, whereas always casting is annoying but predictable. |
TikhomirovSergey
commented
Apr 6, 2015
Ok. then I will think about the way to improve this... List<MobileElement> l = e.findElements(By.id("id2"));? As you can see it is possible. :) It is the worst case scenario. Actually I am going to look for the solution that is compatible with current user projects. |
TikhomirovSergey
commented
Apr 7, 2015
It seems that I have found the acceptable solution:
So by default users will work as usual: AppiumDriver<?> driver;
//some actionsWebElemente = driver.findElement(By.id("id"));
List<WebElement> l = driver.findElements(By.id("id"));or AppiumDriver<WebElement> driver;
//some actionsWebElemente = driver.findElement(By.id("id"));
List<WebElement> l = driver.findElements(By.id("id"));But user can choose the desired type. WebElement, TouchableElement, RemoteWebElement, MobileElement or subclasses are allowed. So when they will choose something that differs from WebElement then: AppiumDriver<MobileElement> driver;
//some actionsMobileElemente = driver.findElement(By.id("id"));
List<MobileElement> l = driver.findElements(By.id("id"));
MobileElemente1. = e.findElement(By.id("id2"));
List<MobileElement> l = e.findElements(By.id("id2"));Everything is ready for commit. @Jonahss What do think about this? Is it ok? |
Jonahss
commented
Apr 7, 2015
Ooh yeah I like that ^.^ |
bootstraponline
commented
Apr 7, 2015
I like the changes 👍 |
TikhomirovSergey
commented
Apr 7, 2015
@Jonahss When you will check this please change Java compiler to "Eclipse" if you use IDEA or download Eclipse Luna if you are Eclipse user. I advice you to perform these (for the checking) following:
Actually I did the same and everything were cool. But you can do it to be sure that all is fine. Please let me know if something is wrong. This is one of the most uncommon tasks I've ever tried to resolve :) The similar thing is going to be proposed to С#. |
Jonahss
commented
Apr 7, 2015
Haha yeah it's definitely a doozy of a Java task ;) Someday I still think it could be nice to start fresh. On Tue, Apr 7, 2015 at 2:46 PM, Sergey Tikhomirov notifications@github.com
|
TikhomirovSergey
commented
Apr 7, 2015
Soon I will provide one more commit... It is about pom.xml settings |
TikhomirovSergey
commented
Apr 7, 2015
I've improved pom.xml. So let's have fun :)) |
in order to avoid the conflict with another PR
TikhomirovSergey
commented
Jun 9, 2015
Yeah! Required changes are on Selenium side now. (on behalf of Sergey Tikhomirov) Refactored PageFactory implementation, including a number of changes to make it more extensible and more robust.... I am going to propose a PR on this week or the beginning of the next! |
Jonahss
commented
Jun 9, 2015
Oh super awesome. On Tue, Jun 9, 2015 at 2:52 PM, Sergey Tikhomirov notifications@github.com
|
TikhomirovSergey
commented
Jun 9, 2015
Sorry. I have made a mistake. Another ticked has to be commented with my previous reply :)))) |
Jonahss
commented
Jun 10, 2015
Oops, yeah I see it. On Tue, Jun 9, 2015 at 3:25 PM, Sergey Tikhomirov notifications@github.com
|
RohitBandi
commented
Jun 23, 2015
Hi All, Can you guys help me with dot net code samples after this change with generics for AppiumDriver. I Stuck and don't know how to proceed further. Or suggest changes for below piece of code using System; namespace ConsoleApplication1 } Thanks |
Jonahss
commented
Jun 23, 2015
Could you post your issue to the dot net client repository then? this is On Tue, Jun 23, 2015 at 11:09 AM, RohitBandi notifications@github.com
|
fayizkc
commented
Aug 25, 2015
is it possible to create driver object with WebDriver, |
The major change:
AppiumDriver is generic now and by default its finders return WebElement (it is for backward compatibility)
Possible drawbacks and backward compatibility issues:
"Rawtype" warnings. This issue is resolved by the infering of a type that implements/extends WebElement or via the suppressing of warnings like that
This solution requires IDEA (Community Edition is enough) that supports Eclipse compiler. It is compatible with Eclipse Luna or higher. It is better to use Maven v3.2.5 (I'm not sure. It is possible that minimal required version is lower. Actually I just use this version.) or higher when there is necessity to perform the local building.
The built *.jar is copmatible wits both IDEs (Eclipse can be older than Luna) without special settings:
IDEA
Eclipse
Additional changes
@Jonahss@bootstraponline
Please review this carefully. There is no need to hurry :) If these changes will be accepted I think that next version number should be 3.0