-1

Code used: 1st Iteration:

line1. Functions.highlightelement(vertical_slider); //highlights the given xpath value
line2. browser.actions().dragAndDrop(vertical_slider,{x:0, y:-250}).perform(); // drag till certain position.

Error message in browser stack:

Failed: An invalid command argument was specified: Node handle not provided for 'Element' origin. It fails after clickandhold and mouse move.

2nd Iteration:
line1. Functions.highlightelement(vertical_slider); //highlights the given xpath value
line2. vertical_slider.click(); // click on the thumb element
line3. browser.actions().sendKeys(protractor.Key.ARROW_UP).perform();

Error message returned from browser stack server:

Failed: The command 'POST /session/7b14db2742b2b103dbbff0756957d2377c35f513/keys' was not found.

3rd iteration:

line1. Functions.highlightelement(vertical_slider); //highlights the given xpath value
line2. vertical_slider.click(); // click on the thumb element
line3. browser.actions().sendKeys(protractor.Key.chord(protractor.Key.CONTROL,'end'));

Error returned from browser stack server:

Failed: The command 'POST /session/7b14db2742b2b103dbbff0756957d2377c35f513/keys' was not found.

However it works well in Chrome Browser (OS x , WINDOWS) , MS EDGE browser (WINDOWS).

Any help on this.

jrswgtr
  • 2,079
  • 5
  • 14
  • 31
emp617
  • 1

2 Answers2

0

It looks like the error is caused by JsonWireProtocol commands being sent to a session initiated in the W3C WebDriver protocol.

You can use the browserstack capability browserstack.use_w3c to explicitly set the protocol to be used.

Rohan
  • 1
0

unlikely to solve the problem, but worth a try. I use this function

     /**
     * Drags first element to the second one
     * @param    {ElementFinder}        $element
     * @param    {(ElementFinder|{x: number, y: number})}       $destination
     * @returns  {promise.Promise}
     */
    dragAndDrop: ($element, $destination) => {
        return browser
            .actions()
            .mouseMove($element)
            .perform()
            .then(() =>
                browser
                    .actions()
                    .mouseDown($element)
                    .perform()
            )
            .then(() =>
                browser
                    .actions()
                    .mouseMove($destination)
                    .perform()
            )
            .then(() =>
                browser
                    .actions()
                    .mouseUp()
                    .perform()
            );
    }

just don't forget to await it

await dragAndDrop(vertical_slider,{x:0, y:-250})
Sergey Pleshakov
  • 5,833
  • 2
  • 10
  • 30