8000 Return MobileElement directly from AppiumDriver.findElement?() and findElements?() methods by prattpratt · Pull Request #62 · 8000 appium/java-client · GitHub
[go: up one dir, main page]

Skip to content

Return MobileElement directly from AppiumDriver.findElement?() and findElements?() methods#62

Me 8000 rged
Jonahss merged 3 commits intoappium:masterfrom
prattpratt:master
Jul 10, 2014
Merged

Return MobileElement directly from AppiumDriver.findElement?() and findElements?() methods#62
Jonahss merged 3 commits intoappium:masterfrom
prattpratt:master

Conversation

@prattpratt
Copy link
Contributor

I found out that we can make AppiumDriver to convert element Json representation directly to MobileElement rather than RemoteWebElement. So we don't need to wrap RemoteWebElement inside MobileElement but just use MobileElement as a rightful successor of RemoteWebElement.

Instead of:

MobileElement el1 = new MobileElement((RemoteWebElement)driver.findElementByAndroidUIAutomator("resourceId(\"android:id/content\")"), driver);

we can write down it in more simple way (as we used to) :

MobileElement el1 = (MobileElement) driver.findElementByAndroidUIAutomator("resourceId(\"android:id/content\")");

and also we can continue searching to find a child element under el1 (means use any methods available inside MobileElement class):

MobileElement el2 = (MobileElement) el1.findElementByAndroidUIAutomator("text(\"Accessibility\")");

@Jonahss
Copy link
Member
Jonahss commented Jul 10, 2014

Awesome! I didn't know about the setElementConverter function.
Thanks for updating that, AND the MobileCapabilities enums AND some tests.

I'm going to run all the tests, and add the methods described in #51 #55 #56 and publish a new version ^.^

@prattpratt
Copy link
Contributor Author

No problem!) Will be waiting for a new release.

Jonahss added a commit that referenced this pull request Jul 10, 2014
Return MobileElement directly from AppiumDriver.findElement?() and findElements?() methods
@Jonahss Jonahss merged commit e044b7c into appium:master Jul 10, 2014
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

Successfully merging this pull request may close these issues.

2 participants

0