zoukankan      html  css  js  c++  java
  • ruby webdriver 启动chrome浏览器的一些小技巧

    一般情况下我们启动chrome浏览器是用:

    Selenium::WebDriver.for :chrome

    但是有时候当我们访问一些特殊页面时,比如页面会提示证书错误,popup弹窗,是否翻译这些问题,有些会影响对页面的操作

    只要在chrome的后面加上一个参数switches,问题就搞定了

    Selenium::WebDriver.for:chrome,:switches =>%w[--ignore-certificate-errors --disable-popup-blocking --disable-translate]

    参数的个数根据需要自己选填

    eg:

    dr = Selenium::WebDriver.for :chrome

    dr.get "http://jp.msn.com"

    这个时候会弹出是否翻译的信息

    使用Selenium::WebDriver.for:chrome,:switches =>%w[--ignore-certificate-errors --disable-popup-blocking --disable-translate] 就可以让页面显得很干净,简洁~

     

  • 相关阅读:
    列表和元组
    UVM宏
    UVM中重要函数
    组合模式(composite)
    装饰器模式(Decorator)
    适配器模式(Adapter)
    桥接模式
    原型模式(prototype)
    单例模式(singleton)
    UML类图
  • 原文地址:https://www.cnblogs.com/timsheng/p/2721557.html
Copyright © 2011-2022 走看看