public void FormLoginKH_TenDangNhapRong() { Playback.PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.Disabled; Playback.PlaybackSettings.DelayBetweenActions = 500; Playback.PlaybackSettings.SearchTimeout = 10000; try { BrowserWindow browser = BrowserWindow.Launch("http://localhost:12742/"); browser.Maximized = true; browser.DrawHighlight(); UITestControl btnLogin = new UITestControl(browser); btnLogin.TechnologyName = "MSAA"; btnLogin.SearchProperties.Add("Name", "Đăng nhập"); btnLogin.SearchProperties.Add("ControlType", "Edit"); btnLogin.DrawHighlight(); Mouse.Click(btnLogin); UITestControl btnDangNhap = new UITestControl(browser); btnDangNhap.TechnologyName = "MSAA"; btnDangNhap.SearchProperties.Add("Name", "Đăng nhập"); btnDangNhap.SearchProperties.Add("ControlType", "Button"); btnDangNhap.DrawHighlight(); Mouse.Click(btnDangNhap); Playback.Wait(1000); } catch (Exception e) { Assert.Fail(e.ToString()); } }
public void FormSignInKH_TenDangNhapRong() { //this.UIMap.RecordedFormSignIn1(); //this.UIMap.AssertMethod_TenDangNhapRong(); Playback.PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.Disabled; Playback.PlaybackSettings.DelayBetweenActions = 500; Playback.PlaybackSettings.SearchTimeout = 10000; try { BrowserWindow browser = BrowserWindow.Launch("http://localhost:12742/"); browser.Maximized = true; browser.DrawHighlight(); UITestControl btnSign = new UITestControl(browser); btnSign.TechnologyName = "MSAA"; btnSign.SearchProperties.Add("Name", "Đăng ký"); btnSign.SearchProperties.Add("ControlType", "Edit"); btnSign.DrawHighlight(); Mouse.Click(btnSign); UITestControl txtTen = new UITestControl(browser); txtTen.TechnologyName = "Web"; txtTen.SearchProperties.Add("Name", "HoTen"); Keyboard.SendKeys(txtTen, "Nguyễn Văn A"); //txtTen.SearchProperties.Add("ControlType", "Edit"); //txtTen.DrawHighlight(); //Keyboard.SendKeys(txtTen, "UyenSoCute"); //UITestControl txtPass = new UITestControl(browser); //txtPass.TechnologyName = "MSAA"; //txtPass.SearchProperties.Add("Name", "Mật khẩu ..."); //txtPass.SearchProperties.Add("ControlType", "Edit"); //txtPass.DrawHighlight(); //Keyboard.SendKeys(txtPass, "1"); UITestControl btnDangKy = new UITestControl(browser); btnDangKy.TechnologyName = "MSAA"; btnDangKy.SearchProperties.Add("ControlType", "Button"); btnDangKy.SearchProperties.Add("Name", "ĐĂNG KÝ"); btnDangKy.DrawHighlight(); Mouse.Click(btnDangKy); //Playback.Wait(1000); UITestControl kq = new UITestControl(browser); kq.TechnologyName = "Web"; kq.SearchProperties.Add("ControlType", "Cell"); Assert.AreEqual(kq, "Tên đăng nhập không được để trống."); } catch (Exception e) { Assert.Fail(e.ToString()); } }
public void FormLoginKH_HopLe() { //this.UIMap.TenDangNhapRong(); Playback.PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.Disabled; Playback.PlaybackSettings.DelayBetweenActions = 500; Playback.PlaybackSettings.SearchTimeout = 10000; try { BrowserWindow browser = BrowserWindow.Launch("http://localhost:12742/"); browser.Maximized = true; browser.DrawHighlight(); //Playback.Wait(5000); UITestControl btnLogin = new UITestControl(browser); btnLogin.TechnologyName = "MSAA"; btnLogin.SearchProperties.Add("Name", "Đăng nhập"); btnLogin.SearchProperties.Add("ControlType", "Edit"); btnLogin.DrawHighlight(); Mouse.Click(btnLogin); //Playback.Wait(500); UITestControl txtTen = new UITestControl(browser); txtTen.TechnologyName = "MSAA"; txtTen.SearchProperties.Add("Name", "Nhập tài khoản ..."); txtTen.SearchProperties.Add("ControlType", "Edit"); txtTen.DrawHighlight(); Keyboard.SendKeys(txtTen, "UyenSoCute"); UITestControl txtPass = new UITestControl(browser); txtPass.TechnologyName = "MSAA"; txtPass.SearchProperties.Add("Name", "Mật khẩu ..."); txtPass.SearchProperties.Add("ControlType", "Edit"); txtPass.DrawHighlight(); Keyboard.SendKeys(txtPass, "1"); UITestControl btnDangNhap = new UITestControl(browser); btnDangNhap.TechnologyName = "MSAA"; btnDangNhap.SearchProperties.Add("Name", "Đăng nhập"); btnDangNhap.SearchProperties.Add("ControlType", "Button"); btnDangNhap.DrawHighlight(); Mouse.Click(btnDangNhap); Playback.Wait(1000); } catch (Exception e) { Assert.Fail(e.ToString()); } }
public void FormLoginAdmin_MatKhauRong() { Playback.PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.Disabled; Playback.PlaybackSettings.DelayBetweenActions = 500; Playback.PlaybackSettings.SearchTimeout = 10000; try { BrowserWindow browser = BrowserWindow.Launch("http://localhost:12742/Admin/DangNhap"); browser.Maximized = true; browser.DrawHighlight(); //UITestControl txtTen = new UITestControl(browser); //txtTen.TechnologyName = "MSAA"; //txtTen.SearchProperties.Add("Name", "Email"); //txtTen.SearchProperties.Add("ControlType", "Edit"); //txtTen.DrawHighlight(); //Keyboard.SendKeys(txtTen, "admin"); UITestControl txtPass = new UITestControl(browser); txtPass.TechnologyName = "MSAA"; txtPass.SearchProperties.Add("Name", "Password"); txtPass.SearchProperties.Add("ControlType", "Edit"); txtPass.DrawHighlight(); Keyboard.SendKeys(txtPass, "admin"); UITestControl btnDangNhap = new UITestControl(browser); btnDangNhap.TechnologyName = "MSAA"; btnDangNhap.SearchProperties.Add("Name", "LOGIN"); btnDangNhap.SearchProperties.Add("ControlType", "Button"); btnDangNhap.DrawHighlight(); Mouse.Click(btnDangNhap); Playback.Wait(1000); } catch (Exception e) { Assert.Fail(e.ToString()); } }