#39: Change Available Time Slots (Selenium Advanced User Interactions)
Drag the time slider using Selenium’s Advanced User Interactions API.
Learning Objectives
Introduce Selenium’s Advanced User Interactions (AUI) API.
So far we have been performing simple user operations such as clicking a button (mouse) and entering text (keyboard). How about more complex ones, such as drag-n-drop? We can do that with Selenium’s Advanced User Interactions.
Knowledge Point: Selenium Advanced User Interactions
While there is the word ‘advanced’ in Selenium’s AUI, its syntax is still quite simple:
driver.action.
+ one or more above operations + .perform
Mouse operations:
click
click_and_hold
context_click
double-click
drag_and_drop
drag_and_drop_by
move_by
move_to
release
Keyboard operations:
key_down
key_up
send_keys
In this exercise, we will just focus on one: drag_and_drop_by
.
Test Design
Italicised text means we have completed them in the previous exercise.
Navigate to the business booking page, which we have done many times in previous exercises.
Click tomorrow’s date
Assert the time slots.
Drag the start time slider to narrow the start time range, no matter which direction.
Click the blue tick button (above the slider) to apply
Assert the available time slots again, shall be less.
Test Data (Login) :
Site URL: https://whenwise.agileway.net
Login (Customer): james@client.com
Password: test01
The business for booking: Wise Tutor. https://whenwise.agileway.net/biz/wise-tutoring
Tasks
Task 1: Drag the start time slider
Keep reading with a 7-day free trial
Subscribe to AgileWay’s Test Automation & Continuous Testing Blog to keep reading this post and get 7 days of free access to the full post archives.