Uh oh!
There was an error while loading. Please reload this page.
removed name locator strategy from android and ios drivers along with tests - #313
Conversation
| */ | ||
| public List findElementsByName(String using) throws WebDriverException{ | ||
| return super.findElementsByName(using); | ||
| } |
There was a problem hiding this comment.
...By.nane is still supported by browser automation tools
TikhomirovSergey
commented
Feb 5, 2016
Hi @SrinivasanTarget I'm against these changes as they are because:
@SrinivasanTarget What should be done if you want this PR get merged:
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.TYPE})
public @interface AndroidFindBy {
StringuiAutomator() default"";
Stringaccessibility() default"";
Stringid() default"";
@Deprecated/** * By.name selector is not supported by Appium server node since 1.5.x. * So this option is going to be removed further. Be careful. */Stringname() default"";
StringclassName() default"";
StringtagName() default"";
Stringxpath() default"";
}So users will be warned and they will have time to improve their projects before migration to 1.5.x. We will remove it later. But I still don't know which name options should be deprecated. @bootstraponline@imurchie is By.name deprecated for Selendroid? One more question. Why By.name is deprecated for iOS? iOS-elements have the name tag, I think. So the point
will be finished.
The target code is here: org.openqa.selenium.InvalidSelectorException: LocatorStrategy'css selector'isnotsupportedforthissession (WARNING: Theserverdidnotprovideanystacktraceinformation)is thrown and it is not being handled here. We should keep it backward compatible with Appium node 1.4x for some time. So you could improve this method the following way: 1 firstly it checks the excepion type. If it is org.openqa.selenium.InvalidSelectorException then method should return true. 2 if 1) has a negative result then it checks exception message. It could use regexps. If message is convenient to the previous pattern or LocatorStrategy'xxxr'isnotsupportedbla-bla-blathen then method should return true. 3 if both 1) and 2) have negative results then these steps are repeated recursively with the cause of exception. |
SrinivasanTarget
commented
Feb 5, 2016
Thanks @TikhomirovSergey for your time.Will update the descriptions going forward. And will update the PR based on your review comments. |
bootstraponline
commented
Feb 5, 2016
No. Even if it was deprecated (it isn't), we'd still want to wait for support to be removed from the server. If the server supports it then I don't see why clients should remove the feature. |
SrinivasanTarget
commented
Feb 5, 2016
Thanks for clarification. Will update my piece of code.
|
TikhomirovSergey
commented
Feb 6, 2016
@SrinivasanTarget |
SrinivasanTarget
commented
Feb 6, 2016
I'm still working on this. will update once it's done.
|
TikhomirovSergey
commented
Feb 6, 2016
ok |
SrinivasanTarget
commented
Feb 8, 2016
@TikhomirovSergey I have handled both the scenario's mentioned above.Please review. Also i have deprecated iOSFindBy "name" locator strategy. @imurchie Please correct me if i'm wrong. |
TikhomirovSergey
commented
Feb 9, 2016
@SrinivasanTarget I'm ok. 👍 |
imurchie
commented
Feb 9, 2016
Conceptually it looks fine. I can't comment on the Java code. |
@TikhomirovSergey please review