How to test a slider which uses javascrip touchmove event

Dear RF community, I have come here to enlighten my life.

I have encountered a problem for which I am looking for a solution.

Currently, I want to test a slider, which works basically the same way as the w3schools demo toucmove event.

If you open the site with devtools you can test the problem. If I use desktop mode and drag my cursor, it will select the paragraph text. If I use desktop (touch) mode and drag my cursor (or in this case my “finger”), it will trigger touchmove event.

Is there a way in Robot Framework to open Google Chrome in this touch mode and test the slider? I was thinking first about the mobile_emulator option, but if I understood correctly, it only changes the resolution?

Hi Dan,
I did not test it, but the Browser Library allow you to create Browser, Context and Page independently.
For Context, there is an option hasTouch:

hasTouch: Specifies if viewport supports touch events. Defaults to False.

This should solve your problem, I think.

Best,
Simon

Hi Simon,

Thank you, for pointing out Browser Library, I will check it out and test it :smile:

Edit:

Looks like it doesn’t work. I set up an environment to test it, and it looks like the problem is coming from a lack of touch gesture keywords or etc. Every browser action works like a mouse, but not like “touch”.

Still, thank you Simon for your time.

BR.
-Dan