etaoin

Carlo Jessurun 2020-03-15T19:29:30.001400Z

Hey all, short question about xpaths here:

Carlo Jessurun 2020-03-15T19:30:34.002800Z

Say I have the following two xpaths i’m working with and I want to check if ONE of those exists. I know one of the will be there but this can swap be pretty random in the application i’m testing. So if we have the following code:

(def comment-box "/div[2]/ul")
(def picture-box "/div[3]/ul")
(wait-visible driver {:xpath comment-box})
OR
(wait-visible driver {:xpath picture-box})

Carlo Jessurun 2020-03-15T19:30:56.003300Z

What will happen here is that the first one might fail while the second one is actually there

Carlo Jessurun 2020-03-15T19:31:11.003600Z

Is it possible to use a solution like this: https://stackoverflow.com/questions/5350666/xpath-or-operator-for-different-nodes in Etaoin?

Carlo Jessurun 2020-03-15T19:31:33.004100Z

Or did someone else find a solution to a similar issue?