varwebdriver=require('selenium-webdriver'),By=webdriver.By,until=webdriver.until;//chromevardriver=newwebdriver.Builder().forBrowser('firefox').build();//判断是否有登陆functionisLogin(driver){try{driver.findElement(By.id('loginForm'))returntrue}catch(error){returnfalse}}已经使用trycatch捕获,但还是会报错不执行下去了throwerror;^NoSuchElementError:Unabletolocateelement:*[id="loginForm"]selenium-webdriverjs版本的如何判断某个元素是否存在呢
相关分类