[Haskell-cafe] webdriver and click via executeJS
wuzzeb at gmail.com
Fri Dec 11 18:37:18 UTC 2015
I have this problem all the time and it is pretty anoying. The problem is
executeJS is returning `()`. The aeson instance for `()` does not parse
null. What I do is something like
someOper :: WD ()
ret <- executeJS [...] "...]
maybe (return ()) return ret -- parse value from executeJS as Maybe ()
On Fri, Dec 11, 2015 at 11:48 AM, Denis Shevchenko <haskell at dshevchenko.biz>
> Hi there!
> I use `webdriver` package for test automation with PhantomJS. And I need
> to click some button, but not with a `click` function, but with a native
> JS. I see a special function for such a task, `executeJS`, in the module
> `Test.WebDriver.Commands`. So this is my code:
> button <- findElement . ById $ "clearCart"
> info <- elemInfo button
> executeJS [JSArg info] "arguments.click();"
> But I got a runtime error:
> BadJSON "when expecting a (), encountered Null instead"
> How can I fix it?
> - Denis
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe