a part of my Karate UI test is to select date range on calendar element. I was trying all possible ways, but unfortunatelly I'm failing with that. The calendar is pretty the same solution as on this site: https://automationintesting.online/ (you need to select "Book this room" and then the calendar shows up).
This is a scenario I wrote:
Scenario: Calendar drag&drop
Given driver 'https://automationintesting.online/'
And click("//button[text()='Book this room']")
And input("//input[@name='firstname']", "John")
And input("//input[@name='lastname']", "Doe")
And input("//input[@name='email']", "john@email.com")
And input("//input[@name='phone']", "00123456789")
And click("//button[text()='Next']")
And mouse().move("//button[text()='04']").down().move("//button[text()='05']").up()
Then click("//button[text()='Book']")
I also tried the solution suggested in this thread Karate UI drag and drop so for example:
* script("var myDragEvent = new Event('dragstart'); myDragEvent.dataTransfer = new DataTransfer()")
* waitFor("//button[text()='08']").script("_.dispatchEvent(myDragEvent)")
* script("var myDropEvent = new Event('drop'); myDropEvent.dataTransfer = myDragEvent.dataTransfer")
* script("//button[text()='09']", "_.dispatchEvent(myDropEvent)")
but it also didn't work.
Could anybody help me here?