using System; using System.Collections.Generic; using System.Text.RegularExpressions; using System.Windows.Input; using System.Windows.Forms; using System.Drawing; using Microsoft.VisualStudio.TestTools.UITesting; using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UITest.Extension; using Keyboard = Microsoft.VisualStudio.TestTools.UITesting.Keyboard; using Microsoft.VisualStudio.TestTools.UITesting.HtmlControls; using demoskype.PageObjects.LoginPage.LoginControllerClasses; namespace demoskype { /// <summary> /// Summary description for CodedUITest1 /// </summary> [CodedUITest] public class CodedUITest1 { public CodedUITest1() { } [TestMethod] public void CodedUITestMethod1() { // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. Console.WriteLine("welcome"); ApplicationUnderTest.Launch(@"C:\Program Files (x86)\Skype\Phone\Skype.exe"); Console.WriteLine("welcome"); LoginController objLogin = new LoginController(); HtmlEdit userNameEdit = objLogin.UISkypeWindow.UIItemClient.UISkypeDocument.UISkypeNameEdit; Mouse.Click(userNameEdit); Keyboard.SendKeys(userNameEdit, "automation.aahlaad"); HtmlEdit passwordEdit = objLogin.UISkypeWindow.UIItemClient.UISkypeDocument.UIPasswordEdit; Mouse.Click(passwordEdit); Keyboard.SendKeys(passwordEdit, "aahlaad123"); HtmlHyperlink signInLink = objLogin.UISkypeWindow.UIItemClient.UISkypeDocument.UISigninHyperlink; Mouse.Click(signInLink); } #region Additional test attributes // You can use the following additional attributes as you write your tests: ////Use TestInitialize to run code before running each test //[TestInitialize()] //public void MyTestInitialize() //{ // // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. //} ////Use TestCleanup to run code after each test has run //[TestCleanup()] //public void MyTestCleanup() //{ // // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. //} #endregion /// <summary> ///Gets or sets the test context which provides ///information about and functionality for the current test run. ///</summary> public TestContext TestContext { get { return testContextInstance; } set { testContextInstance = value; } } private TestContext testContextInstance; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)