zoukankan      html  css  js  c++  java
  • Selenium 2.0 WebDriver with Visual Studio, C#, & IE

    http://www.joecolantonio.com/2012/07/31/getting-started-using-selenium-2-0-webdriver-for-ie-in-visual-studio-c/

    http://blog.sina.com.cn/s/blog_b6142fb401017oo6.html

    Download Selenium C# Client Drivers
    The first step is to download the C# dlls from Selenium's web site.You'll also want to download the Internet Explorer Driver Server:Selenium <wbr>2.0 <wbr>WebDriver <wbr>with <wbr>Visual <wbr>Studio, <wbr>C#, <wbr>& <wbr>IE


    Configure Visual Studio to work with Selenium

    Selenium <wbr>2.0 <wbr>WebDriver <wbr>with <wbr>Visual <wbr>Studio, <wbr>C#, <wbr>& <wbr>IE

    Selenium <wbr>2.0 <wbr>WebDriver <wbr>with <wbr>Visual <wbr>Studio, <wbr>C#, <wbr>& <wbr>IE

    Selenium <wbr>2.0 <wbr>WebDriver <wbr>with <wbr>Visual <wbr>Studio, <wbr>C#, <wbr>& <wbr>IE

    Time to Code!

    Cool!! Now that we have the Selenium dlls referenced in our project, it's time to test the configuration by running a quick test.

    At the top of your project code after the last 'using' namespace add the following Selenium namespaces:

    Selenium <wbr>2.0 <wbr>WebDriver <wbr>with <wbr>Visual <wbr>Studio, <wbr>C#, <wbr>& <wbr>IE
    Run the test. joecolantonio.com should appear.

    IE Developer Toolbar

    If you are going to be scripting against IE you'll want to install the Internet Explorer Developer Toolbar. (Those familiar with QTP are aware that this is similar QTP's spy tool)

    Using the IE Dev's Arrow feature allows you to spy on an element's attributes. You can then use those attributes in your Selenium code to help identify fields in you web application.
    Selenium <wbr>2.0 <wbr>WebDriver <wbr>with <wbr>Visual <wbr>Studio, <wbr>C#, <wbr>& <wbr>IE

    For example if we want to navigate to www.joecolantonio.com/HpSupport.html and select a value from the 'Select your tool & Version' we would point the IE Dev arrow to the field to see its attributes:

    Selenium <wbr>2.0 <wbr>WebDriver <wbr>with <wbr>Visual <wbr>Studio, <wbr>C#, <wbr>& <wbr>IE

    WTF's to look out for

    If you getting the following error:

    "InvalidOperationException was unhandled – unexpected error launching Internet Explorer.Protected Mode setting are not the same for all zones.

    Enable Protected Mode must be set to the same value (enabled or disabled) for all zones"

    Selenium <wbr>2.0 <wbr>WebDriver <wbr>with <wbr>Visual <wbr>Studio, <wbr>C#, <wbr>& <wbr>IE

    Selenium <wbr>2.0 <wbr>WebDriver <wbr>with <wbr>Visual <wbr>Studio, <wbr>C#, <wbr>& <wbr>IE

    If you are getting the following error:

    "DriverServiceNotFoundException was unhandled: The file … IEDriverServer.exe does not exist. The driver can be downloaded at"

    Selenium <wbr>2.0 <wbr>WebDriver <wbr>with <wbr>Visual <wbr>Studio, <wbr>C#, <wbr>& <wbr>IE

    Make sure that you downloaded the IEDriverServer.exe and also that you have the correct path specified in your code

  • 相关阅读:
    ReaHat7.6/7.7 最小化安装更新yum源
    Navicat Premium For Mac 12.0.2x 破解教程
    java程序员经常使用的Intellij Idea插件
    NDK版本 下载地址
    在Intellij IDEA下用X-debug调试PHP
    DMSFrame 之查询表达式用法(一)
    Wise 打包细节
    将Centos的yum源更换为国内的阿里云(163)源
    Centos下安装 .net Core运行程序
    使用 Docker 一步搞定 ZooKeeper 集群的搭建
  • 原文地址:https://www.cnblogs.com/happywang/p/3164906.html
Copyright © 2011-2022 走看看