【问题标题】:Error while build my TestStack.White application构建我的 TestStack.White 应用程序时出错
【发布时间】:2016-02-25 06:25:40
【问题描述】:

我在构建 TestStack.White 应用程序时遇到以下错误:

错误 1 ​​无法将类型“TestStack.White.UIItems.WindowItems.Window”隐式转换为“System.Windows.Window”c:\users\daniel.cbt\documents\visual studio 2013\Projects\I2K-White\I2K -White\MainWindow.xaml.cs 37 33 I2K-白色

我的代码是:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

using System.Windows.Automation;
//using NUnit.Framework;

using TestStack.White;
using TestStack.White.Configuration;
using TestStack.White.UIItems;
using TestStack.White.UIItems.Finders;


namespace I2K_White
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            TestStack.White.Application app = 

    TestStack.White.Application.Launch("c:\\Integris-2000\\I2K-GUI.exe");

                Window mainWindow = `enter code here`app.GetWindow(TestStack.White.UIItems.Finders.SearchCriteria.ByText("2000 Remote Radio Installation Tester"),
                                                  TestStack.White.Factory.InitializeOption.WithCache);

并且错误与“GetWindow”有关

【问题讨论】:

    标签: c# wpf white-framework


    【解决方案1】:

    在声明 mainWindow 时指定命名空间TestStack.White.UIItems.WindowItems.Window mainWindow。编译器无法区分System.Windows.WindowTestStack.White.UIItems.WindowItems.Window

    您也可以使用this 解决方案。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-04-02
      • 2012-04-22
      • 2021-03-28
      • 2018-04-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多