51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 1450|回复: 4

selenium测试问题

[复制链接]
  • TA的每日心情
    开心
    2018-2-1 08:40
  • 签到天数: 152 天

    连续签到: 1 天

    [LV.7]测试师长

    发表于 2017-5-18 15:48:01 | 显示全部楼层 |阅读模式
    在学习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) [nsIDOMLocation.href]
    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)


    页面显示的错误:
    回复

    使用道具 举报

  • TA的每日心情

    2017-12-25 09:39
  • 签到天数: 43 天

    连续签到: 1 天

    [LV.5]测试团长

    发表于 2017-5-18 17:29:20 | 显示全部楼层
    地址改成file:///C:/Users/daixiaofei/Desktop/test.html

    评分

    参与人数 1测试积点 +10 收起 理由
    lsekfe + 10 积极回复获得测试积点10 赶快去商城换取奖.

    查看全部评分

    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    开心
    2018-2-1 08:40
  • 签到天数: 152 天

    连续签到: 1 天

    [LV.7]测试师长

     楼主| 发表于 2017-5-22 11:13:09 | 显示全部楼层
    yuyubill 发表于 2017-5-18 17:29
    地址改成file:///C:/Users/daixiaofei/Desktop/test.html

    试过了,还是有问题~~~ 网上找的方法都试过了~~
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    开心
    2018-3-30 09:35
  • 签到天数: 172 天

    连续签到: 6 天

    [LV.7]测试师长

    发表于 2017-6-1 15:16:23 | 显示全部楼层
    建议了解pyswat框架,全程录制案例,不需要手写代码,自动生成测试case,回放即可实现自动化测试
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-3-28 18:14 , Processed in 0.067309 second(s), 26 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表