Code Monkey home page Code Monkey logo

Comments (13)

bootstraponline avatar bootstraponline commented on May 14, 2024

This is a workaround however an empty hash is returned instead of the expected WebDriver element.

> a = $driver.execute_script "au.lookup('secure').concat(au.lookup('textfield'));"
post
session/c208210e-59b3-4e58-bbb1-47b6feb5cd38/execute
{"script":"au.lookup('secure').concat(au.lookup('textfield'));","args":[]}
=> [{}, {}]
> a.first.value
NoMethodError: undefined method `value' for {}:Hash
> a
=> [{}, {}]
> a.first
=> {}
> a.first.class
=> Hash

from appium.

bootstraponline avatar bootstraponline commented on May 14, 2024

This sort of works, however it doesn't let me combine lookups.

s = %(
var e = au.lookup('textfield');
au._returnElems(e);
)

execute_script s

from appium.

bootstraponline avatar bootstraponline commented on May 14, 2024

I figured it out.

s = %(
var t = au.lookup('textfield');
var s = au.lookup('secure');
var r = $(t.concat(s));
au._returnElems(r);
)

execute_script s

from appium.

bootstraponline avatar bootstraponline commented on May 14, 2024

This is what I had to do to get textfield working cross platform.

from appium.

jlipps avatar jlipps commented on May 14, 2024

That's a clever workaround, however it would be nice to support | in the subset of xpath syntax. I'm confused why you didn't get a more meaningful error--you should have gotten something like "XPath selector could not be parsed" or something like that. That's the first thing to fix, then we can talk about adding |.

from appium.

bootstraponline avatar bootstraponline commented on May 14, 2024

That's a clever workaround, however it would be nice to support |

I agree. I just need something working immediately.

That's the first thing to fix, then we can talk about adding |.

👍 I was surprised that it crashed.

from appium.

bootstraponline avatar bootstraponline commented on May 14, 2024

It doesn't crash anymore now.

from appium.

jlipps avatar jlipps commented on May 14, 2024

Does it give a nice error?

from appium.

bootstraponline avatar bootstraponline commented on May 14, 2024

Does it give a nice error?

Yes. It's slightly different on iOS and Android.

Selenium::WebDriver::Error::XPathLookupError: Could not parse xpath data from //textfield | //secure vs
Selenium::WebDriver::Error::XPathLookupError: An error occurred while searching for an element by XPath.

Much better than crashing.

from appium.

bootstraponline avatar bootstraponline commented on May 14, 2024

I think it might be better to turn this into a feature request by adjusting the issue title.

from appium.

DylanLacey avatar DylanLacey commented on May 14, 2024

Is this closed by f78cee9 et al?

from appium.

bootstraponline avatar bootstraponline commented on May 14, 2024

Yes

from appium.

lock avatar lock commented on May 14, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from appium.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.