UI Testing WORLD MART dengan Visual Studio 2010 · June 2, 2010 [UI TESTING WORLD MART DENGAN...

54
2010 Jeffrey Hermanto Halimsetiawan [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010] Langkah-langkah melakukan UI (User Interface) Testing dengan menggunakan Microsoft Visual Studio 2010

Transcript of UI Testing WORLD MART dengan Visual Studio 2010 · June 2, 2010 [UI TESTING WORLD MART DENGAN...

2010

Jeffrey Hermanto Halimsetiawan

[UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010] Langkah-langkah melakukan UI (User Interface) Testing dengan menggunakan Microsoft Visual Studio 2010

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 2

UI Testing World Mart dengan Microsoft Visual Studio 2010

Record Action dan Assertion

1. UITestPenjualan

Recorded Actions :

Generated Method Recorded Actions :

[TestMethod]

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 3

public void CodedUITestPenjualan() { // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. // For more information on generated code, see http://go.microsoft.com/fwlink/?LinkId=179463 this.UIMap.RecordedPenjualan(); this.UIMap.AssertMethodPenjualan(); this.UIMap.RecordedPenjualan2(); }

public void RecordedPenjualan() { #region Variable Declarations WinEdit uITxtUserEdit = this.UIWorldMartLoginWindow.UITxtUserWindow.UITxtUserEdit; WinEdit uITxtPassEdit = this.UIWorldMartLoginWindow.UITxtPassWindow.UITxtPassEdit; WinButton uILoginButton = this.UIWorldMartLoginWindow.UILoginWindow.UILoginButton; WinButton uIOKButton = this.UIOKWindow.UIOKButton; WinWindow uITxtPassWindow = this.UIWorldMartLoginWindow.UIWorldMartLoginClient.UITxtPassWindow; WinClient uIWorldMartLoginClient = this.UIWorldMartLoginWindow.UIWorldMartLoginClient; WinButton uIBtnJualButton = this.UIWorldMartLoginWindow.UIBtnJualWindow.UIBtnJualButton; #endregion // Type 'ali' in 'txtUser' text box uITxtUserEdit.Text = this.RecordedPenjualanParams.UITxtUserEditText; // Type '{Tab}' in 'txtUser' text box Keyboard.SendKeys(uITxtUserEdit, this.RecordedPenjualanParams.UITxtUserEditSendKeys, ModifierKeys.None); // Type '********' in 'txtPass' text box Keyboard.SendKeys(uITxtPassEdit, this.RecordedPenjualanParams.UITxtPassEditSendKeys, true); // Click 'Login' button Mouse.Click(uILoginButton, new Point(52, 7)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(57, 6)); // Click 'txtPass' window Mouse.Click(uITxtPassWindow, new Point(26, 0)); // Move 'txtPass' text box from (24, 4) to 'World Mart - Login' client (485, 228) uIWorldMartLoginClient.EnsureClickable(new Point(485, 228)); Mouse.StartDragging(uITxtPassEdit, new Point(24, 4)); Mouse.StopDragging(uIWorldMartLoginClient, new Point(485, 228)); // Type '********' in 'txtPass' text box Keyboard.SendKeys(uITxtPassEdit, this.RecordedPenjualanParams.UITxtPassEditSendKeys1, true); // Click 'Login' button Mouse.Click(uILoginButton, new Point(51, 7)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(56, 10));

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 4

// Click 'btnJual' button Mouse.Click(uIBtnJualButton, new Point(98, 123)); }

public void AssertMethodPenjualan() { #region Variable Declarations WinButton uIBtnJualButton = this.UIWorldMartLoginWindow.UIBtnJualWindow.UIBtnJualButton; WinButton uISubmitButton = this.UIWorldMartLoginWindow.UISubmitWindow.UISubmitButton; #endregion // Verify that 'btnJual' button's property 'Enabled' equals 'True' Assert.AreEqual(this.AssertMethodPenjualanExpectedValues.UIBtnJualButtonEnabled, uIBtnJualButton.Enabled); // Verify that 'btnJual' button's property 'ControlType' equals 'Button' Assert.AreEqual(this.AssertMethodPenjualanExpectedValues.UIBtnJualButtonControlType, uIBtnJualButton.ControlType.ToString()); // Verify that 'Submit' button's property 'DisplayText' equals 'Submit' Assert.AreEqual(this.AssertMethodPenjualanExpectedValues.UISubmitButtonDisplayText, uISubmitButton.DisplayText); // Verify that 'Submit' button's property 'Enabled' equals 'True' Assert.AreEqual(this.AssertMethodPenjualanExpectedValues.UISubmitButtonEnabled, uISubmitButton.Enabled); }

public void RecordedPenjualan2() { #region Variable Declarations WinComboBox uIComboBox2ComboBox = this.UIWorldMartLoginWindow.UIComboBox2Window.UIComboBox2ComboBox; WinComboBox uIComboBox3ComboBox = this.UIWorldMartLoginWindow.UIComboBox3Window.UIComboBox3ComboBox; WinComboBox uIJumlahComboBox = this.UIWorldMartLoginWindow.UIJumlahWindow.UIJumlahComboBox; WinButton uIInsertButton = this.UIWorldMartLoginWindow.UIInsertWindow.UIInsertButton; WinButton uIOKButton = this.UIOKWindow.UIOKButton; WinRowHeader uIItemRowHeader = this.UIWorldMartLoginWindow.UIDgvDetailWindow.UIDataGridViewTable.UIRow2Row.UIItemRowHeader; WinButton uIRemoveButton = this.UIWorldMartLoginWindow.UIRemoveWindow.UIRemoveButton; WinButton uISubmitButton = this.UIWorldMartLoginWindow.UISubmitWindow.UISubmitButton; WinButton uIBtnLogoutButton = this.UIWorldMartLoginWindow.UIBtnLogoutWindow.UIBtnLogoutButton; #endregion // Select '0000000000 | Non-Anggota' in 'comboBox2' combo box

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 5

uIComboBox2ComboBox.SelectedItem = this.RecordedPenjualanParams.UIComboBox2ComboBoxSelectedItem; // Select '00000000000000000013 | Danone Aqua Botol' in 'comboBox3' combo box uIComboBox3ComboBox.SelectedItem = this.RecordedPenjualanParams.UIComboBox3ComboBoxSelectedItem; // Select '2' in 'jumlah' combo box uIJumlahComboBox.SelectedItem = this.RecordedPenjualanParams.UIJumlahComboBoxSelectedItem; // Click 'Insert' button Mouse.Click(uIInsertButton, new Point(24, 5)); // Select '00000000000000000011 | Pocari Sweat Kaleng' in 'comboBox3' combo box uIComboBox3ComboBox.SelectedItem = this.RecordedPenjualanParams.UIComboBox3ComboBoxSelectedItem1; // Select '1' in 'jumlah' combo box uIJumlahComboBox.SelectedItem = this.RecordedPenjualanParams.UIJumlahComboBoxSelectedItem1; // Click 'Insert' button Mouse.Click(uIInsertButton, new Point(29, 12)); // Select '00000000000000000005 | Daging Sapi' in 'comboBox3' combo box uIComboBox3ComboBox.SelectedItem = this.RecordedPenjualanParams.UIComboBox3ComboBoxSelectedItem2; // Click 'Insert' button Mouse.Click(uIInsertButton, new Point(37, 12)); // Click 'Unknown Name' row header Mouse.Click(uIItemRowHeader, new Point(22, 11)); // Click 'Remove' button Mouse.Click(uIRemoveButton, new Point(43, 14)); // Click 'Submit' button Mouse.Click(uISubmitButton, new Point(16, 4)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(56, 4)); // Click 'btnLogout' button Mouse.Click(uIBtnLogoutButton, new Point(114, 28)); }

Test Result :

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 6

2. UITestAdministrasi Anggota

Recorded Actions :

Generated Method :

[TestMethod] public void CodedUITestAdministrasiAnggota() { // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. // For more information on generated code, see http://go.microsoft.com/fwlink/?LinkId=179463

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 7

this.UIMap.RecordedAdministrasiAnggota1(); this.UIMap.AssertMethodAdministrasiAnggota1(); this.UIMap.RecordedAdministrasiAnggota2(); this.UIMap.AssertMethodAdministrasiAnggota2(); this.UIMap.RecordedAdministrasiAnggota3(); }

public void RecordedAdministrasiAnggota1() { #region Variable Declarations WinEdit uITxtUserEdit = this.UIWorldMartLoginWindow.UITxtUserWindow.UITxtUserEdit; WinEdit uITxtPassEdit = this.UIWorldMartLoginWindow.UITxtPassWindow.UITxtPassEdit; WinButton uILoginButton = this.UIWorldMartLoginWindow.UILoginWindow.UILoginButton; WinButton uIOKButton = this.UIOKWindow.UIOKButton; WinClient uIWorldMartLoginClient = this.UIWorldMartLoginWindow.UIWorldMartLoginClient; WinText uIPasswordText = this.UIWorldMartLoginWindow.UIPasswordWindow.UIPasswordText; WinButton uIBtnAdministrasiButton = this.UIWorldMartLoginWindow.UIBtnAdministrasiWindow.UIBtnAdministrasiButton; WinEdit uITxtNamaEdit = this.UIWorldMartLoginWindow.UITxtNamaWindow.UITxtNamaEdit; WinEdit uITxtAlamatEdit = this.UIWorldMartLoginWindow.UITxtAlamatWindow.UITxtAlamatEdit; WinEdit uITxtTeleponEdit = this.UIWorldMartLoginWindow.UITxtTeleponWindow.UITxtTeleponEdit; WinButton uISubmitButton = this.UIWorldMartLoginWindow.UISubmitWindow1.UISubmitButton; #endregion // Type 'ali' in 'txtUser' text box uITxtUserEdit.Text = this.RecordedAdministrasiAnggota1Params.UITxtUserEditText; // Type '{Tab}' in 'txtUser' text box Keyboard.SendKeys(uITxtUserEdit, this.RecordedAdministrasiAnggota1Params.UITxtUserEditSendKeys, ModifierKeys.None); // Type '********' in 'txtPass' text box Keyboard.SendKeys(uITxtPassEdit, this.RecordedAdministrasiAnggota1Params.UITxtPassEditSendKeys, true); // Click 'Login' button Mouse.Click(uILoginButton, new Point(69, 13)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(68, 12)); // Click 'World Mart - Login' client Mouse.Click(uIWorldMartLoginClient, new Point(530, 220)); // Move 'txtPass' text box from (38, 3) to 'Password' label (29, 0) uIPasswordText.EnsureClickable(new Point(29, 0)); Mouse.StartDragging(uITxtPassEdit, new Point(38, 3)); Mouse.StopDragging(uIPasswordText, new Point(29, 0)); // Type '********' in 'txtPass' text box Keyboard.SendKeys(uITxtPassEdit, this.RecordedAdministrasiAnggota1Params.UITxtPassEditSendKeys1, true); // Click 'Login' button Mouse.Click(uILoginButton, new Point(41, 11));

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 8

// Click 'OK' button Mouse.Click(uIOKButton, new Point(60, 7)); // Click 'btnAdministrasi' button Mouse.Click(uIBtnAdministrasiButton, new Point(79, 53)); // Type 'Joko Suprianto' in 'txtNama' text box uITxtNamaEdit.Text = this.RecordedAdministrasiAnggota1Params.UITxtNamaEditText; // Type '{Tab}' in 'txtNama' text box Keyboard.SendKeys(uITxtNamaEdit, this.RecordedAdministrasiAnggota1Params.UITxtNamaEditSendKeys, ModifierKeys.None); // Type 'Cipayung 25' in 'txtAlamat' text box uITxtAlamatEdit.Text = this.RecordedAdministrasiAnggota1Params.UITxtAlamatEditText; // Type '{Tab}' in 'txtAlamat' text box Keyboard.SendKeys(uITxtAlamatEdit, this.RecordedAdministrasiAnggota1Params.UITxtAlamatEditSendKeys, ModifierKeys.None); // Type '021635212' in 'txtTelepon' text box uITxtTeleponEdit.Text = this.RecordedAdministrasiAnggota1Params.UITxtTeleponEditText; // Click 'Submit' button Mouse.Click(uISubmitButton, new Point(41, 13)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(58, 13)); }

public void AssertMethodAdministrasiAnggota1() { #region Variable Declarations WinEdit uITxtNamaEdit = this.UIWorldMartLoginWindow.UITxtNamaWindow.UITxtNamaEdit; WinEdit uITxtAlamatEdit = this.UIWorldMartLoginWindow.UITxtAlamatWindow.UITxtAlamatEdit; WinEdit uITxtTeleponEdit = this.UIWorldMartLoginWindow.UITxtTeleponWindow.UITxtTeleponEdit; #endregion // Verify that 'txtNama' text box's property 'Text' equals '' Assert.AreEqual(this.AssertMethodAdministrasiAnggota1ExpectedValues.UITxtNamaEditText, uITxtNamaEdit.Text); // Verify that 'txtAlamat' text box's property 'Text' equals '' Assert.AreEqual(this.AssertMethodAdministrasiAnggota1ExpectedValues.UITxtAlamatEditText, uITxtAlamatEdit.Text); // Verify that 'txtTelepon' text box's property 'Text' equals '' Assert.AreEqual(this.AssertMethodAdministrasiAnggota1ExpectedValues.UITxtTeleponEditText, uITxtTeleponEdit.Text); }

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 9

public void RecordedAdministrasiAnggota2() { #region Variable Declarations WinRadioButton uIPerpanjanganRadioButton = this.UIWorldMartLoginWindow.UIPerpanjanganWindow.UIPerpanjanganRadioButton; WinComboBox uICmbAnggotaComboBox = this.UIWorldMartLoginWindow.UICmbAnggotaWindow.UICmbAnggotaComboBox; WinButton uISubmitButton = this.UIWorldMartLoginWindow.UISubmitWindow1.UISubmitButton; WinButton uIOKButton = this.UIOKWindow.UIOKButton; #endregion // Select 'Perpanjangan' radio button uIPerpanjanganRadioButton.Selected = this.RecordedAdministrasiAnggota2Params.UIPerpanjanganRadioButtonSelected; // Select '0000000005 | David Beckham' in 'cmbAnggota' combo box uICmbAnggotaComboBox.SelectedItem = this.RecordedAdministrasiAnggota2Params.UICmbAnggotaComboBoxSelectedItem; // Click 'Submit' button Mouse.Click(uISubmitButton, new Point(59, 3)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(59, 12)); // Select '0000000004 | Iker Casilas' in 'cmbAnggota' combo box uICmbAnggotaComboBox.SelectedItem = this.RecordedAdministrasiAnggota2Params.UICmbAnggotaComboBoxSelectedItem1; }

public void AssertMethodAdministrasiAnggota2() { #region Variable Declarations WinEdit uITxtNamaEdit = this.UIWorldMartLoginWindow.UITxtNamaWindow.UITxtNamaEdit; WinEdit uITxtAlamatEdit = this.UIWorldMartLoginWindow.UITxtAlamatWindow.UITxtAlamatEdit; WinEdit uITxtTeleponEdit = this.UIWorldMartLoginWindow.UITxtTeleponWindow.UITxtTeleponEdit; WinDateTimePicker uITdaftarDateTimePicker = this.UIWorldMartLoginWindow.UITdaftarWindow.UITdaftarDateTimePicker; WinDateTimePicker uITbatasDateTimePicker = this.UIWorldMartLoginWindow.UITbatasWindow.UITbatasDateTimePicker; WinEdit uITxtIDAnggotaEdit = this.UIWorldMartLoginWindow.UITxtIDAnggotaWindow.UITxtIDAnggotaEdit; #endregion // Verify that 'txtNama' text box's property 'Text' equals 'Iker Casilas' Assert.AreEqual(this.AssertMethodAdministrasiAnggota2ExpectedValues.UITxtNamaEditText, uITxtNamaEdit.Text); // Verify that 'txtAlamat' text box's property 'Text' equals 'Santiago Bernabeu 17' Assert.AreEqual(this.AssertMethodAdministrasiAnggota2ExpectedValues.UITxtAlamatEditText, uITxtAlamatEdit.Text); // Verify that 'txtTelepon' text box's property 'Text' equals '4349234'

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 10

Assert.AreEqual(this.AssertMethodAdministrasiAnggota2ExpectedValues.UITxtTeleponEditText, uITxtTeleponEdit.Text); // Verify that 'Tdaftar' date time picker's property 'Name' equals '19 Agustus 2006' Assert.AreEqual(this.AssertMethodAdministrasiAnggota2ExpectedValues.UITdaftarDateTimePickerName, uITdaftarDateTimePicker.Name); // Verify that 'Tbatas' date time picker's property 'Name' equals '19 Agustus 2012' Assert.AreEqual(this.AssertMethodAdministrasiAnggota2ExpectedValues.UITbatasDateTimePickerName, uITbatasDateTimePicker.Name); // Verify that 'txtIDAnggota' text box's property 'Text' equals '0000000004' Assert.AreEqual(this.AssertMethodAdministrasiAnggota2ExpectedValues.UITxtIDAnggotaEditText, uITxtIDAnggotaEdit.Text); }

public void RecordedAdministrasiAnggota3() { #region Variable Declarations WinButton uIBtnLogoutButton = this.UIWorldMartLoginWindow.UIBtnLogoutWindow.UIBtnLogoutButton; #endregion // Click 'btnLogout' button Mouse.Click(uIBtnLogoutButton, new Point(85, 60)); }

Test Result :

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 11

3. UITestChangePassword

Recorded Action :

Generated Method :

[TestMethod] public void CodedUITestChangePassword() { // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items.

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 12

// For more information on generated code, see http://go.microsoft.com/fwlink/?LinkId=179463 this.UIMap.RecordedChangePassword(); }

public void RecordedChangePassword() { #region Variable Declarations WinEdit uITxtUserEdit = this.UIWorldMartLoginWindow.UITxtUserWindow.UITxtUserEdit; WinEdit uITxtPassEdit = this.UIWorldMartLoginWindow.UITxtPassWindow.UITxtPassEdit; WinButton uILoginButton = this.UIWorldMartLoginWindow.UILoginWindow.UILoginButton; WinButton uIOKButton = this.UIOKWindow.UIOKButton; WinButton uIBtnUmumButton = this.UIWorldMartLoginWindow.UIBtnUmumWindow.UIBtnUmumButton; WinEdit uITxtCurPasEdit = this.UIWorldMartLoginWindow.UITxtCurPasWindow.UITxtCurPasEdit; WinEdit uITxtNewPasEdit = this.UIWorldMartLoginWindow.UITxtNewPasWindow.UITxtNewPasEdit; WinEdit uITxtRePasEdit = this.UIWorldMartLoginWindow.UITxtRePasWindow.UITxtRePasEdit; WinButton uISubmitButton = this.UIWorldMartLoginWindow.UISubmitWindow3.UISubmitButton; WinButton uIBtnLogoutButton = this.UIWorldMartLoginWindow.UIBtnLogoutWindow.UIBtnLogoutButton; WinClient uIWorldMartLoginClient = this.UIWorldMartLoginWindow.UIWorldMartLoginClient; WinText uICurrentPasswordText = this.UIWorldMartLoginWindow.UICurrentPasswordWindow.UICurrentPasswordText; WinClient uIPnlBgClient = this.UIWorldMartLoginWindow.UIPnlBgWindow.UIPnlBgClient; WinText uIRetypePasswordText = this.UIWorldMartLoginWindow.UIRetypePasswordWindow.UIRetypePasswordText; WinButton uISubmitButton1 = this.UIWorldMartLoginWindow.UISubmitWindow4.UISubmitButton; #endregion // Type 'mahmud' in 'txtUser' text box uITxtUserEdit.Text = this.RecordedChangePasswordParams.UITxtUserEditText; // Click 'txtPass' text box Mouse.Click(uITxtPassEdit, new Point(68, 6)); // Type '********' in 'txtPass' text box Keyboard.SendKeys(uITxtPassEdit, this.RecordedChangePasswordParams.UITxtPassEditSendKeys, true); // Click 'Login' button Mouse.Click(uILoginButton, new Point(64, 10)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(61, 15)); // Type 'ali' in 'txtUser' text box uITxtUserEdit.Text = this.RecordedChangePasswordParams.UITxtUserEditText1; // Click 'Login' button Mouse.Click(uILoginButton, new Point(57, 6)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(56, 8));

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 13

// Click 'btnUmum' button Mouse.Click(uIBtnUmumButton, new Point(127, 63)); // Click 'txtCurPas' text box Mouse.Click(uITxtCurPasEdit, new Point(34, 10)); // Type '********' in 'txtCurPas' text box Keyboard.SendKeys(uITxtCurPasEdit, this.RecordedChangePasswordParams.UITxtCurPasEditSendKeys, true); // Click 'txtNewPas' text box Mouse.Click(uITxtNewPasEdit, new Point(68, 7)); // Type '********' in 'txtNewPas' text box Keyboard.SendKeys(uITxtNewPasEdit, this.RecordedChangePasswordParams.UITxtNewPasEditSendKeys, true); // Click 'txtRePas' text box Mouse.Click(uITxtRePasEdit, new Point(67, 11)); // Type '********' in 'txtRePas' text box Keyboard.SendKeys(uITxtRePasEdit, this.RecordedChangePasswordParams.UITxtRePasEditSendKeys, true); // Click 'Submit' button Mouse.Click(uISubmitButton, new Point(64, 10)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(52, 5)); // Click 'btnLogout' button Mouse.Click(uIBtnLogoutButton, new Point(117, 46)); // Type 'ali' in 'txtUser' text box uITxtUserEdit.Text = this.RecordedChangePasswordParams.UITxtUserEditText2; // Type '{Tab}' in 'txtUser' text box Keyboard.SendKeys(uITxtUserEdit, this.RecordedChangePasswordParams.UITxtUserEditSendKeys, ModifierKeys.None); // Type '********' in 'txtPass' text box Keyboard.SendKeys(uITxtPassEdit, this.RecordedChangePasswordParams.UITxtPassEditSendKeys1, true); // Click 'Login' button Mouse.Click(uILoginButton, new Point(70, 13)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(43, 7)); // Move 'txtPass' text box from (47, 9) to 'World Mart - Login' client (480, 233) uIWorldMartLoginClient.EnsureClickable(new Point(480, 233)); Mouse.StartDragging(uITxtPassEdit, new Point(47, 9)); Mouse.StopDragging(uIWorldMartLoginClient, new Point(480, 233)); // Type '********' in 'txtPass' text box Keyboard.SendKeys(uITxtPassEdit, this.RecordedChangePasswordParams.UITxtPassEditSendKeys2, true); // Click 'Login' button Mouse.Click(uILoginButton, new Point(67, 7));

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 14

// Click 'OK' button Mouse.Click(uIOKButton, new Point(66, 15)); // Move 'txtCurPas' text box from (55, 9) to 'Current Password' label (56, 5) uICurrentPasswordText.EnsureClickable(new Point(56, 5)); Mouse.StartDragging(uITxtCurPasEdit, new Point(55, 9)); Mouse.StopDragging(uICurrentPasswordText, new Point(56, 5)); // Move 'txtCurPas' text box from (76, 10) to 'Current Password' label (68, 9) uICurrentPasswordText.EnsureClickable(new Point(68, 9)); Mouse.StartDragging(uITxtCurPasEdit, new Point(76, 10)); Mouse.StopDragging(uICurrentPasswordText, new Point(68, 9)); // Type '********' in 'txtCurPas' text box Keyboard.SendKeys(uITxtCurPasEdit, this.RecordedChangePasswordParams.UITxtCurPasEditSendKeys1, true); // Type '********' in 'txtNewPas' text box Keyboard.SendKeys(uITxtNewPasEdit, this.RecordedChangePasswordParams.UITxtNewPasEditSendKeys1, true); // Type '********' in 'txtNewPas' text box Keyboard.SendKeys(uITxtNewPasEdit, this.RecordedChangePasswordParams.UITxtNewPasEditSendKeys2, true); // Move 'txtNewPas' text box from (81, 11) to 'pnlBg' client (131, 171) uIPnlBgClient.EnsureClickable(new Point(131, 171)); Mouse.StartDragging(uITxtNewPasEdit, new Point(81, 11)); Mouse.StopDragging(uIPnlBgClient, new Point(131, 171)); // Type '********' in 'txtNewPas' text box Keyboard.SendKeys(uITxtNewPasEdit, this.RecordedChangePasswordParams.UITxtNewPasEditSendKeys3, true); // Move 'txtRePas' text box from (50, 9) to 'Re-type Password' label (83, 8) uIRetypePasswordText.EnsureClickable(new Point(83, 8)); Mouse.StartDragging(uITxtRePasEdit, new Point(50, 9)); Mouse.StopDragging(uIRetypePasswordText, new Point(83, 8)); // Type '********' in 'txtRePas' text box Keyboard.SendKeys(uITxtRePasEdit, this.RecordedChangePasswordParams.UITxtRePasEditSendKeys1, true); // Click 'Submit' button Mouse.Click(uISubmitButton1, new Point(12, 13)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(40, 9)); // Click 'btnLogout' button Mouse.Click(uIBtnLogoutButton, new Point(127, 63)); // Type 'ali' in 'txtUser' text box uITxtUserEdit.Text = this.RecordedChangePasswordParams.UITxtUserEditText3; // Type '{Tab}' in 'txtUser' text box Keyboard.SendKeys(uITxtUserEdit, this.RecordedChangePasswordParams.UITxtUserEditSendKeys1, ModifierKeys.None); // Type '********' in 'txtPass' text box Keyboard.SendKeys(uITxtPassEdit, this.RecordedChangePasswordParams.UITxtPassEditSendKeys3, true);

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 15

// Click 'Login' button Mouse.Click(uILoginButton, new Point(31, 18)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(36, 2)); // Move 'txtPass' text box from (49, 8) to 'World Mart - Login' client (489, 232) uIWorldMartLoginClient.EnsureClickable(new Point(489, 232)); Mouse.StartDragging(uITxtPassEdit, new Point(49, 8)); Mouse.StopDragging(uIWorldMartLoginClient, new Point(489, 232)); // Type '********' in 'txtPass' text box Keyboard.SendKeys(uITxtPassEdit, this.RecordedChangePasswordParams.UITxtPassEditSendKeys4, true); // Click 'Login' button Mouse.Click(uILoginButton, new Point(52, 13)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(32, 6)); // Click 'btnLogout' button Mouse.Click(uIBtnLogoutButton, new Point(133, 26)); }

Test Result :

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 16

4. UITestPembelian

Recorded Actions :

Generated Method :

[TestMethod]

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 17

public void CodedUITestPembelian() { // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. // For more information on generated code, see http://go.microsoft.com/fwlink/?LinkId=179463 this.UIMap.RecordedPembelian1(); this.UIMap.AssertMethodPembelian1(); this.UIMap.RecordedPembelian2(); this.UIMap.RecordedPembelian3(); }

public void RecordedPembelian1() { #region Variable Declarations WinEdit uITxtUserEdit = this.UIWorldMartLoginWindow.UITxtUserWindow.UITxtUserEdit; WinEdit uITxtPassEdit = this.UIWorldMartLoginWindow.UITxtPassWindow.UITxtPassEdit; WinButton uILoginButton = this.UIWorldMartLoginWindow.UILoginWindow.UILoginButton; WinButton uIOKButton = this.UIOKWindow.UIOKButton; #endregion // Type 'wira' in 'txtUser' text box uITxtUserEdit.Text = this.RecordedPembelian1Params.UITxtUserEditText; // Click 'txtPass' text box Mouse.Click(uITxtPassEdit, new Point(57, 4)); // Type '********' in 'txtPass' text box Keyboard.SendKeys(uITxtPassEdit, this.RecordedPembelian1Params.UITxtPassEditSendKeys, true); // Click 'Login' button Mouse.Click(uILoginButton, new Point(67, 6)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(47, 4)); }

public void AssertMethodPembelian1() { #region Variable Declarations WinEdit uITxtManagerEdit = this.UIWorldMartWiraRedisHoWindow.UIWiraRediWindow.UITxtManagerEdit; WinEdit uIManagerEdit = this.UIWorldMartWiraRedisHoWindow.UIItemWindow.UIManagerEdit; WinEdit uIProdukEdit = this.UIWorldMartWiraRedisHoWindow.UIItemWindow1.UIProdukEdit; WinEdit uIKategoriProdukEdit = this.UIWorldMartWiraRedisHoWindow.UIItemWindow2.UIKategoriProdukEdit; WinEdit uIItemEdit = this.UIWorldMartWiraRedisHoWindow.UIItem1Window.UIItemEdit; WinEdit uIHargaReturEdit = this.UIWorldMartWiraRedisHoWindow.UINudHargaBeliWindow.UIHargaReturComboBox.UIHargaReturEdit; WinEdit uIItemEdit1 = this.UIWorldMartWiraRedisHoWindow.UIItem000Window.UIItemEdit; WinButton uIAddButton = this.UIWorldMartWiraRedisHoWindow.UIAddWindow.UIAddButton; WinButton uIRemoveButton = this.UIWorldMartWiraRedisHoWindow.UIRemoveWindow.UIRemoveButton; WinButton uISubmitButton =

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 18

this.UIWorldMartWiraRedisHoWindow.UISubmitWindow.UISubmitButton; #endregion // Verify that 'txtManager' text box's property 'Text' equals 'Wira Redi' Assert.AreEqual(this.AssertMethodPembelian1ExpectedValues.UITxtManagerEditText, uITxtManagerEdit.Text); // Verify that 'txtManager' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPembelian1ExpectedValues.UITxtManagerEditEnabled, uITxtManagerEdit.Enabled); // Verify that 'Manager' text box's property 'Text' equals '' Assert.AreEqual(this.AssertMethodPembelian1ExpectedValues.UIManagerEditText, uIManagerEdit.Text); // Verify that 'Produk' text box's property 'Text' equals '' Assert.AreEqual(this.AssertMethodPembelian1ExpectedValues.UIProdukEditText, uIProdukEdit.Text); // Verify that 'Kategori Produk' text box's property 'Text' equals '' Assert.AreEqual(this.AssertMethodPembelian1ExpectedValues.UIKategoriProdukEditText, uIKategoriProdukEdit.Text); // Verify that 'Unknown Name' text box's property 'Text' equals '1' Assert.AreEqual(this.AssertMethodPembelian1ExpectedValues.UIItemEditText, uIItemEdit.Text); // Verify that 'Harga Retur' text box's property 'Text' equals '0,00' Assert.AreEqual(this.AssertMethodPembelian1ExpectedValues.UIHargaReturEditText, uIHargaReturEdit.Text); // Verify that 'Unknown Name' text box's property 'Text' equals '0,00' Assert.AreEqual(this.AssertMethodPembelian1ExpectedValues.UIItemEditText1, uIItemEdit1.Text); // Verify that 'Add' button's property 'Enabled' equals 'True' Assert.AreEqual(this.AssertMethodPembelian1ExpectedValues.UIAddButtonEnabled, uIAddButton.Enabled); // Verify that 'Remove' button's property 'Enabled' equals 'True' Assert.AreEqual(this.AssertMethodPembelian1ExpectedValues.UIRemoveButtonEnabled, uIRemoveButton.Enabled); // Verify that 'Submit' button's property 'Enabled' equals 'True' Assert.AreEqual(this.AssertMethodPembelian1ExpectedValues.UISubmitButtonEnabled, uISubmitButton.Enabled); }

public void RecordedPembelian2() { #region Variable Declarations WinComboBox uIManagerComboBox = this.UIWorldMartWiraRedisHoWindow.UICmbSupplierWindow.UIManagerComboBox; WinComboBox uIProdukComboBox = this.UIWorldMartWiraRedisHoWindow.UICmbProdukWindow.UIProdukComboBox; WinDateTimePicker uIDtpTglDisplayDateTimePicker = this.UIWorldMartWiraRedisHoWindow.UIDtpTglDisplayWindow.UIDtpTglDisplayDateTimePicker; WinComboBox uINudJumlahComboBox = this.UIWorldMartWiraRedisHoWindow.UINudJumlahWindow.UINudJumlahComboBox;

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 19

WinComboBox uIHargaReturComboBox = this.UIWorldMartWiraRedisHoWindow.UINudHargaBeliWindow.UIHargaReturComboBox; WinComboBox uINudHargaReturComboBox = this.UIWorldMartWiraRedisHoWindow.UINudHargaReturWindow.UINudHargaReturComboBox; WinEdit uIHargaReturEdit = this.UIWorldMartWiraRedisHoWindow.UINudHargaBeliWindow.UIHargaReturComboBox.UIHargaReturEdit; WinButton uIAddButton = this.UIWorldMartWiraRedisHoWindow.UIAddWindow.UIAddButton; WinClient uIPnlPembelianClient = this.UIWorldMartWiraRedisHoWindow.UIPnlPembelianWindow.UIPnlPembelianClient; WinRowHeader uIItemRowHeader = this.UIWorldMartWiraRedisHoWindow.UIDgvDetailWindow.UIDataGridViewTable.UIRow2Row.UIItemRowHeader; WinButton uIRemoveButton = this.UIWorldMartWiraRedisHoWindow.UIRemoveWindow.UIRemoveButton; WinButton uISubmitButton = this.UIWorldMartWiraRedisHoWindow.UISubmitWindow.UISubmitButton; WinButton uIOKButton = this.UIOKWindow.UIOKButton; WinButton uIBtnJualButton = this.UIWorldMartLoginWindow.UIBtnJualWindow.UIBtnJualButton; #endregion // Click 'btnJual' button Mouse.Click(uIBtnJualButton, new Point(98, 123)); // Select '00000002 | CV.Suka Maju' in 'Manager' combo box uIManagerComboBox.SelectedItem = this.RecordedPembelian2Params.UIManagerComboBoxSelectedItem; // Select '00000000000000000005 | Daging Sapi' in 'Produk' combo box uIProdukComboBox.SelectedItem = this.RecordedPembelian2Params.UIProdukComboBoxSelectedItem; // Select '26/09/2010' in 'dtpTglDisplay' date time picker uIDtpTglDisplayDateTimePicker.DateTimeAsString = this.RecordedPembelian2Params.UIDtpTglDisplayDateTimePickerDateTimeAsString; // Select '10' in 'nudJumlah' combo box uINudJumlahComboBox.SelectedItem = this.RecordedPembelian2Params.UINudJumlahComboBoxSelectedItem; // Select '150000' in 'Harga Retur' combo box uIHargaReturComboBox.EditableItem = this.RecordedPembelian2Params.UIHargaReturComboBoxEditableItem; // Select '120000' in 'nudHargaRetur' combo box uINudHargaReturComboBox.EditableItem = this.RecordedPembelian2Params.UINudHargaReturComboBoxEditableItem; // Click 'Harga Retur' text box Mouse.Click(uIHargaReturEdit, new Point(81, 12)); // Click 'Add' button Mouse.Click(uIAddButton, new Point(35, 6)); // Select '00000000000000000011 | Pocari Sweat Kaleng' in 'Produk' combo box uIProdukComboBox.SelectedItem = this.RecordedPembelian2Params.UIProdukComboBoxSelectedItem1; // Select '27/03/2011' in 'dtpTglDisplay' date time picker uIDtpTglDisplayDateTimePicker.DateTimeAsString =

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 20

this.RecordedPembelian2Params.UIDtpTglDisplayDateTimePickerDateTimeAsString1; // Select '15' in 'nudJumlah' combo box uINudJumlahComboBox.SelectedItem = this.RecordedPembelian2Params.UINudJumlahComboBoxSelectedItem1; // Select '4000' in 'Harga Retur' combo box uIHargaReturComboBox.EditableItem = this.RecordedPembelian2Params.UIHargaReturComboBoxEditableItem1; // Click 'pnlPembelian' client Mouse.Click(uIPnlPembelianClient, new Point(151, 323)); // Select '3500' in 'nudHargaRetur' combo box uINudHargaReturComboBox.EditableItem = this.RecordedPembelian2Params.UINudHargaReturComboBoxEditableItem1; // Click 'Add' button Mouse.Click(uIAddButton, new Point(39, 8)); // Select '2' in 'nudJumlah' combo box uINudJumlahComboBox.SelectedItem = this.RecordedPembelian2Params.UINudJumlahComboBoxSelectedItem2; // Click 'Add' button Mouse.Click(uIAddButton, new Point(16, 4)); // Select '00000000000000000001 | Mie Instan Indomie' in 'Produk' combo box uIProdukComboBox.SelectedItem = this.RecordedPembelian2Params.UIProdukComboBoxSelectedItem2; // Select '25/03/2011' in 'dtpTglDisplay' date time picker uIDtpTglDisplayDateTimePicker.DateTimeAsString = this.RecordedPembelian2Params.UIDtpTglDisplayDateTimePickerDateTimeAsString2; // Click 'Add' button Mouse.Click(uIAddButton, new Point(25, 12)); // Click 'Unknown Name' row header Mouse.Click(uIItemRowHeader, new Point(20, 8)); // Click 'Remove' button Mouse.Click(uIRemoveButton, new Point(36, 15)); // Click 'Submit' button Mouse.Click(uISubmitButton, new Point(10, 10)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(39, 5)); }

public void RecordedPembelian3() { #region Variable Declarations WinButton uIBtnLogoutButton = this.UIWorldMartWiraRedisHoWindow.UIBtnLogoutWindow.UIBtnLogoutButton; #endregion // Click 'btnLogout' button Mouse.Click(uIBtnLogoutButton, new Point(70, 54));

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 21

}

Test Result :

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 22

5. UITestPegawaiManager

Recorded Actions :

Generated Method Recorded Actions :

[TestMethod] public void CodedUITestPegawaiManager() { // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. // For more information on generated code, see http://go.microsoft.com/fwlink/?LinkId=179463 this.UIMap.RecordedPegawaiManager1(); this.UIMap.AssertMethodPegawaiManager1(); this.UIMap.RecordedPegawaiManager2(); this.UIMap.AssertMethodPegawaiManager2(); this.UIMap.RecordedPegawaiManager3(); this.UIMap.RecordedPegawaiManager4(); this.UIMap.AssertMethodPegawaiManager3(); this.UIMap.RecordedPegawaiManager5(); }

public void RecordedPegawaiManager1() { #region Variable Declarations WinEdit uITxtUserEdit = this.UIWorldMartLoginWindow.UITxtUserWindow.UITxtUserEdit; WinEdit uITxtPassEdit = this.UIWorldMartLoginWindow.UITxtPassWindow.UITxtPassEdit; WinButton uILoginButton = this.UIWorldMartLoginWindow.UILoginWindow.UILoginButton; WinButton uIOKButton = this.UIOKWindow.UIOKButton; WinText uIPasswordText = this.UIWorldMartLoginWindow.UIPasswordWindow.UIPasswordText; WinButton uIBtnPegawaiButton = this.UIWorldMartLoginWindow1.UIBtnPegawaiWindow.UIBtnPegawaiButton; #endregion // Type 'wira' in 'txtUser' text box uITxtUserEdit.Text = this.RecordedPegawaiManager1Params.UITxtUserEditText; // Type '{Tab}' in 'txtUser' text box Keyboard.SendKeys(uITxtUserEdit, this.RecordedPegawaiManager1Params.UITxtUserEditSendKeys, ModifierKeys.None); // Type '********' in 'txtPass' text box Keyboard.SendKeys(uITxtPassEdit, this.RecordedPegawaiManager1Params.UITxtPassEditSendKeys, true); // Click 'Login' button Mouse.Click(uILoginButton, new Point(65, 5)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(37, 21)); // Move 'txtPass' text box from (44, 8) to 'Password' label (51, 4) uIPasswordText.EnsureClickable(new Point(51, 4)); Mouse.StartDragging(uITxtPassEdit, new Point(44, 8)); Mouse.StopDragging(uIPasswordText, new Point(51, 4)); // Type '********' in 'txtPass' text box Keyboard.SendKeys(uITxtPassEdit, this.RecordedPegawaiManager1Params.UITxtPassEditSendKeys1, true);

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 24

// Click 'Login' button Mouse.Click(uILoginButton, new Point(58, 11)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(58, 10)); // Click 'btnPegawai' button Mouse.Click(uIBtnPegawaiButton, new Point(77, 70)); } /// <summary> /// AssertMethodPegawaiManager1 - Use 'AssertMethodPegawaiManager1ExpectedValues' to pass parameters into this method. /// </summary> public void AssertMethodPegawaiManager1() { #region Variable Declarations WinEdit uIGajiPokokEdit = this.UIWorldMartWiraRedisHoWindow.UIItemWindow1.UIGajiPokokEdit; WinEdit uITxtNamaPegEdit = this.UIWorldMartWiraRedisHoWindow1.UITxtNamaPegWindow.UITxtNamaPegEdit; WinEdit uITxtAlamatPegEdit = this.UIWorldMartWiraRedisHoWindow2.UITxtAlamatPegWindow.UITxtAlamatPegEdit; WinEdit uITxtTelpPegEdit = this.UIWorldMartWiraRedisHoWindow3.UITxtTelpPegWindow.UITxtTelpPegEdit; WinEdit uITxtTunjanganPegEdit = this.UIWorldMartWiraRedisHoWindow4.UITxtTunjanganPegWindow.UITxtTunjanganPegEdit; WinEdit uITxtTotalGajiEdit = this.UIWorldMartWiraRedisHoWindow5.UITxtTotalGajiWindow.UITxtTotalGajiEdit; WinButton uIAddButton = this.UIWorldMartWiraRedisHoWindow6.UIAddWindow.UIAddButton; WinButton uIEditButton = this.UIWorldMartWiraRedisHoWindow7.UIEditWindow.UIEditButton; WinButton uIRemoveButton = this.UIWorldMartWiraRedisHoWindow.UIRemoveWindow.UIRemoveButton; #endregion // Verify that 'Gaji Pokok' text box's property 'Text' equals '' Assert.AreEqual(this.AssertMethodPegawaiManager1ExpectedValues.UIGajiPokokEditText, uIGajiPokokEdit.Text); // Verify that 'Gaji Pokok' text box's property 'Enabled' equals 'True' Assert.AreEqual(this.AssertMethodPegawaiManager1ExpectedValues.UIGajiPokokEditEnabled, uIGajiPokokEdit.Enabled); // Verify that 'txtNamaPeg' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiManager1ExpectedValues.UITxtNamaPegEditEnabled, uITxtNamaPegEdit.Enabled); // Verify that 'txtNamaPeg' text box's property 'Text' equals '' Assert.AreEqual(this.AssertMethodPegawaiManager1ExpectedValues.UITxtNamaPegEditText, uITxtNamaPegEdit.Text); // Verify that 'txtAlamatPeg' text box's property 'Text' equals '' Assert.AreEqual(this.AssertMethodPegawaiManager1ExpectedValues.UITxtAlamatPegEditText, uITxtAlamatPegEdit.Text);

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 25

// Verify that 'txtAlamatPeg' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiManager1ExpectedValues.UITxtAlamatPegEditEnabled, uITxtAlamatPegEdit.Enabled); // Verify that 'txtTelpPeg' text box's property 'Text' equals '' Assert.AreEqual(this.AssertMethodPegawaiManager1ExpectedValues.UITxtTelpPegEditText, uITxtTelpPegEdit.Text); // Verify that 'txtTelpPeg' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiManager1ExpectedValues.UITxtTelpPegEditEnabled, uITxtTelpPegEdit.Enabled); // Verify that 'txtTunjanganPeg' text box's property 'Text' equals '' Assert.AreEqual(this.AssertMethodPegawaiManager1ExpectedValues.UITxtTunjanganPegEditText, uITxtTunjanganPegEdit.Text); // Verify that 'txtTunjanganPeg' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiManager1ExpectedValues.UITxtTunjanganPegEditEnabled, uITxtTunjanganPegEdit.Enabled); // Verify that 'txtTotalGaji' text box's property 'Text' equals '' Assert.AreEqual(this.AssertMethodPegawaiManager1ExpectedValues.UITxtTotalGajiEditText, uITxtTotalGajiEdit.Text); // Verify that 'txtTotalGaji' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiManager1ExpectedValues.UITxtTotalGajiEditEnabled, uITxtTotalGajiEdit.Enabled); // Verify that 'Add' button's property 'Enabled' equals 'True' Assert.AreEqual(this.AssertMethodPegawaiManager1ExpectedValues.UIAddButtonEnabled, uIAddButton.Enabled); // Verify that 'Edit' button's property 'Enabled' equals 'True' Assert.AreEqual(this.AssertMethodPegawaiManager1ExpectedValues.UIEditButtonEnabled, uIEditButton.Enabled); // Verify that 'Remove' button's property 'Enabled' equals 'True' Assert.AreEqual(this.AssertMethodPegawaiManager1ExpectedValues.UIRemoveButtonEnabled, uIRemoveButton.Enabled); } /// <summary> /// RecordedPegawaiManager2 /// </summary> public void RecordedPegawaiManager2() { #region Variable Declarations WinButton uIRemoveButton = this.UIWorldMartWiraRedisHoWindow.UIRemoveWindow.UIRemoveButton; WinButton uIPayButton = this.UIWorldMartWiraRedisHoWindow8.UIPayWindow.UIPayButton; WinButton uIOKButton = this.UIOKWindow.UIOKButton; WinButton uIOpenButton =

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 26

this.UIWorldMartWiraRedisHoWindow9.UICmbSearchPegWindow.UIGajiPokokComboBox.UIOpenButton; WinButton uICloseButton = this.UIWorldMartWiraRedisHoWindow9.UICmbSearchPegWindow.UIGajiPokokComboBox.UICloseButton; WinButton uIAddButton = this.UIWorldMartWiraRedisHoWindow6.UIAddWindow.UIAddButton; #endregion // Click 'Remove' button Mouse.Click(uIRemoveButton, new Point(50, 12)); // Click 'Pay' button Mouse.Click(uIPayButton, new Point(65, 4)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(52, 6)); // Click 'Open' button Mouse.Click(uIOpenButton, new Point(13, 12)); // Click 'Close' button Mouse.Click(uICloseButton, new Point(13, 12)); // Click 'Add' button Mouse.Click(uIAddButton, new Point(37, 13)); } /// <summary> /// AssertMethodPegawaiManager2 - Use 'AssertMethodPegawaiManager2ExpectedValues' to pass parameters into this method. /// </summary> public void AssertMethodPegawaiManager2() { #region Variable Declarations WinEdit uIItemEdit = this.UIWorldMartWiraRedisHoWindow.UIItemWindow2.UIItemEdit; WinEdit uITxtNamaPegEdit = this.UIWorldMartWiraRedisHoWindow1.UITxtNamaPegWindow.UITxtNamaPegEdit; WinEdit uITxtAlamatPegEdit = this.UIWorldMartWiraRedisHoWindow2.UITxtAlamatPegWindow.UITxtAlamatPegEdit; WinEdit uITxtTelpPegEdit = this.UIWorldMartWiraRedisHoWindow3.UITxtTelpPegWindow.UITxtTelpPegEdit; WinEdit uITxtTunjanganPegEdit = this.UIWorldMartWiraRedisHoWindow4.UITxtTunjanganPegWindow.UITxtTunjanganPegEdit; WinRadioButton uIPegawaiTetapRadioButton = this.UIWorldMartWiraRedisHoWindow10.UIPegawaiTetapWindow.UIPegawaiTetapRadioButton; WinEdit uITxtTotalGajiEdit = this.UIWorldMartWiraRedisHoWindow5.UITxtTotalGajiWindow.UITxtTotalGajiEdit; WinButton uIPayButton = this.UIWorldMartWiraRedisHoWindow8.UIPayWindow.UIPayButton; #endregion // Verify that 'Unknown Name' text box's property 'Enabled' equals 'True' Assert.AreEqual(this.AssertMethodPegawaiManager2ExpectedValues.UIItemEditEnabled, uIItemEdit.Enabled); // Verify that 'txtNamaPeg' text box's property 'Enabled' equals 'True' Assert.AreEqual(this.AssertMethodPegawaiManager2ExpectedValues.UITxtNamaPegEditEnabled, uITxtNamaPegEdit.Enabled); // Verify that 'txtAlamatPeg' text box's property 'Enabled' equals 'True'

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 27

Assert.AreEqual(this.AssertMethodPegawaiManager2ExpectedValues.UITxtAlamatPegEditEnabled, uITxtAlamatPegEdit.Enabled); // Verify that 'txtTelpPeg' text box's property 'Enabled' equals 'True' Assert.AreEqual(this.AssertMethodPegawaiManager2ExpectedValues.UITxtTelpPegEditEnabled, uITxtTelpPegEdit.Enabled); // Verify that 'txtTunjanganPeg' text box's property 'Enabled' equals 'True' Assert.AreEqual(this.AssertMethodPegawaiManager2ExpectedValues.UITxtTunjanganPegEditEnabled, uITxtTunjanganPegEdit.Enabled); // Verify that 'txtTunjanganPeg' text box's property 'Text' equals '' Assert.AreEqual(this.AssertMethodPegawaiManager2ExpectedValues.UITxtTunjanganPegEditText, uITxtTunjanganPegEdit.Text); // Verify that 'txtNamaPeg' text box's property 'Text' equals '' Assert.AreEqual(this.AssertMethodPegawaiManager2ExpectedValues.UITxtNamaPegEditText, uITxtNamaPegEdit.Text); // Verify that 'txtAlamatPeg' text box's property 'Text' equals '' Assert.AreEqual(this.AssertMethodPegawaiManager2ExpectedValues.UITxtAlamatPegEditText, uITxtAlamatPegEdit.Text); // Verify that 'txtTelpPeg' text box's property 'Text' equals '' Assert.AreEqual(this.AssertMethodPegawaiManager2ExpectedValues.UITxtTelpPegEditText, uITxtTelpPegEdit.Text); // Verify that 'Pegawai Tetap' radio button's property 'Enabled' equals 'True' Assert.AreEqual(this.AssertMethodPegawaiManager2ExpectedValues.UIPegawaiTetapRadioButtonEnabled, uIPegawaiTetapRadioButton.Enabled); // Verify that 'Pegawai Tetap' radio button's property 'Selected' equals 'True' Assert.AreEqual(this.AssertMethodPegawaiManager2ExpectedValues.UIPegawaiTetapRadioButtonSelected, uIPegawaiTetapRadioButton.Selected); // Verify that 'txtTotalGaji' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiManager2ExpectedValues.UITxtTotalGajiEditEnabled, uITxtTotalGajiEdit.Enabled); // Verify that 'Pay' button's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiManager2ExpectedValues.UIPayButtonEnabled, uIPayButton.Enabled); }

/// <summary> /// RecordedPegawaiManager3 - Use 'RecordedPegawaiManager3Params' to pass parameters into this method. /// </summary> public void RecordedPegawaiManager3() { #region Variable Declarations WinComboBox uICmbJabPegComboBox =

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 28

this.UIWorldMartWiraRedisHoWindow11.UICmbJabPegWindow.UICmbJabPegComboBox; WinEdit uITxtNamaPegEdit = this.UIWorldMartWiraRedisHoWindow1.UITxtNamaPegWindow.UITxtNamaPegEdit; WinEdit uITxtAlamatPegEdit = this.UIWorldMartWiraRedisHoWindow2.UITxtAlamatPegWindow.UITxtAlamatPegEdit; WinEdit uITxtTelpPegEdit = this.UIWorldMartWiraRedisHoWindow3.UITxtTelpPegWindow.UITxtTelpPegEdit; WinRadioButton uIPegawaiKontrakRadioButton = this.UIWorldMartWiraRedisHoWindow12.UIPegawaiKontrakWindow.UIPegawaiKontrakRadioButton; WinRadioButton uIPegawaiTetapRadioButton = this.UIWorldMartWiraRedisHoWindow10.UIPegawaiTetapWindow.UIPegawaiTetapRadioButton; WinEdit uITxtTunjanganPegEdit = this.UIWorldMartWiraRedisHoWindow4.UITxtTunjanganPegWindow.UITxtTunjanganPegEdit; WinButton uISubmitButton = this.UIWorldMartWiraRedisHoWindow13.UISubmitWindow.UISubmitButton; WinButton uIOKButton = this.UIOKWindow.UIOKButton; #endregion // Select 'Keamanan' in 'cmbJabPeg' combo box uICmbJabPegComboBox.SelectedItem = this.RecordedPegawaiManager3Params.UICmbJabPegComboBoxSelectedItem; // Type 'I' in 'txtNamaPeg' text box uITxtNamaPegEdit.Text = this.RecordedPegawaiManager3Params.UITxtNamaPegEditText; // Type 'Ado Dodo' in 'txtNamaPeg' text box uITxtNamaPegEdit.Text = this.RecordedPegawaiManager3Params.UITxtNamaPegEditText1; // Type '{Tab}' in 'txtNamaPeg' text box Keyboard.SendKeys(uITxtNamaPegEdit, this.RecordedPegawaiManager3Params.UITxtNamaPegEditSendKeys, ModifierKeys.None); // Type 'Keputih V/23' in 'txtAlamatPeg' text box uITxtAlamatPegEdit.Text = this.RecordedPegawaiManager3Params.UITxtAlamatPegEditText; // Type '60502030' in 'txtTelpPeg' text box uITxtTelpPegEdit.Text = this.RecordedPegawaiManager3Params.UITxtTelpPegEditText; // Select 'Pegawai Kontrak' radio button uIPegawaiKontrakRadioButton.Selected = this.RecordedPegawaiManager3Params.UIPegawaiKontrakRadioButtonSelected; // Select 'Pegawai Tetap' radio button uIPegawaiTetapRadioButton.Selected = this.RecordedPegawaiManager3Params.UIPegawaiTetapRadioButtonSelected; // Type '200000' in 'txtTunjanganPeg' text box uITxtTunjanganPegEdit.Text = this.RecordedPegawaiManager3Params.UITxtTunjanganPegEditText; // Click 'Submit' button Mouse.Click(uISubmitButton, new Point(57, 11)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(50, 10)); } /// <summary> /// RecordedPegawaiManager4 - Use 'RecordedPegawaiManager4Params' to pass parameters into this method.

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 29

/// </summary> public void RecordedPegawaiManager4() { #region Variable Declarations WinButton uIOpenButton = this.UIWorldMartWiraRedisHoWindow9.UICmbSearchPegWindow.UIGajiPokokComboBox.UIOpenButton; WinButton uICloseButton = this.UIWorldMartWiraRedisHoWindow9.UICmbSearchPegWindow.UIGajiPokokComboBox.UICloseButton; WinButton uIEditButton = this.UIWorldMartWiraRedisHoWindow7.UIEditWindow.UIEditButton; WinComboBox uIGajiPokokComboBox = this.UIWorldMartWiraRedisHoWindow9.UICmbSearchPegWindow.UIGajiPokokComboBox; #endregion // Click 'Open' button Mouse.Click(uIOpenButton, new Point(7, 5)); // Click 'Close' button Mouse.Click(uICloseButton, new Point(7, 5)); // Click 'Edit' button Mouse.Click(uIEditButton, new Point(42, 5)); // Select 'Budi' in 'Gaji Pokok' combo box uIGajiPokokComboBox.SelectedItem = this.RecordedPegawaiManager4Params.UIGajiPokokComboBoxSelectedItem; } /// <summary> /// AssertMethodPegawaiManager3 - Use 'AssertMethodPegawaiManager3ExpectedValues' to pass parameters into this method. /// </summary> public void AssertMethodPegawaiManager3() { #region Variable Declarations WinEdit uITxtIDPegEdit = this.UIWorldMartWiraRedisHoWindow14.UITxtIDPegWindow.UITxtIDPegEdit; WinComboBox uICmbJabPegComboBox = this.UIWorldMartWiraRedisHoWindow11.UICmbJabPegWindow.UICmbJabPegComboBox; WinEdit uITxtGajiPokokPegEdit = this.UIWorldMartWiraRedisHoWindow15.UITxtGajiPokokPegWindow.UITxtGajiPokokPegEdit; WinEdit uITxtNamaPegEdit = this.UIWorldMartWiraRedisHoWindow1.UITxtNamaPegWindow.UITxtNamaPegEdit; WinEdit uITxtAlamatPegEdit = this.UIWorldMartWiraRedisHoWindow2.UITxtAlamatPegWindow.UITxtAlamatPegEdit; WinEdit uITxtTelpPegEdit = this.UIWorldMartWiraRedisHoWindow3.UITxtTelpPegWindow.UITxtTelpPegEdit; WinDateTimePicker uIDtpTglMasukPegDateTimePicker = this.UIWorldMartWiraRedisHoWindow16.UIDtpTglMasukPegWindow.UIDtpTglMasukPegDateTimePicker; WinRadioButton uIPegawaiKontrakRadioButton = this.UIWorldMartWiraRedisHoWindow12.UIPegawaiKontrakWindow.UIPegawaiKontrakRadioButton; WinEdit uITxtTotalGajiEdit = this.UIWorldMartWiraRedisHoWindow5.UITxtTotalGajiWindow.UITxtTotalGajiEdit; WinButton uISubmitButton = this.UIWorldMartWiraRedisHoWindow13.UISubmitWindow.UISubmitButton; WinButton uIPayButton = this.UIWorldMartWiraRedisHoWindow8.UIPayWindow.UIPayButton; #endregion

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 30

// Verify that 'txtIDPeg' text box's property 'Text' equals '0013' Assert.AreEqual(this.AssertMethodPegawaiManager3ExpectedValues.UITxtIDPegEditText, uITxtIDPegEdit.Text); // Verify that 'txtIDPeg' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiManager3ExpectedValues.UITxtIDPegEditEnabled, uITxtIDPegEdit.Enabled); // Verify that 'cmbJabPeg' combo box's property 'SelectedItem' equals 'Kasir' Assert.AreEqual(this.AssertMethodPegawaiManager3ExpectedValues.UICmbJabPegComboBoxSelectedItem, uICmbJabPegComboBox.SelectedItem); // Verify that 'cmbJabPeg' combo box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiManager3ExpectedValues.UICmbJabPegComboBoxEnabled, uICmbJabPegComboBox.Enabled); // Verify that 'txtGajiPokokPeg' text box's property 'Text' equals '1500000' Assert.AreEqual(this.AssertMethodPegawaiManager3ExpectedValues.UITxtGajiPokokPegEditText, uITxtGajiPokokPegEdit.Text); // Verify that 'txtGajiPokokPeg' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiManager3ExpectedValues.UITxtGajiPokokPegEditEnabled, uITxtGajiPokokPegEdit.Enabled); // Verify that 'txtNamaPeg' text box's property 'Text' equals 'Budi' Assert.AreEqual(this.AssertMethodPegawaiManager3ExpectedValues.UITxtNamaPegEditText, uITxtNamaPegEdit.Text); // Verify that 'txtNamaPeg' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiManager3ExpectedValues.UITxtNamaPegEditEnabled, uITxtNamaPegEdit.Enabled); // Verify that 'txtAlamatPeg' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiManager3ExpectedValues.UITxtAlamatPegEditEnabled, uITxtAlamatPegEdit.Enabled); // Verify that 'txtAlamatPeg' text box's property 'Text' equals 'RSMK' Assert.AreEqual(this.AssertMethodPegawaiManager3ExpectedValues.UITxtAlamatPegEditText, uITxtAlamatPegEdit.Text); // Verify that 'txtTelpPeg' text box's property 'Text' equals '2879165' Assert.AreEqual(this.AssertMethodPegawaiManager3ExpectedValues.UITxtTelpPegEditText, uITxtTelpPegEdit.Text); // Verify that 'txtTelpPeg' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiManager3ExpectedValues.UITxtTelpPegEditEnabled, uITxtTelpPegEdit.Enabled); // Verify that 'dtpTglMasukPeg' date time picker's property 'DateTimeAsString' equals '06/02/2010 00:00:00'

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 31

Assert.AreEqual(this.AssertMethodPegawaiManager3ExpectedValues.UIDtpTglMasukPegDateTimePickerDateTimeAsString, uIDtpTglMasukPegDateTimePicker.DateTimeAsString); // Verify that 'dtpTglMasukPeg' date time picker's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiManager3ExpectedValues.UIDtpTglMasukPegDateTimePickerEnabled, uIDtpTglMasukPegDateTimePicker.Enabled); // Verify that 'Pegawai Kontrak' radio button's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiManager3ExpectedValues.UIPegawaiKontrakRadioButtonEnabled, uIPegawaiKontrakRadioButton.Enabled); // Verify that 'Pegawai Kontrak' radio button's property 'Selected' equals 'True' Assert.AreEqual(this.AssertMethodPegawaiManager3ExpectedValues.UIPegawaiKontrakRadioButtonSelected, uIPegawaiKontrakRadioButton.Selected); // Verify that 'txtTotalGaji' text box's property 'Text' equals '1500000' Assert.AreEqual(this.AssertMethodPegawaiManager3ExpectedValues.UITxtTotalGajiEditText, uITxtTotalGajiEdit.Text); // Verify that 'txtTotalGaji' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiManager3ExpectedValues.UITxtTotalGajiEditEnabled, uITxtTotalGajiEdit.Enabled); // Verify that 'Submit' button's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiManager3ExpectedValues.UISubmitButtonEnabled, uISubmitButton.Enabled); // Verify that 'Pay' button's property 'Enabled' equals 'True' Assert.AreEqual(this.AssertMethodPegawaiManager3ExpectedValues.UIPayButtonEnabled, uIPayButton.Enabled); } /// <summary> /// RecordedPegawaiManager5 - Use 'RecordedPegawaiManager5Params' to pass parameters into this method. /// </summary> public void RecordedPegawaiManager5() { #region Variable Declarations WinButton uIPayButton = this.UIWorldMartWiraRedisHoWindow8.UIPayWindow.UIPayButton; WinButton uIYesButton = this.UIPaySalaryWindow.UIYesWindow.UIYesButton; WinButton uIOKButton = this.UIOKWindow.UIOKButton; WinButton uIEditButton = this.UIWorldMartWiraRedisHoWindow7.UIEditWindow.UIEditButton; WinEdit uITxtAlamatPegEdit = this.UIWorldMartWiraRedisHoWindow2.UITxtAlamatPegWindow.UITxtAlamatPegEdit; WinButton uISubmitButton = this.UIWorldMartWiraRedisHoWindow13.UISubmitWindow.UISubmitButton; WinComboBox uIGajiPokokComboBox = this.UIWorldMartWiraRedisHoWindow9.UICmbSearchPegWindow.UIGajiPokokComboBox; WinButton uIRemoveButton = this.UIWorldMartWiraRedisHoWindow.UIRemoveWindow.UIRemoveButton; WinButton uIYesButton1 = this.UIRemovePegawaiWindow.UIYesWindow.UIYesButton;

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 32

WinButton uIBtnLogoutButton = this.UIWorldMartWiraRedisHoWindow.UIBtnLogoutWindow.UIBtnLogoutButton; #endregion // Click 'Pay' button Mouse.Click(uIPayButton, new Point(54, 8)); // Click '&Yes' button Mouse.Click(uIYesButton, new Point(49, 12)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(29, 19)); // Click 'Edit' button Mouse.Click(uIEditButton, new Point(35, 7)); // Type 'RSMJ 12 ABC' in 'txtAlamatPeg' text box uITxtAlamatPegEdit.Text = this.RecordedPegawaiManager5Params.UITxtAlamatPegEditText; // Click 'Submit' button Mouse.Click(uISubmitButton, new Point(55, 14)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(68, 11)); // Click 'Edit' button Mouse.Click(uIEditButton, new Point(47, 10)); // Type 'RSMK' in 'txtAlamatPeg' text box uITxtAlamatPegEdit.Text = this.RecordedPegawaiManager5Params.UITxtAlamatPegEditText1; // Click 'Submit' button Mouse.Click(uISubmitButton, new Point(32, 5)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(62, 10)); // Select 'Ado Dodo' in 'Gaji Pokok' combo box uIGajiPokokComboBox.SelectedItem = this.RecordedPegawaiManager5Params.UIGajiPokokComboBoxSelectedItem; // Click 'Remove' button Mouse.Click(uIRemoveButton, new Point(24, 7)); // Click '&Yes' button Mouse.Click(uIYesButton1, new Point(26, 2)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(25, 9)); // Select 'Muhammad Ali Fauzi' in 'Gaji Pokok' combo box uIGajiPokokComboBox.SelectedItem = this.RecordedPegawaiManager5Params.UIGajiPokokComboBoxSelectedItem1; // Click 'btnLogout' button Mouse.Click(uIBtnLogoutButton, new Point(66, 18)); }

Test Result :

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 33

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 34

6. UITestProduk

Recorded Actions :

Generated Method Recorded Actions :

[TestMethod] public void CodedUITestProduk() { // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. // For more information on generated code, see http://go.microsoft.com/fwlink/?LinkId=179463 this.UIMap.RecordedProduk1(); this.UIMap.AssertMethodProduk1(); this.UIMap.RecordedProduk2(); this.UIMap.AssertMethodProduk2(); this.UIMap.RecordedProduk3(); this.UIMap.AssertMethodProduk3(); this.UIMap.RecordedProduk4(); }

/// <summary> /// RecordedProduk1 - Use 'RecordedProduk1Params' to pass parameters into this method. /// </summary> public void RecordedProduk1() { #region Variable Declarations WinEdit uITxtUserEdit = this.UIWorldMartLoginWindow.UITxtUserWindow.UITxtUserEdit; WinEdit uITxtPassEdit = this.UIWorldMartLoginWindow.UITxtPassWindow.UITxtPassEdit; WinButton uILoginButton = this.UIWorldMartLoginWindow.UILoginWindow.UILoginButton; WinButton uIOKButton = this.UIOKWindow.UIOKButton; WinText uIPasswordText = this.UIWorldMartLoginWindow.UIPasswordWindow.UIPasswordText; WinButton uIBtnProdukButton = this.UIWorldMartLoginWindow2.UIBtnProdukWindow.UIBtnProdukButton; #endregion // Type 'wira' in 'txtUser' text box uITxtUserEdit.Text = this.RecordedProduk1Params.UITxtUserEditText; // Type '{Tab}' in 'txtUser' text box Keyboard.SendKeys(uITxtUserEdit, this.RecordedProduk1Params.UITxtUserEditSendKeys, ModifierKeys.None); // Type '********' in 'txtPass' text box Keyboard.SendKeys(uITxtPassEdit, this.RecordedProduk1Params.UITxtPassEditSendKeys, true); // Click 'Login' button Mouse.Click(uILoginButton, new Point(55, 10)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(47, 6)); // Move 'txtPass' text box from (45, 1) to 'Password' label (39, 2) uIPasswordText.EnsureClickable(new Point(39, 2)); Mouse.StartDragging(uITxtPassEdit, new Point(45, 1)); Mouse.StopDragging(uIPasswordText, new Point(39, 2)); // Type '********' in 'txtPass' text box Keyboard.SendKeys(uITxtPassEdit,

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 36

this.RecordedProduk1Params.UITxtPassEditSendKeys1, true); // Click 'Login' button Mouse.Click(uILoginButton, new Point(48, 11)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(42, 19)); // Click 'btnProduk' button Mouse.Click(uIBtnProdukButton, new Point(74, 60)); }

/// <summary> /// AssertMethodProduk1 - Use 'AssertMethodProduk1ExpectedValues' to pass parameters into this method. /// </summary> public void AssertMethodProduk1() { #region Variable Declarations WinEdit uIItemEdit = this.UIWorldMartWiraRedisHoWindow.UIItemWindow.UIItemEdit; WinEdit uIItemEdit1 = this.UIWorldMartWiraRedisHoWindow.UIItemWindow1.UIItemEdit; WinEdit uITxtIDProEdit = this.UIWorldMartWiraRedisHoWindow17.UITxtIDProWindow.UITxtIDProEdit; WinEdit uITxtNamaProEdit = this.UIWorldMartWiraRedisHoWindow18.UITxtNamaProWindow.UITxtNamaProEdit; WinComboBox uICmbIDKatProComboBox = this.UIWorldMartWiraRedisHoWindow19.UICmbIDKatProWindow.UICmbIDKatProComboBox; WinEdit uIItemEdit2 = this.UIWorldMartWiraRedisHoWindow20.UIItem0Window.UIItemEdit; WinEdit uIItemEdit3 = this.UIWorldMartWiraRedisHoWindow21.UIItem0Window.UIItemEdit; WinEdit uIItemEdit4 = this.UIWorldMartWiraRedisHoWindow22.UIItem0Window.UIItemEdit; WinDateTimePicker uIDtpBtsTglDisplayDateTimePicker = this.UIWorldMartWiraRedisHoWindow23.UIDtpBtsTglDisplayWindow.UIDtpBtsTglDisplayDateTimePicker; WinButton uISubmitButton = this.UIWorldMartWiraRedisHoWindow24.UISubmitWindow.UISubmitButton; WinButton uICancelButton = this.UIWorldMartWiraRedisHoWindow25.UICancelWindow.UICancelButton; WinButton uIUploadButton = this.UIWorldMartWiraRedisHoWindow26.UIUploadWindow.UIUploadButton; WinButton uIEditButton = this.UIWorldMartWiraRedisHoWindow27.UIEditWindow.UIEditButton; #endregion // Verify that 'Unknown Name' text box's property 'Text' equals '' Assert.AreEqual(this.AssertMethodProduk1ExpectedValues.UIItemEditText, uIItemEdit.Text); // Verify that 'Unknown Name' text box's property 'Enabled' equals 'True' Assert.AreEqual(this.AssertMethodProduk1ExpectedValues.UIItemEditEnabled, uIItemEdit.Enabled); // Verify that 'Unknown Name' text box's property 'Text' equals '' Assert.AreEqual(this.AssertMethodProduk1ExpectedValues.UIItemEditText1, uIItemEdit1.Text); // Verify that 'Unknown Name' text box's property 'Enabled' equals 'True' Assert.AreEqual(this.AssertMethodProduk1ExpectedValues.UIItemEditEnabled1, uIItemEdit1.Enabled);

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 37

// Verify that 'txtIDPro' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodProduk1ExpectedValues.UITxtIDProEditEnabled, uITxtIDProEdit.Enabled); // Verify that 'txtNamaPro' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodProduk1ExpectedValues.UITxtNamaProEditEnabled, uITxtNamaProEdit.Enabled); // Verify that 'cmbIDKatPro' combo box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodProduk1ExpectedValues.UICmbIDKatProComboBoxEnabled, uICmbIDKatProComboBox.Enabled); // Verify that 'Unknown Name' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodProduk1ExpectedValues.UIItemEditEnabled2, uIItemEdit2.Enabled); // Verify that 'Unknown Name' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodProduk1ExpectedValues.UIItemEditEnabled3, uIItemEdit3.Enabled); // Verify that 'Unknown Name' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodProduk1ExpectedValues.UIItemEditEnabled4, uIItemEdit4.Enabled); // Verify that 'dtpBtsTglDisplay' date time picker's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodProduk1ExpectedValues.UIDtpBtsTglDisplayDateTimePickerEnabled, uIDtpBtsTglDisplayDateTimePicker.Enabled); // Verify that 'Submit' button's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodProduk1ExpectedValues.UISubmitButtonEnabled, uISubmitButton.Enabled); // Verify that 'Cancel' button's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodProduk1ExpectedValues.UICancelButtonEnabled, uICancelButton.Enabled); // Verify that 'Upload' button's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodProduk1ExpectedValues.UIUploadButtonEnabled, uIUploadButton.Enabled); // Verify that 'Edit' button's property 'Enabled' equals 'True' Assert.AreEqual(this.AssertMethodProduk1ExpectedValues.UIEditButtonEnabled, uIEditButton.Enabled); } /// <summary> /// RecordedProduk2 - Use 'RecordedProduk2Params' to pass parameters into this method. /// </summary> public void RecordedProduk2() { #region Variable Declarations WinButton uIEditButton = this.UIWorldMartWiraRedisHoWindow27.UIEditWindow.UIEditButton; WinButton uICancelButton = this.UIWorldMartWiraRedisHoWindow25.UICancelWindow.UICancelButton; WinComboBox uICmbSearchIDComboBox = this.UIWorldMartWiraRedisHoWindow28.UICmbSearchIDWindow.UICmbSearchIDComboBox; WinComboBox uICmbSearchNamaComboBox = this.UIWorldMartWiraRedisHoWindow29.UICmbSearchNamaWindow.UICmbSearchNamaComboBox;

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 38

#endregion // Click 'Edit' button Mouse.Click(uIEditButton, new Point(38, 15)); // Click 'Cancel' button Mouse.Click(uICancelButton, new Point(48, 14)); // Select '00000000000000000001' in 'cmbSearchID' combo box uICmbSearchIDComboBox.SelectedItem = this.RecordedProduk2Params.UICmbSearchIDComboBoxSelectedItem; // Select 'Mie Instan Indomie' in 'cmbSearchNama' combo box uICmbSearchNamaComboBox.SelectedItem = this.RecordedProduk2Params.UICmbSearchNamaComboBoxSelectedItem; } /// <summary> /// AssertMethodProduk2 - Use 'AssertMethodProduk2ExpectedValues' to pass parameters into this method. /// </summary> public void AssertMethodProduk2() { #region Variable Declarations WinEdit uITxtIDProEdit = this.UIWorldMartWiraRedisHoWindow17.UITxtIDProWindow.UITxtIDProEdit; WinEdit uIItemEdit = this.UIWorldMartWiraRedisHoWindow.UIItemWindow2.UIItemEdit; WinEdit uITxtNamaProEdit = this.UIWorldMartWiraRedisHoWindow18.UITxtNamaProWindow.UITxtNamaProEdit; WinEdit uIItemEdit1 = this.UIWorldMartWiraRedisHoWindow20.UIItem0Window.UIItemEdit; WinEdit uIItemEdit2 = this.UIWorldMartWiraRedisHoWindow21.UIItem0Window.UIItemEdit; WinEdit uIItemEdit3 = this.UIWorldMartWiraRedisHoWindow22.UIItem0Window.UIItemEdit; WinEdit uIItemEdit4 = this.UIWorldMartWiraRedisHoWindow.UIItemWindow1.UIItemEdit; WinButton uISubmitButton = this.UIWorldMartWiraRedisHoWindow24.UISubmitWindow.UISubmitButton; WinButton uICancelButton = this.UIWorldMartWiraRedisHoWindow25.UICancelWindow.UICancelButton; #endregion // Verify that 'txtIDPro' text box's property 'Text' equals '00000000000000000001' Assert.AreEqual(this.AssertMethodProduk2ExpectedValues.UITxtIDProEditText, uITxtIDProEdit.Text); // Verify that 'Unknown Name' text box's property 'Text' equals '00000001 | Makanan Ringan' Assert.AreEqual(this.AssertMethodProduk2ExpectedValues.UIItemEditText, uIItemEdit.Text); // Verify that 'txtNamaPro' text box's property 'Text' equals 'Mie Instan Indomie' Assert.AreEqual(this.AssertMethodProduk2ExpectedValues.UITxtNamaProEditText, uITxtNamaProEdit.Text); // Verify that 'Unknown Name' text box's property 'Text' equals '1.500' Assert.AreEqual(this.AssertMethodProduk2ExpectedValues.UIItemEditText1, uIItemEdit1.Text); // Verify that 'Unknown Name' text box's property 'Text' equals '1.200' Assert.AreEqual(this.AssertMethodProduk2ExpectedValues.UIItemEditText2, uIItemEdit2.Text);

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 39

// Verify that 'txtNamaPro' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodProduk2ExpectedValues.UITxtNamaProEditEnabled, uITxtNamaProEdit.Enabled); // Verify that 'Unknown Name' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodProduk2ExpectedValues.UIItemEditEnabled, uIItemEdit1.Enabled); // Verify that 'Unknown Name' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodProduk2ExpectedValues.UIItemEditEnabled1, uIItemEdit2.Enabled); // Verify that 'Unknown Name' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodProduk2ExpectedValues.UIItemEditEnabled2, uIItemEdit3.Enabled); // Verify that 'Unknown Name' text box's property 'Text' equals 'Mie Instan Indomie' Assert.AreEqual(this.AssertMethodProduk2ExpectedValues.UIItemEditText3, uIItemEdit4.Text); // Verify that 'Submit' button's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodProduk2ExpectedValues.UISubmitButtonEnabled, uISubmitButton.Enabled); // Verify that 'Cancel' button's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodProduk2ExpectedValues.UICancelButtonEnabled, uICancelButton.Enabled); }

/// <summary> /// RecordedProduk3 - Use 'RecordedProduk3Params' to pass parameters into this method. /// </summary> public void RecordedProduk3() { #region Variable Declarations WinButton uIEditButton = this.UIWorldMartWiraRedisHoWindow27.UIEditWindow.UIEditButton; WinEdit uITxtNamaProEdit = this.UIWorldMartWiraRedisHoWindow18.UITxtNamaProWindow.UITxtNamaProEdit; WinComboBox uINudHargaNormalComboBox = this.UIWorldMartWiraRedisHoWindow30.UINudHargaNormalWindow.UINudHargaNormalComboBox; WinEdit uIItemEdit = this.UIWorldMartWiraRedisHoWindow22.UIItem0Window.UIItemEdit; WinButton uISubmitButton = this.UIWorldMartWiraRedisHoWindow24.UISubmitWindow.UISubmitButton; WinComboBox uICmbSearchNamaComboBox = this.UIWorldMartWiraRedisHoWindow29.UICmbSearchNamaWindow.UICmbSearchNamaComboBox; #endregion // Click 'Edit' button Mouse.Click(uIEditButton, new Point(22, 11)); // Type 'Mie Instan Indomie Seleraku' in 'txtNamaPro' text box uITxtNamaProEdit.Text = this.RecordedProduk3Params.UITxtNamaProEditText; // Select '1550' in 'nudHargaNormal' combo box uINudHargaNormalComboBox.SelectedItem = this.RecordedProduk3Params.UINudHargaNormalComboBoxSelectedItem; // Click 'Unknown Name' text box Mouse.Click(uIItemEdit, new Point(61, 10));

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 40

// Click 'Submit' button Mouse.Click(uISubmitButton, new Point(33, 10)); // Select 'Mie Instan Indomie' in 'cmbSearchNama' combo box uICmbSearchNamaComboBox.SelectedItem = this.RecordedProduk3Params.UICmbSearchNamaComboBoxSelectedItem; } /// <summary> /// AssertMethodProduk3 - Use 'AssertMethodProduk3ExpectedValues' to pass parameters into this method. /// </summary> public void AssertMethodProduk3() { #region Variable Declarations WinEdit uITxtNamaProEdit = this.UIWorldMartWiraRedisHoWindow18.UITxtNamaProWindow.UITxtNamaProEdit; WinEdit uIItemEdit = this.UIWorldMartWiraRedisHoWindow20.UIItem0Window.UIItemEdit; WinEdit uIItemEdit1 = this.UIWorldMartWiraRedisHoWindow21.UIItem0Window.UIItemEdit; #endregion // Verify that 'txtNamaPro' text box's property 'Text' equals 'Mie Instan Indomie Seleraku' Assert.AreEqual(this.AssertMethodProduk3ExpectedValues.UITxtNamaProEditText, uITxtNamaProEdit.Text); // Verify that 'Unknown Name' text box's property 'Text' equals '1.550' Assert.AreEqual(this.AssertMethodProduk3ExpectedValues.UIItemEditText, uIItemEdit.Text); // Verify that 'Unknown Name' text box's property 'Text' equals '1.200' Assert.AreEqual(this.AssertMethodProduk3ExpectedValues.UIItemEditText1, uIItemEdit1.Text); } /// <summary> /// RecordedProduk4 - Use 'RecordedProduk4Params' to pass parameters into this method. /// </summary> public void RecordedProduk4() { #region Variable Declarations WinComboBox uICmbSearchNamaComboBox = this.UIWorldMartWiraRedisHoWindow29.UICmbSearchNamaWindow.UICmbSearchNamaComboBox; WinButton uIBtnLogoutButton = this.UIWorldMartWiraRedisHoWindow.UIBtnLogoutWindow.UIBtnLogoutButton; #endregion // Select 'Daging Sapi' in 'cmbSearchNama' combo box uICmbSearchNamaComboBox.SelectedItem = this.RecordedProduk4Params.UICmbSearchNamaComboBoxSelectedItem; // Click 'btnLogout' button Mouse.Click(uIBtnLogoutButton, new Point(75, 38)); }

Test Result :

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 41

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 42

7. UITestSupplier

Recorded Actions :

Generated Method Recorded Actions :

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 43

[TestMethod] public void CodedUITestSupplier() { // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. // For more information on generated code, see http://go.microsoft.com/fwlink/?LinkId=179463 this.UIMap.RecordedSupplier1(); this.UIMap.AssertMethodSupplier1(); this.UIMap.RecordedSupplier2(); this.UIMap.AssertMethodSupplier2(); this.UIMap.RecordedSupplier3(); }

/// <summary> /// RecordedSupplier1 - Use 'RecordedSupplier1Params' to pass parameters into this method. /// </summary> public void RecordedSupplier1() { #region Variable Declarations WinEdit uITxtUserEdit = this.UIWorldMartLoginWindow.UITxtUserWindow.UITxtUserEdit; WinEdit uITxtPassEdit = this.UIWorldMartLoginWindow.UITxtPassWindow.UITxtPassEdit; WinButton uILoginButton = this.UIWorldMartLoginWindow.UILoginWindow.UILoginButton; WinButton uIOKButton = this.UIOKWindow.UIOKButton; WinButton uIBtnSupplierButton = this.UIWorldMartLoginWindow3.UIBtnSupplierWindow.UIBtnSupplierButton; WinButton uIOpenButton = this.UIWorldMartLoginWindow4.UICmbSearchSupplierWindow.UIOpenButton; WinButton uICloseButton = this.UIWorldMartLoginWindow4.UICmbSearchSupplierWindow.UICloseButton; WinButton uIEditButton = this.UIWorldMartLoginWindow5.UIEditWindow.UIEditButton; WinComboBox uICmbSearchSupplierComboBox = this.UIWorldMartLoginWindow4.UICmbSearchSupplierWindow.UICmbSearchSupplierComboBox; WinEdit uITxtAlamatSupEdit = this.UIWorldMartLoginWindow6.UITxtAlamatSupWindow.UITxtAlamatSupEdit; WinButton uICancelButton = this.UIWorldMartLoginWindow7.UICancelWindow.UICancelButton; #endregion // Type 'wira' in 'txtUser' text box uITxtUserEdit.Text = this.RecordedSupplier1Params.UITxtUserEditText; // Click 'txtPass' text box Mouse.Click(uITxtPassEdit, new Point(73, 5)); // Type '********' in 'txtPass' text box Keyboard.SendKeys(uITxtPassEdit, this.RecordedSupplier1Params.UITxtPassEditSendKeys, true); // Click 'Login' button Mouse.Click(uILoginButton, new Point(43, 5)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(17, 12)); // Click 'btnSupplier' button Mouse.Click(uIBtnSupplierButton, new Point(21, 62)); // Click 'Open' button

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 44

Mouse.Click(uIOpenButton, new Point(7, 10)); // Click 'Close' button Mouse.Click(uICloseButton, new Point(7, 10)); // Click 'Edit' button Mouse.Click(uIEditButton, new Point(19, 6)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(31, 7)); // Select 'CV.Suka Maju' in 'cmbSearchSupplier' combo box uICmbSearchSupplierComboBox.SelectedItem = this.RecordedSupplier1Params.UICmbSearchSupplierComboBoxSelectedItem; // Click 'Edit' button Mouse.Click(uIEditButton, new Point(12, 13)); // Type 'Kenjeran 30 Surabaya' in 'txtAlamatSup' text box uITxtAlamatSupEdit.Text = this.RecordedSupplier1Params.UITxtAlamatSupEditText; // Click 'Cancel' button Mouse.Click(uICancelButton, new Point(45, 8)); }

/// <summary> /// AssertMethodSupplier1 - Use 'AssertMethodSupplier1ExpectedValues' to pass parameters into this method. /// </summary> public void AssertMethodSupplier1() { #region Variable Declarations WinEdit uITxtIDSupEdit = this.UIWorldMartWiraRedisHoWindow31.UITxtIDSupWindow.UITxtIDSupEdit; WinEdit uITxtNamaSupEdit = this.UIWorldMartWiraRedisHoWindow32.UITxtNamaSupWindow.UITxtNamaSupEdit; WinEdit uITxtAlamatSupEdit = this.UIWorldMartLoginWindow6.UITxtAlamatSupWindow.UITxtAlamatSupEdit; WinEdit uITxtTelpSupEdit = this.UIWorldMartWiraRedisHoWindow33.UITxtTelpSupWindow.UITxtTelpSupEdit; WinButton uISubmitButton = this.UIWorldMartWiraRedisHoWindow34.UISubmitWindow.UISubmitButton; WinButton uICancelButton = this.UIWorldMartLoginWindow7.UICancelWindow.UICancelButton; WinButton uIEditButton = this.UIWorldMartLoginWindow5.UIEditWindow.UIEditButton; #endregion // Verify that 'txtIDSup' text box's property 'Text' equals '00000002' Assert.AreEqual(this.AssertMethodSupplier1ExpectedValues.UITxtIDSupEditText, uITxtIDSupEdit.Text); // Verify that 'txtIDSup' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodSupplier1ExpectedValues.UITxtIDSupEditEnabled, uITxtIDSupEdit.Enabled); // Verify that 'txtNamaSup' text box's property 'Text' equals 'CV.Suka Maju' Assert.AreEqual(this.AssertMethodSupplier1ExpectedValues.UITxtNamaSupEditText, uITxtNamaSupEdit.Text); // Verify that 'txtNamaSup' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodSupplier1ExpectedValues.UITxtNamaSupEditEnabled, uITxtNamaSupEdit.Enabled);

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 45

// Verify that 'txtAlamatSup' text box's property 'Text' equals 'Kenjeran 26 Surabaya' Assert.AreEqual(this.AssertMethodSupplier1ExpectedValues.UITxtAlamatSupEditText, uITxtAlamatSupEdit.Text); // Verify that 'txtAlamatSup' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodSupplier1ExpectedValues.UITxtAlamatSupEditEnabled, uITxtAlamatSupEdit.Enabled); // Verify that 'txtTelpSup' text box's property 'Text' equals '031454745' Assert.AreEqual(this.AssertMethodSupplier1ExpectedValues.UITxtTelpSupEditText, uITxtTelpSupEdit.Text); // Verify that 'txtTelpSup' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodSupplier1ExpectedValues.UITxtTelpSupEditEnabled, uITxtTelpSupEdit.Enabled); // Verify that 'Submit' button's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodSupplier1ExpectedValues.UISubmitButtonEnabled, uISubmitButton.Enabled); // Verify that 'Cancel' button's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodSupplier1ExpectedValues.UICancelButtonEnabled, uICancelButton.Enabled); // Verify that 'Edit' button's property 'Enabled' equals 'True' Assert.AreEqual(this.AssertMethodSupplier1ExpectedValues.UIEditButtonEnabled, uIEditButton.Enabled); }

/// <summary> /// RecordedSupplier2 - Use 'RecordedSupplier2Params' to pass parameters into this method. /// </summary> public void RecordedSupplier2() { #region Variable Declarations WinButton uIEditButton = this.UIWorldMartLoginWindow5.UIEditWindow.UIEditButton; WinEdit uITxtAlamatSupEdit = this.UIWorldMartLoginWindow6.UITxtAlamatSupWindow.UITxtAlamatSupEdit; WinEdit uITxtTelpSupEdit = this.UIWorldMartWiraRedisHoWindow33.UITxtTelpSupWindow.UITxtTelpSupEdit; WinButton uISubmitButton = this.UIWorldMartWiraRedisHoWindow34.UISubmitWindow.UISubmitButton; WinComboBox uICmbSearchSupplierComboBox = this.UIWorldMartLoginWindow4.UICmbSearchSupplierWindow.UICmbSearchSupplierComboBox; #endregion // Click 'Edit' button Mouse.Click(uIEditButton, new Point(12, 8)); // Type 'Kenjeran 30 Surabaya' in 'txtAlamatSup' text box uITxtAlamatSupEdit.Text = this.RecordedSupplier2Params.UITxtAlamatSupEditText; // Type '031454746' in 'txtTelpSup' text box uITxtTelpSupEdit.Text = this.RecordedSupplier2Params.UITxtTelpSupEditText; // Click 'Submit' button Mouse.Click(uISubmitButton, new Point(37, 8));

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 46

// Select 'CV.Suka Maju' in 'cmbSearchSupplier' combo box uICmbSearchSupplierComboBox.SelectedItem = this.RecordedSupplier2Params.UICmbSearchSupplierComboBoxSelectedItem; }

/// <summary> /// AssertMethodSupplier2 - Use 'AssertMethodSupplier2ExpectedValues' to pass parameters into this method. /// </summary> public void AssertMethodSupplier2() { #region Variable Declarations WinEdit uITxtAlamatSupEdit = this.UIWorldMartLoginWindow6.UITxtAlamatSupWindow.UITxtAlamatSupEdit; WinEdit uITxtTelpSupEdit = this.UIWorldMartWiraRedisHoWindow33.UITxtTelpSupWindow.UITxtTelpSupEdit; #endregion // Verify that 'txtAlamatSup' text box's property 'Text' equals 'Kenjeran 30 Surabaya' Assert.AreEqual(this.AssertMethodSupplier2ExpectedValues.UITxtAlamatSupEditText, uITxtAlamatSupEdit.Text); // Verify that 'txtTelpSup' text box's property 'Text' equals '031454746' Assert.AreEqual(this.AssertMethodSupplier2ExpectedValues.UITxtTelpSupEditText, uITxtTelpSupEdit.Text); } /// <summary> /// RecordedSupplier3 - Use 'RecordedSupplier3Params' to pass parameters into this method. /// </summary> public void RecordedSupplier3() { #region Variable Declarations WinButton uIEditButton = this.UIWorldMartLoginWindow5.UIEditWindow.UIEditButton; WinEdit uITxtAlamatSupEdit = this.UIWorldMartLoginWindow6.UITxtAlamatSupWindow.UITxtAlamatSupEdit; WinEdit uITxtTelpSupEdit = this.UIWorldMartWiraRedisHoWindow33.UITxtTelpSupWindow.UITxtTelpSupEdit; WinButton uISubmitButton = this.UIWorldMartWiraRedisHoWindow34.UISubmitWindow.UISubmitButton; WinButton uIAddButton = this.UIWorldMartWiraRedisHoWindow35.UIAddWindow.UIAddButton; WinEdit uITxtNamaSupEdit = this.UIWorldMartWiraRedisHoWindow32.UITxtNamaSupWindow.UITxtNamaSupEdit; WinComboBox uICmbSearchSupplierComboBox = this.UIWorldMartLoginWindow4.UICmbSearchSupplierWindow.UICmbSearchSupplierComboBox; WinButton uIBtnLogoutButton = this.UIWorldMartWiraRedisHoWindow.UIBtnLogoutWindow.UIBtnLogoutButton; #endregion // Click 'Edit' button Mouse.Click(uIEditButton, new Point(32, 13)); // Type 'Kenjeran 26 Surabaya' in 'txtAlamatSup' text box uITxtAlamatSupEdit.Text = this.RecordedSupplier3Params.UITxtAlamatSupEditText; // Type '031454745' in 'txtTelpSup' text box uITxtTelpSupEdit.Text = this.RecordedSupplier3Params.UITxtTelpSupEditText; // Click 'Submit' button

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 47

Mouse.Click(uISubmitButton, new Point(59, 11)); // Click 'Add' button Mouse.Click(uIAddButton, new Point(26, 11)); // Type 'UD. Jaya Abadi' in 'txtNamaSup' text box uITxtNamaSupEdit.Text = this.RecordedSupplier3Params.UITxtNamaSupEditText; // Type '{Tab}' in 'txtNamaSup' text box Keyboard.SendKeys(uITxtNamaSupEdit, this.RecordedSupplier3Params.UITxtNamaSupEditSendKeys, ModifierKeys.None); // Type 'Keputih Gang Makam' in 'txtAlamatSup' text box uITxtAlamatSupEdit.Text = this.RecordedSupplier3Params.UITxtAlamatSupEditText1; // Type '5437623' in 'txtTelpSup' text box uITxtTelpSupEdit.Text = this.RecordedSupplier3Params.UITxtTelpSupEditText1; // Click 'Submit' button Mouse.Click(uISubmitButton, new Point(63, 10)); // Select 'UD. Jaya Abadi' in 'cmbSearchSupplier' combo box uICmbSearchSupplierComboBox.SelectedItem = this.RecordedSupplier3Params.UICmbSearchSupplierComboBoxSelectedItem; // Click 'btnLogout' button Mouse.Click(uIBtnLogoutButton, new Point(55, 42)); }

Test Result :

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 48

8. UITestPegawaiBoss

Recorded Actions :

Generated Method Recorded Actions :

[TestMethod] public void CodedUITestPegawaiBoss() {

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 49

// To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items. // For more information on generated code, see http://go.microsoft.com/fwlink/?LinkId=179463 this.UIMap.RecordedPegawaiBoss1(); this.UIMap.AssertMethodPegawaiBoss1(); this.UIMap.RecordedPegawaiBoss2(); this.UIMap.AssertMethodPegawaiBoss2(); this.UIMap.RecordedPegawaiBoss3(); }

/// <summary> /// RecordedPegawaiBoss1 - Use 'RecordedPegawaiBoss1Params' to pass parameters into this method. /// </summary> public void RecordedPegawaiBoss1() { #region Variable Declarations WinEdit uITxtUserEdit = this.UIWorldMartLoginWindow.UITxtUserWindow.UITxtUserEdit; WinWindow uITxtPassWindow = this.UIWorldMartLoginWindow.UIWorldMartLoginClient.UITxtPassWindow; WinEdit uITxtPassEdit = this.UIWorldMartLoginWindow.UITxtPassWindow.UITxtPassEdit; WinButton uILoginButton = this.UIWorldMartLoginWindow.UILoginWindow.UILoginButton; WinButton uIOKButton = this.UIOKWindow.UIOKButton; #endregion // Type 'jeff' in 'txtUser' text box uITxtUserEdit.Text = this.RecordedPegawaiBoss1Params.UITxtUserEditText; // Click 'txtPass' window Mouse.Click(uITxtPassWindow, new Point(87, 18)); // Click 'txtPass' text box Mouse.Click(uITxtPassEdit, new Point(84, 11)); // Type '********' in 'txtPass' text box Keyboard.SendKeys(uITxtPassEdit, this.RecordedPegawaiBoss1Params.UITxtPassEditSendKeys, true); // Click 'Login' button Mouse.Click(uILoginButton, new Point(62, 9)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(37, 6)); // Click 'txtPass' text box Mouse.Click(uITxtPassEdit, new Point(70, 6)); // Type '********' in 'txtPass' text box Keyboard.SendKeys(uITxtPassEdit, this.RecordedPegawaiBoss1Params.UITxtPassEditSendKeys1, true); // Click 'Login' button Mouse.Click(uILoginButton, new Point(43, 19)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(29, 6)); }

/// <summary>

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 50

/// AssertMethodPegawaiBoss1 - Use 'AssertMethodPegawaiBoss1ExpectedValues' to pass parameters into this method. /// </summary> public void AssertMethodPegawaiBoss1() { #region Variable Declarations WinEdit uITxtNamaPegEdit = this.UIWorldMartJeffreyHermWindow.UITxtNamaPegWindow.UITxtNamaPegEdit; WinEdit uITxtAlamatPegEdit = this.UIWorldMartJeffreyHermWindow1.UITxtAlamatPegWindow.UITxtAlamatPegEdit; WinEdit uITxtTelpPegEdit = this.UIWorldMartJeffreyHermWindow2.UITxtTelpPegWindow.UITxtTelpPegEdit; WinWindow uITxtIDPegWindow = this.UIWorldMartJeffreyHermWindow7.UIPanelManagerPegawaiWindow.UITxtIDPegWindow; WinButton uISubmitButton = this.UIWorldMartJeffreyHermWindow8.UISubmitWindow.UISubmitButton; WinButton uICancelButton = this.UIWorldMartJeffreyHermWindow9.UICancelWindow.UICancelButton; WinWindow uIDtpTglAkhirPegWindow = this.UIWorldMartJeffreyHermWindow7.UIPanelManagerPegawaiWindow.UIDtpTglAkhirPegWindow; #endregion // Verify that 'txtNamaPeg' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiBoss1ExpectedValues.UITxtNamaPegEditEnabled, uITxtNamaPegEdit.Enabled); // Verify that 'txtAlamatPeg' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiBoss1ExpectedValues.UITxtAlamatPegEditEnabled, uITxtAlamatPegEdit.Enabled); // Verify that 'txtTelpPeg' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiBoss1ExpectedValues.UITxtTelpPegEditEnabled, uITxtTelpPegEdit.Enabled); // Verify that 'txtIDPeg' window's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiBoss1ExpectedValues.UITxtIDPegWindowEnabled, uITxtIDPegWindow.Enabled); // Verify that 'Submit' button's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiBoss1ExpectedValues.UISubmitButtonEnabled, uISubmitButton.Enabled); // Verify that 'Cancel' button's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiBoss1ExpectedValues.UICancelButtonEnabled, uICancelButton.Enabled); // Verify that 'dtpTglAkhirPeg' window's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiBoss1ExpectedValues.UIDtpTglAkhirPegWindowEnabled, uIDtpTglAkhirPegWindow.Enabled); } /// <summary> /// RecordedPegawaiBoss2 - Use 'RecordedPegawaiBoss2Params' to pass parameters into this method. /// </summary> public void RecordedPegawaiBoss2() {

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 51

#region Variable Declarations WinButton uIEditButton = this.UIWorldMartLoginWindow9.UIEditWindow.UIEditButton; WinButton uIRemoveButton = this.UIWorldMartLoginWindow10.UIRemoveWindow.UIRemoveButton; WinButton uIAddButton = this.UIWorldMartLoginWindow11.UIAddWindow.UIAddButton; WinComboBox uICmbJabPegComboBox = this.UIWorldMartJeffreyHermWindow10.UICmbJabPegWindow.UICmbJabPegComboBox; WinEdit uITxtNamaPegEdit = this.UIWorldMartJeffreyHermWindow.UITxtNamaPegWindow.UITxtNamaPegEdit; WinEdit uITxtAlamatPegEdit = this.UIWorldMartJeffreyHermWindow1.UITxtAlamatPegWindow.UITxtAlamatPegEdit; WinEdit uITxtTelpPegEdit = this.UIWorldMartJeffreyHermWindow2.UITxtTelpPegWindow.UITxtTelpPegEdit; WinDateTimePicker uIDtpTglAkhirPegDateTimePicker = this.UIWorldMartJeffreyHermWindow11.UIDtpTglAkhirPegWindow.UIDtpTglAkhirPegDateTimePicker; WinRadioButton uIPegawaiKontrakRadioButton = this.UIWorldMartJeffreyHermWindow12.UIPegawaiKontrakWindow.UIPegawaiKontrakRadioButton; WinRadioButton uIPegawaiTetapRadioButton = this.UIWorldMartJeffreyHermWindow3.UIPegawaiTetapWindow.UIPegawaiTetapRadioButton; WinEdit uITxtTunjanganPegEdit = this.UIWorldMartJeffreyHermWindow4.UITxtTunjanganPegWindow.UITxtTunjanganPegEdit; WinButton uISubmitButton = this.UIWorldMartJeffreyHermWindow8.UISubmitWindow.UISubmitButton; WinButton uIOKButton = this.UIOKWindow.UIOKButton; WinComboBox uIGajiPokokComboBox = this.UIWorldMartLoginWindow8.UICmbSearchPegWindow.UIGajiPokokComboBox; #endregion // Click 'Edit' button Mouse.Click(uIEditButton, new Point(48, 15)); // Click 'Remove' button Mouse.Click(uIRemoveButton, new Point(35, 14)); // Click 'Add' button Mouse.Click(uIAddButton, new Point(14, 12)); // Select 'Manager' in 'cmbJabPeg' combo box uICmbJabPegComboBox.SelectedItem = this.RecordedPegawaiBoss2Params.UICmbJabPegComboBoxSelectedItem; // Type 'Iwan Budiono' in 'txtNamaPeg' text box uITxtNamaPegEdit.Text = this.RecordedPegawaiBoss2Params.UITxtNamaPegEditText; // Type 'Lebak Arum 5/27' in 'txtAlamatPeg' text box uITxtAlamatPegEdit.Text = this.RecordedPegawaiBoss2Params.UITxtAlamatPegEditText; // Type '7352851' in 'txtTelpPeg' text box uITxtTelpPegEdit.Text = this.RecordedPegawaiBoss2Params.UITxtTelpPegEditText; // Select '18/06/2011' in 'dtpTglAkhirPeg' date time picker uIDtpTglAkhirPegDateTimePicker.DateTimeAsString = this.RecordedPegawaiBoss2Params.UIDtpTglAkhirPegDateTimePickerDateTimeAsString; // Select 'Pegawai Kontrak' radio button uIPegawaiKontrakRadioButton.Selected = this.RecordedPegawaiBoss2Params.UIPegawaiKontrakRadioButtonSelected; // Select 'Pegawai Tetap' radio button uIPegawaiTetapRadioButton.Selected =

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 52

this.RecordedPegawaiBoss2Params.UIPegawaiTetapRadioButtonSelected; // Type '200000' in 'txtTunjanganPeg' text box uITxtTunjanganPegEdit.Text = this.RecordedPegawaiBoss2Params.UITxtTunjanganPegEditText; // Click 'Submit' button Mouse.Click(uISubmitButton, new Point(36, 5)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(34, 12)); // Select 'Iwan Budiono' in 'Gaji Pokok' combo box uIGajiPokokComboBox.SelectedItem = this.RecordedPegawaiBoss2Params.UIGajiPokokComboBoxSelectedItem; } /// <summary> /// AssertMethodPegawaiBoss2 - Use 'AssertMethodPegawaiBoss2ExpectedValues' to pass parameters into this method. /// </summary> public void AssertMethodPegawaiBoss2() { #region Variable Declarations WinEdit uITxtIDPegEdit = this.UIWorldMartJeffreyHermWindow13.UITxtIDPegWindow.UITxtIDPegEdit; WinEdit uITxtGajiPokokPegEdit = this.UIWorldMartJeffreyHermWindow14.UITxtGajiPokokPegWindow.UITxtGajiPokokPegEdit; WinWindow uITxtNamaPegWindow = this.UIWorldMartJeffreyHermWindow7.UIPanelManagerPegawaiWindow.UITxtNamaPegWindow; WinEdit uITxtNamaPegEdit = this.UIWorldMartJeffreyHermWindow.UITxtNamaPegWindow.UITxtNamaPegEdit; WinEdit uITxtAlamatPegEdit = this.UIWorldMartJeffreyHermWindow1.UITxtAlamatPegWindow.UITxtAlamatPegEdit; WinEdit uITxtTelpPegEdit = this.UIWorldMartJeffreyHermWindow2.UITxtTelpPegWindow.UITxtTelpPegEdit; WinEdit uITxtTunjanganPegEdit = this.UIWorldMartJeffreyHermWindow4.UITxtTunjanganPegWindow.UITxtTunjanganPegEdit; WinButton uISubmitButton = this.UIWorldMartJeffreyHermWindow8.UISubmitWindow.UISubmitButton; WinButton uIPayButton = this.UIWorldMartJeffreyHermWindow6.UIPayWindow.UIPayButton; #endregion // Verify that 'txtGajiPokokPeg' text box's property 'Text' equals '5000000' Assert.AreEqual(this.AssertMethodPegawaiBoss2ExpectedValues.UITxtGajiPokokPegEditText, uITxtGajiPokokPegEdit.Text); // Verify that 'txtGajiPokokPeg' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiBoss2ExpectedValues.UITxtGajiPokokPegEditEnabled, uITxtGajiPokokPegEdit.Enabled); // Verify that 'txtNamaPeg' window's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiBoss2ExpectedValues.UITxtNamaPegWindowEnabled, uITxtNamaPegWindow.Enabled); // Verify that 'txtNamaPeg' text box's property 'Text' equals 'Iwan Budiono' Assert.AreEqual(this.AssertMethodPegawaiBoss2ExpectedValues.UITxtNamaPegEditText,

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 53

uITxtNamaPegEdit.Text); // Verify that 'txtAlamatPeg' text box's property 'Text' equals 'Lebak Arum 5/27' Assert.AreEqual(this.AssertMethodPegawaiBoss2ExpectedValues.UITxtAlamatPegEditText, uITxtAlamatPegEdit.Text); // Verify that 'txtAlamatPeg' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiBoss2ExpectedValues.UITxtAlamatPegEditEnabled, uITxtAlamatPegEdit.Enabled); // Verify that 'txtTelpPeg' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiBoss2ExpectedValues.UITxtTelpPegEditEnabled, uITxtTelpPegEdit.Enabled); // Verify that 'txtTelpPeg' text box's property 'Text' equals '7352851' Assert.AreEqual(this.AssertMethodPegawaiBoss2ExpectedValues.UITxtTelpPegEditText, uITxtTelpPegEdit.Text); // Verify that 'txtTunjanganPeg' text box's property 'Text' equals '200000' Assert.AreEqual(this.AssertMethodPegawaiBoss2ExpectedValues.UITxtTunjanganPegEditText, uITxtTunjanganPegEdit.Text); // Verify that 'txtTunjanganPeg' text box's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiBoss2ExpectedValues.UITxtTunjanganPegEditEnabled, uITxtTunjanganPegEdit.Enabled); // Verify that 'Submit' button's property 'Enabled' equals 'False' Assert.AreEqual(this.AssertMethodPegawaiBoss2ExpectedValues.UISubmitButtonEnabled, uISubmitButton.Enabled); // Verify that 'Pay' button's property 'Enabled' equals 'True' Assert.AreEqual(this.AssertMethodPegawaiBoss2ExpectedValues.UIPayButtonEnabled, uIPayButton.Enabled); } /// <summary> /// RecordedPegawaiBoss3 - Use 'RecordedPegawaiBoss3Params' to pass parameters into this method. /// </summary> public void RecordedPegawaiBoss3() { #region Variable Declarations WinButton uIEditButton = this.UIWorldMartLoginWindow9.UIEditWindow.UIEditButton; WinEdit uITxtAlamatPegEdit = this.UIWorldMartJeffreyHermWindow1.UITxtAlamatPegWindow.UITxtAlamatPegEdit; WinButton uISubmitButton = this.UIWorldMartJeffreyHermWindow8.UISubmitWindow.UISubmitButton; WinButton uIOKButton = this.UIOKWindow.UIOKButton; WinComboBox uIGajiPokokComboBox = this.UIWorldMartLoginWindow8.UICmbSearchPegWindow.UIGajiPokokComboBox; WinButton uIRemoveButton = this.UIWorldMartLoginWindow10.UIRemoveWindow.UIRemoveButton; WinButton uIYesButton = this.UIRemovePegawaiWindow.UIYesWindow.UIYesButton; WinButton uIDetailsButton = this.UIWorldMartJeffreyHermWindow15.UIWorldMartJeffreyHermClient.UIDetailsButton; WinButton uIContinueButton = this.UIWorldMartJeffreyHermWindow15.UIWorldMartJeffreyHermClient.UIContinueButton;

June 2, 2010 [UI TESTING WORLD MART DENGAN VISUAL STUDIO 2010]

UI Testing World Mart dengan Microsoft Visual Studio 2010 54

WinButton uIBtnLogoutButton = this.UIWorldMartJeffreyHermWindow16.UIBtnLogoutWindow.UIBtnLogoutButton; #endregion // Click 'Edit' button Mouse.Click(uIEditButton, new Point(39, 13)); // Type 'Lebak Arum 5/30' in 'txtAlamatPeg' text box uITxtAlamatPegEdit.Text = this.RecordedPegawaiBoss3Params.UITxtAlamatPegEditText; // Click 'Submit' button Mouse.Click(uISubmitButton, new Point(51, 14)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(31, 9)); // Select 'Iwan Budiono' in 'Gaji Pokok' combo box uIGajiPokokComboBox.SelectedItem = this.RecordedPegawaiBoss3Params.UIGajiPokokComboBoxSelectedItem; // Click 'Remove' button Mouse.Click(uIRemoveButton, new Point(20, 13)); // Click '&Yes' button Mouse.Click(uIYesButton, new Point(59, 14)); // Click 'OK' button Mouse.Click(uIOKButton, new Point(41, 10)); // Select 'Wira Redi' in 'Gaji Pokok' combo box uIGajiPokokComboBox.SelectedItem = this.RecordedPegawaiBoss3Params.UIGajiPokokComboBoxSelectedItem1; // Click 'btnLogout' button Mouse.Click(uIBtnLogoutButton, new Point(87, 41)); }

Test Result :