scroll/move to element API

21 views
Skip to first unread message

davide moro

unread,
Oct 14, 2016, 6:36:16 AM10/14/16
to splinter-developers, dm...@tierratelematics.com
Hi,

we have an application that does something only if the element is visible (eg: click on a badge for selecting it). Basically if you click on that selector nothing happens, if you scroll to the element and click the select occurs.

How do you suggest to solve this problem with splinter?
* use "splinter.execute_script" and use javascript in order to scroll to the target element
* is there any splinter API avoiding javascript execution?

Thanks in advance.

Cheers,

davide

Hugo Lopes Tavares

unread,
Oct 14, 2016, 6:36:19 PM10/14/16
to splinter-...@googlegroups.com, dm...@tierratelematics.com
Hello Davide,

Would using the `mouse_over` element method work? I am not sure if that will do a scroll event. I was thinking about something like:

btn = browser.find_by_css('#btn')
btn.mouse_over()
btn.click()


Not sure if this works for your case but would give it a try.

--
You received this message because you are subscribed to the Google Groups "splinter-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to splinter-developers+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

davide moro

unread,
Oct 17, 2016, 11:51:01 AM10/17/16
to splinter-...@googlegroups.com, dm...@tierratelematics.com
Hi Hugo,

thanks for your reply.

I've tried with mouse_over but I get this problem:

(Pdb) self.find_element(strategy, locator)
<splinter.driver.webdriver.WebDriverElement object at 0x7f7c0c163610>
(Pdb) self.find_element(strategy, locator).mouse_over()
*** WebDriverException: Message: POST /session/28b4d082-558a-400a-a0f9-caec481045dd/moveto did not match a known command

I've seen something similar using selenium but it doesn't seem to be compatible with splinter:
* http://stackoverflow.com/questions/8252558/is-there-a-way-to-perform-a-mouseover-hover-over-an-element-using-selenium-and

I hope there is a better way using APIs and not js.

Thanks.

Any hint would be very appreciated.

Cheers,

davide



To unsubscribe from this group and stop receiving emails from it, send an email to splinter-developers+unsubscribe...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "splinter-developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/splinter-developers/yJh9i8oYosg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to splinter-developers+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Andrews Medina

unread,
Oct 17, 2016, 12:32:29 PM10/17/16
to splinter-...@googlegroups.com, dm...@tierratelematics.com
Hi Davide,

what is the driver and the Splinter version are you using?

Regards,
>>> email to splinter-develo...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "splinter-developers" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/splinter-developers/yJh9i8oYosg/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> splinter-develo...@googlegroups.com.
> --
> You received this message because you are subscribed to the Google Groups
> "splinter-developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to splinter-develo...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Andrews Medina
www.andrewsmedina.com

davide moro

unread,
Oct 17, 2016, 12:36:47 PM10/17/16
to splinter-...@googlegroups.com, dm...@tierratelematics.com
Hi Andrews,

Splinter 0.7.4 (latest) and Firefox (49.0 with Marionette).

Cheers,

davide



>>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "splinter-developers" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/splinter-developers/yJh9i8oYosg/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to

>> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> --
> Linkedin: https://it.linkedin.com/in/davidemoro82
> Twitter: https://twitter.com/davidemoro
> Blog: http://davidemoro.blogspot.it/
>
> --
> You received this message because you are subscribed to the Google Groups
> "splinter-developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an

> For more options, visit https://groups.google.com/d/optout.



--
Andrews Medina
www.andrewsmedina.com

--
You received this message because you are subscribed to a topic in the Google Groups "splinter-developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/splinter-developers/yJh9i8oYosg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to splinter-developers+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages