繁体   English   中英

C#硒中的Chrome驱动程序问题

[英]Chrome Driver issues in C# selenium

我写了我的第一个硒脚本,它起作用了。 这是下面的代码

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;

namespace test1Sel
{
    class Program
    {
        static void Main(string[] args)
        {
            IWebDriver driver = new ChromeDriver(@"C:\ChromeDriver");

如果我尝试编写新脚本,但是驱动程序出现错误,提示已提供了无效参数。 我正在使用Visual Studio 2013 Pro。 我不确定为什么该行第一次起作用但不能在任何其他脚本中起作用。 我已经在第一个脚本和我尝试过的任何其他测试脚本中安装了两个selenium软件包。 任何想法都很棒!

尝试将Chrome驱动程序替换为bin文件夹(solution \\ project \\ bin \\ debug),并使用不带路径的构造函数(不带参数)。

IWebDriver driver = new ChromeDriver();

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM