51Testing软件测试论坛

标题: java+selenium学习过程中遇到的问题 [打印本页]

作者: wan376913527    时间: 2015-12-14 17:03
标题: java+selenium学习过程中遇到的问题
package test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class GetUrlAndTitle {
        public static void main(String []args)
        {
                String url="www.baidu.com";
                WebDriver driver =new FirefoxDriver();
                driver.get(url);
                String Title=driver.getTitle();
                String currentUrl=driver.getCurrentUrl();
                System.out.print(Title+"\n"+currentUrl);
               
        }

}
报错:Exception in thread "main" org.openqa.selenium.WebDriverException: f.QueryInterface is not a function
解决方案:String url="www.baidu.com";=》String url="http://www.baidu.com";
作者: fhhh_eyou    时间: 2015-12-14 19:19
Exception in thread "main" org.openqa.selenium.WebDriverException: f.QueryInterface is not a function
解决方案:WebDriver driver =new FirefoxDriver();定义错误
作者: 大于细~难于易    时间: 2015-12-17 22:01
这个遵循http的协议,是要写完整,我的粗见,不对忘指出




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2