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

Using xPath to locate elements #197

Closed
aamorozov opened this issue Jul 13, 2017 · 10 comments
Closed

Using xPath to locate elements #197

aamorozov opened this issue Jul 13, 2017 · 10 comments

Comments

@aamorozov
Copy link

No description provided.

@isnifer
Copy link
Contributor

isnifer commented Jul 13, 2017

@aamorozov what cases you need to use XPath?

@aamorozov
Copy link
Author

aamorozov commented Jul 13, 2017

@isnifer
Looking into this framework for the second day and haven't seen something that i got used to in appium, hence the question;

Sometimes it might be simpler to map to the container and iterate the same children items such as checkboxes, or accordions, rather than adding testIDs to all of them.

@rotemmiz
Copy link
Member

Take a look in this issue, #188, it might answer some of your questions

@aamorozov
Copy link
Author

aamorozov commented Jul 13, 2017

@rotemmiz @isnifer

Thanks guys, I was asking if smth like element(by.xpath()) would work, but it doesn't seem like detox matchers have this method.

 TypeError: by.xpath is not a function

@isnifer
Copy link
Contributor

isnifer commented Jul 13, 2017

@aamorozov don't forget - xpath soooo sloooow instead of testIDs. I don't see iterate over testIDs.
In our app we are using detox for iOS tests and Appium for Android (I wrote a wrapper for both frameworks). All tests except tests with webview are using testIDs without problems

@aamorozov
Copy link
Author

@isnifer Yep, I'm aware of difference between those two in speed of locating element. I am also using appium for android, right now leveraging detox for ios builds. Is it a public project that you're using the wrappers on ?

@aamorozov
Copy link
Author

@isnifer
Oh and actually to avoid piling up the issues, do you know if there is similar to findElementsBy() method for locating multiple elements, storing them in array and then do whatever you need to do with them ? Haven't found it in the docs

@aamorozov aamorozov changed the title Is there a way to use xPath to locate the elements ? Using xPath to locate elements Jul 28, 2017
@hungbm
Copy link

hungbm commented Sep 14, 2017

@isnifer

All tests except tests with webview are using testIDs without problems

Would you care to elaborate meaning of this? I having problem with check Webview visible.
My Webview is open a PDF file that I store inside application storage, but some how I can not get "pass" the test.

Specify: detox stuck at await expect(testIDofWebView).toBeVisible(); and then throw
Error: Timeout of 120000ms exceeded. For async tests and hooks, ensure "done()" is called; ifreturning a Promise, ensure it resolves.. It happened with all PDF link (open PDF file, no mater it on the internet or local storage).

However, if I use Webview to open a website (like google.com or facebook) then the test pass as normal. Should this is a bug?

@isnifer
Copy link
Contributor

isnifer commented Sep 15, 2017

@hungbm can you create a small repo to reproduce it? And we will work together on tests for it.

@rotemmiz
Copy link
Member

We have no plans of implementing xpath support at the moment.

@wix wix locked and limited conversation to collaborators Jul 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants