2013-02-06 12 views
7

मैं क्यूटीपी पर अपनी कोडित यूआई स्क्रिप्ट निष्पादित करने की कोशिश कर रहा हूं। सबसे पहले मैंने अपने कोडित यूआई प्रोजेक्ट के लिए एक डीएल बनाया, बाद में मैं उस डीएलएल के तरीकों तक पहुंचने में सक्षम हूं लेकिन मैं कोडित यूआई परीक्षण विधियों तक पहुंच नहीं पा रहा हूं। उदाहरण: नीचे स्क्रिप्ट सी VSTSक्यूटीपी को वीएसटीएस कोडित यू स्क्रिप्ट्स को कैसे कॉल करें?

namespace TestProject1 
{ 
    using System; 
    using System.Collections.Generic; 
    using System.Drawing; 
    using System.Windows.Input; 
    using System.Windows.Forms; 
    using System.CodeDom.Compiler; 
    using System.Text.RegularExpressions; 
    using Microsoft.VisualStudio.TestTools.UITest.Extension; 
    using Microsoft.VisualStudio.TestTools.UITesting; 
    using Microsoft.VisualStudio.TestTools.UnitTesting; 
    using Keyboard = Microsoft.VisualStudio.TestTools.UITesting.Keyboard; 
    using Mouse = Microsoft.VisualStudio.TestTools.UITesting.Mouse;  
    using MouseButtons = System.Windows.Forms.MouseButtons; 
    using Microsoft.VisualStudio.TestTools.UITesting.WinControls; 
    using Microsoft.VisualStudio.TestTools.UITesting.HtmlControls; 
    using Microsoft.VisualStudio.TestTools.UITesting.WpfControls; 

    public partial class UIMap 
    { 
     public int MyInteger() 
     { 
      return 9; 
     } 
     public string testDll() 
     { 
      return "Test DLL Factory"; 
     } 
     public void add1() 
     { 
      MessageBox.Show("Sravan"); 

     } 
     public void DeletePhoto() 
     { 
      WinWindow window = new WinWindow(); 
      window.SearchProperties[WinWindow.PropertyNames.Name] = "Cyramed"; 
      window.SearchProperties.Add(new PropertyExpression(WinWindow.PropertyNames.ClassName, "WindowsForms10.Window", PropertyExpressionOperator.Contains)); 

      WinWindow c_window = new WinWindow(window); 
      c_window.SearchProperties[WinWindow.PropertyNames.ControlName] = "PICTUREBOX1"; 
      c_window.WindowTitles.Add("Cyramed"); 
      c_window.DrawHighlight(); 

      WinClient c_client = new WinClient(c_window); 
      c_client.WindowTitles.Add("Cyramed"); 
      c_client.DrawHighlight(); 

      Mouse.Click(c_client, MouseButtons.Right); 
      Keyboard.SendKeys("{DOWN}"); 
      Keyboard.SendKeys("{DOWN}"); 
      Keyboard.SendKeys("{DOWN}"); 
      Keyboard.SendKeys("{ENTER}"); 


     }   
    } 
} 

मैं MyInteger और testDll तरीकों कॉल कर सकते हैं में # में है, लेकिन जब मैं DeletePhoto विधि कॉल यह एक त्रुटि फेंकता है: "Could not load file or assembly 'Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified."

मेरे प्राथमिक चिंता का विषय: मैं चाहता हूँ क्यूटीपी पर भी कोडित यूआई स्क्रिप्ट निष्पादित करें।

+0

आप अपने परीक्षण DLLs को उसी फ़ोल्डर में 'Microsoft.VisualStudio.TestTools.UITesting' विधानसभा है? क्या क्यूटीपी के साथ मशीन पर वीएस या वीएस टेस्ट एजेंट स्थापित है? –

उत्तर

0

आपको अपने क्यूटीपी परीक्षण एजेंटों पर विजुअल स्टूडियो टेस्ट एजेंट स्थापित करना होगा। ये मशीन पर द्विआधारी छोड़ देंगे।

VS 2010 Test Agents

VS 2010 SP1

संबंधित मुद्दे