首次使用Google Charts API,以及我所拥有的所有内容,我认为它有效。但是,当我查看Chrome控制台时,收到错误消息 public void pressByElements(By by, int num) throws IOException, InterruptedException {
List<WebElement> el = driver.findElements(by);
TouchAction action = new TouchAction(driver);
action.press(el.get(num)).waitAction(2000).perform();
}
。试图四处寻找可能发生的事情,但我无法弄明白。
如果它有帮助,here是我基于这个教程的教程。
这是我的代码:
invalid row type for row 0
任何帮助将不胜感激!谢谢!
答案 0 :(得分:3)
你在gdata中忘记了周围的[] 应该是
var gdata = google.visualization.arrayToDataTable([['TurbTemp_F'], ['45.68'], ['45.68'], ['45.86'], ['45.86'], ['45.86'], ['45.86'], ['45.86'], ['45.86'], ['45.86'], ['45.5'], ['45.5'], ['45.68'], ['45.86'], ['45.86'], ['46.04'], ['46.22'], ['46.4'], ['46.58'], ['46.58'], ['46.76'], ['46.94'], ['47.12'], ['47.12'], ['47.3'], ['47.66'], ['47.66'], ['47.66'], ['47.84'], ['48.02'], ['48.02'], ['48.02'], ['48.2'], ['48.38'], ['48.74'], ['48.74'], ['48.92']]);
这会产生另一个错误&#34;没有足够的列来绘制所请求的图表。&#34;我添加了另一列,然后将错误值作为字符串,所以我最终得到了
var gdata = google.visualization.arrayToDataTable([['Day','TurbTemp_F'], ['1',45.68], ['2',45.68], ['3',45.86], ['4',45.86], ['5',45.86], ['6',45.86], ['7',45.86]]);