public void File() throws Exception{
Thread.sleep(2000);
//更改JS
String js = "document.getElementsByClassName('update-avator')[0].style.bottom='0px';";
Thread.sleep(2000);
JavascriptExecutor jsExecutor = (JavascriptExecutor) driver;
Thread.sleep(2000);
jsExecutor.executeScript(js);
Thread.sleep(2000);
driver.findElement(By.className("js-avator-link")).click();
Thread.sleep(2000);
driver.findElement(By.id("upload")).sendKeys("C:\\Users\\sony\\Desktop\\软件测试顺序.jpg"); driver.findElement(By.linkText("确定")).click(); }报错如下:77行对应的是jsExecutor.executeScript(js); 。不仅如此,我在这段代码的里面加什么都会报错,加链接地址也跳不过去。也报空指针。
添加回答
举报
0/150
提交
取消