selenium测试问题
在学习selenium1案例时 OPen本址文件时报异常,查询在网上一直没找到原因:java代码
DefaultSelenium selenium=new DefaultSelenium("localhost", 4444, "*firefox C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe", "https://www.baidu.com/index.php?tn=monline_3_dg");
selenium.start();
selenium.open("C:\\Users\\daixiaofei\\Desktop\\test.html");
报出来的异常:
Exception in thread "main" com.thoughtworks.selenium.SeleniumException: ERROR: Command execution failure. Please search the user group at
https://groups.google.com/forum/#!forum/selenium-users for error details from the log window.The error message is: Component returned failure
code: 0x804b0012 (NS_ERROR_UNKNOWN_PROTOCOL)
at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:109)
at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:103)
at com.thoughtworks.selenium.DefaultSelenium.open(DefaultSelenium.java:369)
at Class1.main(Class1.java:11)
页面显示的错误:
http://img.bbs.csdn.net/upload/201705/17/1495024050_284893.png 地址改成file:///C:/Users/daixiaofei/Desktop/test.html yuyubill 发表于 2017-5-18 17:29
地址改成file:///C:/Users/daixiaofei/Desktop/test.html
试过了,还是有问题~~~ 网上找的方法都试过了~~ 建议了解pyswat框架,全程录制案例,不需要手写代码,自动生成测试case,回放即可实现自动化测试
页:
[1]