I want to know if Oxygen supported to action ‘drag and drop’ .
Is this for mobile or web (desktop browser) tests?
Its for web application tests.
Drag and Drop functionality is not exposed currently through Oxygen (we will add it in the next version).
But it’s possible to use the underlying webdriver directly.
This will drop grey rectangle into red square. You’ll see “Dropped” written in one of the edit fields after the rectangle was dropped.
dragAndDrop command receives locator for the element you want to drop as first argument, and the locator of the element where to drop to as second argument.
Note that locators here are not Oxygen locators. If you want to find element by ID then prepend # to the id (like the first argument in the example bellow). XPath (like the second argument in the example below) is identical to how it’s used in Oxygen.
web.init(); web.open('http://webdriverjs.christian-bromann.com/'); web.driver().dragAndDrop('#overlay', '/html/body/section/div'); web.pause(10000);
Code sample is working
The code described is working correctly
I tried the code and got the following error. Is there something else I need to do?
Starting iteration #1
SCRIPT_ERROR - web.driver(…).dragAndDrop is not a function at line 3
Test finished with status --> FAILED
I figured it out. I read the docs
Hi Roman, drag and drop is currently supported in Oxygen, right?
Yes, it was updated due to this request
One more update:
The webdriverio commands can be executed using the following command
The old command -web.driver().has been depricated
we will update the documentation soon