Selenium webdriver(Javascript)和phantomjs等元素定位不起作用

时间:2016-04-05 19:48:15

标签: javascript selenium-webdriver phantomjs

var phantom = require('phantomjs-server');
const By = require('selenium-webdriver').By;

driver.wait(until.elementLocated(By.css(".button1")), 30000);

var quoteButton = driver.findElement(By.css(".button1"));
quoteButton.click();

等待条件后截屏显示屏幕截图中没有button1。测试仍然进入下一步点击按钮。我收到一个错误:

ElementNotVisibleError: {"errorMessage":"Element is not currently visible and may not be manipulated","request":{"headers":{"Accept":"application/json; charset=utf-8","Connection":"close","Content-Length":"2","Content-Type":"application/json;charset=UTF-8","Host":"127.0.0.1:4444"},"httpVersion":"1.1","method":"POST","post":"{}","url":"/click","urlParsed":{"anchor":"","query":"","file":"click","directory":"/","path":"/click","relative":"/click","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/click","queryKey":{},"chunks":["click"]},"urlOriginal":"/session/5e123bd0-fb66-11e5-8858-123/element/:wdc:1459885290612/click"}}

0 个答案:

没有答案