Selenium Java navigation in an endless price chart

Viewed 27

I am trying to navigate to the left (past price data) but I cannot get it moving with selenium.

I tried

  Actions actions = new Actions(globalBrowsers.listOfBrowsers.get(0));
        actions.moveToElement(globalBrowsers.listOfBrowsers.get(0).findElement(By.tagName("body")), 0, 0);
        actions.moveByOffset(100, 0).clickAndHold().build().perform();
        actions.release();

but it does not work. I could not find online this kind of endless navigation.

As a user, I click and hold with the mouse then move to the right to get the historical price. I was thinking to use coordinates but don't know unfortunately how to do it.

Price Chart

ANSWER: I do not know how I did it but this worked. I targeted one element in the chart. Then I move the element back and forth I think. If someone can translate what I did right here can comment.

        List<WebElement> list = browserElementUtility.getExactElements("canvas", "class",
            "frame", globalBrowsers.listOfBrowsers.get(0));

    Actions actions = new Actions(globalBrowsers.listOfBrowsers.get(0));
    actions.moveToElement(list.get(0),200,0); 
    actions.clickAndHold().perform();
    actions.release();
    actions.moveToElement(list.get(0),-200,0);
    actions.clickAndHold().perform();
    actions.moveToElement(list.get(0),200,0);
    actions.clickAndHold().perform();
  
0 Answers
Related