[英]How do I get C# Dotnet Intellisense to work on Visual Studio Code on Ubuntu
[英]I am not able to get .Click() intellisense in C# visual studio for selenium
這是我的代碼。 簡單登錄的形式,我想單擊不能訪問您的帳戶 ,在C#中使用Visual Studio 13測試腳本硒。 提前致謝。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Chrome;
using System.Threading;
namespace test1
{
class Program
{
static void Main(string[] args)
{
var driver = new FirefoxDriver();
driver.Url = "http://mysite/Account/Login";
driver.FindElements(By.LinkText("Can't access your account?")).
}
}
}
Web元素數組上沒有可用的Click()
方法。 更換:
driver.FindElements(By.LinkText("Can't access your account?")).Click();
與:
driver.FindElement(By.LinkText("Can't access your account?")).Click();
觀看“ s”。
嘗試:
static void Main(string[] args)
{
var driver = new FirefoxDriver();
driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(30));
driver.Navigate().GoToUrl("http://mysite/Account/Login");
driver.FindElement(By.LinkText("Can't access your account?")).Click();
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.