You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I may just be retarded here, but I'm going a bit loco with this problem of mine. I'm trying to manipulate a DOM element in the browser with .execute('my code', [myElement]) and failing miserably with wd-sync.
var elem = browser.elementByCssSelector('h1');
console.log(elem);
browser.execute('arguments[0].className += " hidden"', [elem]);
The vanilla wd code adds the class as suspected, while the wd-sync code halts execution without errors (equivalent to a process.exit()) without doing anything with the DOM.
I can do browser.execute('console.log(arguments)', [3, 'nice', 'arguments']); with wd-sync, but as soon as I try to pass an element along, it breaks down.
I note that the console.log(el) output is significantly different between the two. Vanilla wd:
Okay, I've located the problem. It's the automagic wrapping of returned elements mangling the original element so that wd breaks when receiving this wrapped thingamjig. I'm creating a work-around and adding a pull request shortly.
Hey :)
I may just be retarded here, but I'm going a bit loco with this problem of mine. I'm trying to manipulate a DOM element in the browser with .execute('my code', [myElement]) and failing miserably with wd-sync.
Working code with vanilla wd:
Equivalent non-working wd-sync code:
The vanilla wd code adds the class as suspected, while the wd-sync code halts execution without errors (equivalent to a process.exit()) without doing anything with the DOM.
I can do
browser.execute('console.log(arguments)', [3, 'nice', 'arguments']);
with wd-sync, but as soon as I try to pass an element along, it breaks down.I note that the
console.log(el)
output is significantly different between the two. Vanilla wd:And wd-sync:
What's going wrong here?
Thanks :)
FYI: When using vanilla wd I'm using the module that is pulled in by wd-sync's package.json, so it's the same underlying code.
The text was updated successfully, but these errors were encountered: