' SelectElement'不包含带有1个参数ToolsQA的构造函数

时间:2017-01-19 11:39:42

标签: c# selenium automated-tests

using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Support.UI;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace ToolsQA
{
    class FirstTestCase
    {
        static void Main(string[] args)
        {
            IWebDriver driver = new FirefoxDriver();


            driver.Navigate().GoToUrl(" http://toolsqa.wpengine.com/automation-practice-form/");
            String st = "dld";
            SelectElement dropdown = new SelectElement(st);


            //oSelection.


        }
    }
}

有错误,为什么?贝塞尔http://toolsqa.com/selenium-webdriver/c-sharp/dropdown-multiple-select-operations-in-c/一切都很好!

1 个答案:

答案 0 :(得分:0)

-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)notification fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler { NSString* taskName = [NSString stringWithFormat:@"PushNotificationTask-%@", [[NSUUID UUID] UUIDString]]; NSLog(@"Starting bg-task for push notification %@", taskName); self.pnBgTask = [application beginBackgroundTaskWithName:taskName expirationHandler:^{ NSLog(@"Expiring bg-task for push notification %@", taskName); [application endBackgroundTask:self.pnBgTask]; self.pnBgTask = UIBackgroundTaskInvalid; }]; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ // do work here NSLog(@"Ending bg-task for push notification %@", taskName); [application endBackgroundTask:self.pnBgTask]; self.pnBgTask = UIBackgroundTaskInvalid; }); 采用new SelectElement()类型

的参数

您正在传递webElement作为参数。更改您的参数类型,然后尝试 -

string