public static void Execute() { //Playback settings Playback.PlaybackSettings.WaitForReadyTimeout = Configurations.SyncTime; Playback.PlaybackSettings.SearchTimeout = Configurations.SyncTime; Playback.PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.UIThreadOnly; BrowserWindow.CurrentBrowser = Configurations.BrowserName; BrowserWindow TC_002_bw = BrowserWindow.Launch(new Uri(Configurations.MainUrl)); TC_002_bw.Maximized = true; LoginScreen lsobj = new LoginScreen(TC_002_bw); HomePage hpobj = new HomePage(TC_002_bw); PropertyDetails pdobj = new PropertyDetails(TC_002_bw); try { lsobj.UserName.WaitForControlExist(Configurations.SyncTime); Login.LoginToApplication(TC_002_bw, LoginCredentials.UserName, LoginCredentials.Password); /*lsobj.UserName.Text = LoginCredentials.UserName; * Console.WriteLine("Entered username as " + LoginCredentials.UserName); * lsobj.Password.Text = LoginCredentials.Password; * Console.WriteLine("Entered password"); * Mouse.Click(lsobj.LoginButton); * * Console.WriteLine("Clicked on Login button"); */ } catch (Exception) { throw; } try { hpobj.PropertySearchLink.WaitForControlExist(Configurations.SyncTime); Console.WriteLine("Property Search Link is displayed"); } catch (Exception) { throw; } try { hpobj.SearchbyAddress.WaitForControlExist(Configurations.SyncTime); Mouse.Click(hpobj.City); Playback.Wait(500); Keyboard.SendKeys("{TAB}"); Playback.Wait(500); Keyboard.SendKeys(TestData.M20_Auto_003_005_CityValue); Console.WriteLine("Entered City as " + TestData.M20_Auto_003_005_CityValue); Mouse.Click(hpobj.State); Playback.Wait(500); Keyboard.SendKeys("{TAB}"); Playback.Wait(500); Keyboard.SendKeys(TestData.M20_Auto_003_005_StateValue); Console.WriteLine("Entered State as " + TestData.M20_Auto_003_005_StateValue); Mouse.Click(hpobj.Zip); Playback.Wait(500); Keyboard.SendKeys("{TAB}"); Playback.Wait(500); Keyboard.SendKeys(TestData.M20_Auto_003_005_ZipValue); Console.WriteLine("Entered Zipcode as " + TestData.M20_Auto_003_005_ZipValue); Mouse.Click(hpobj.County); Playback.Wait(500); Keyboard.SendKeys("{TAB}"); Playback.Wait(500); Keyboard.SendKeys(TestData.M20_Auto_003_005_CountyValue); Console.WriteLine("Entered County as " + TestData.M20_Auto_003_005_CountyValue); Mouse.Click(hpobj.PropertyId); Playback.Wait(500); Keyboard.SendKeys("{TAB}"); Playback.Wait(500); var value1 = "33955"; Keyboard.SendKeys(value1); Console.WriteLine("Entered Property ID as " + value1); Mouse.Click(hpobj.SearchButton); Console.WriteLine("Clicked on Search Button"); /* for(int i=0; i<Configurations.SyncTime; i++) * { * try * { * var documentStatus = TC_002_bw.ExecuteScript("var myState = document.readyState; return myState;"); * if (documentStatus.ToString() == "complete") * { * break; * } * else { Playback.Wait(1000); } * } * catch (Exception) * { * * throw; * } * } */ Playback.PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.AllThreads; try { hpobj.PaginationText.WaitForControlExist(Configurations.SyncTime); int RecordCount = Int32.Parse(hpobj.PaginationText.InnerText.Trim().Split('-')[0]); if (RecordCount == 1) { Console.WriteLine("Record is displayed"); } if (RecordCount == 0) { Assert.Fail("Search did not display any records"); } Mouse.Click(hpobj.AddressHyperLink); pdobj.PropertyDetailsText.WaitForControlExist(Configurations.SyncTime); if (pdobj.PropertyDetailsText.Exists) { Console.WriteLine("Property Details Page is displayed"); } else { Assert.Fail("Property Details page is not displayed"); } } catch (Exception) { throw; } } catch (Exception) { throw; } }
public static void Execute() { Playback.PlaybackSettings.WaitForReadyTimeout = Configurations.SyncTime; Playback.PlaybackSettings.SearchTimeout = Configurations.SyncTime; BrowserWindow.CurrentBrowser = Configurations.BrowserName; BrowserWindow TC_002_bw = BrowserWindow.Launch(new Uri(Configurations.MainUrl)); TC_002_bw.Maximized = true; LoginScreen lsobj = new LoginScreen(TC_002_bw); HomePage hpobj = new HomePage(TC_002_bw); try { lsobj.UserName.WaitForControlExist(Configurations.SyncTime); /*lsobj.UserName.Text = LoginCredentials.UserName; * Console.WriteLine("Entered username as " + LoginCredentials.UserName); * lsobj.Password.Text = LoginCredentials.Password; * Console.WriteLine("Entered password"); * Mouse.Click(lsobj.LoginButton); * Console.WriteLine("Clicked on Login button"); */ Login.LoginToApplication(TC_002_bw, LoginCredentials.UserName, LoginCredentials.Password); } catch (Exception) { throw; } try { hpobj.DetaieldSearchLink.WaitForControlExist(Configurations.SyncTime); Console.WriteLine("Detailed Search Link is displayed"); Mouse.Click(hpobj.DetaieldSearchLink); Console.WriteLine("Clicked on Detailed Search Link to expand"); } catch (Exception) { throw; } try { hpobj.PropertyType.WaitForControlExist(Configurations.SyncTime); Mouse.Click(hpobj.PropertyType); Playback.Wait(500); Keyboard.SendKeys("{TAB}"); Playback.Wait(500); Keyboard.SendKeys(TestData.M20_Auto_004_005_PropertyTypeValue); Console.WriteLine("Entered Property Type as " + TestData.M20_Auto_004_005_PropertyTypeValue); Mouse.Click(hpobj.PropertyPhase); Playback.Wait(500); Keyboard.SendKeys("{TAB}"); Playback.Wait(500); Keyboard.SendKeys(TestData.M20_Auto_004_005_PropertyPhaseValue); Console.WriteLine("Entered Property Phase as " + TestData.M20_Auto_004_005_PropertyPhaseValue); Mouse.Click(hpobj.PropertyStatus); Playback.Wait(500); Keyboard.SendKeys("{TAB}"); Playback.Wait(500); Keyboard.SendKeys(TestData.M20_Auto_004_005_PropertyStatusValue); Console.WriteLine("Entered Property Status as " + TestData.M20_Auto_004_005_PropertyStatusValue); Mouse.Click(hpobj.AssetType); Playback.Wait(500); Keyboard.SendKeys("{TAB}"); Playback.Wait(500); Keyboard.SendKeys(TestData.M20_Auto_004_005_AssetTypeValue); Console.WriteLine("Entered Asset Type as " + TestData.M20_Auto_004_005_AssetTypeValue); Mouse.Click(hpobj.SearchButton); Playback.Wait(5000); Console.WriteLine("Clicked on Search Button"); Playback.PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.AllThreads; Mouse.Click(hpobj.PropertyPhase); Playback.Wait(500); Keyboard.SendKeys("^{END}"); int RecordCount = Int32.Parse(hpobj.PaginationText.InnerText.Trim().Split('-')[0].Trim()); if (RecordCount == 0) { Assert.Fail("Clicking on Search button did not display any records"); } if (RecordCount == 1) { Console.WriteLine("Clicking on Search button has displayed records"); } String value1 = hpobj.PaginationText.InnerText.Trim(); String value2 = value1.Split(new string[] { "of" }, StringSplitOptions.None)[0].Trim(); int itemsperpage = Int32.Parse(value2.Split('-')[1].Trim()); String value3 = value1.Split(new string[] { "of" }, StringSplitOptions.None)[1].Trim(); value3 = value3.Split(new string[] { "items" }, StringSplitOptions.None)[0].Trim(); int totalcount = Int32.Parse(value3); int totalpages; if (totalcount % itemsperpage == 0) { totalpages = totalcount / itemsperpage; } else { totalpages = (totalcount / itemsperpage) + 1; } Mouse.Click(hpobj.LastPageArrow); Console.WriteLine("Clicked on last page image"); if (hpobj.PageSelected.InnerText.Trim() == totalpages.ToString()) { Console.WriteLine("Page no." + totalpages.ToString() + " was selected as expected"); } else { Console.WriteLine("Expected Page to be displayed: " + totalpages.ToString()); Console.WriteLine("Actual Page displayed: " + hpobj.PageSelected.InnerText.Trim()); Assert.Fail("Pagination is not working properly"); } } catch (Exception) { throw; } }
public static void Execute() { Playback.PlaybackSettings.WaitForReadyTimeout = Configurations.SyncTime; Playback.PlaybackSettings.SearchTimeout = Configurations.SyncTime; BrowserWindow.CurrentBrowser = Configurations.BrowserName; BrowserWindow TC_002_bw = BrowserWindow.Launch(new Uri(Configurations.MainUrl)); TC_002_bw.Maximized = true; LoginScreen lsobj = new LoginScreen(TC_002_bw); HomePage hpobj = new HomePage(TC_002_bw); try { lsobj.UserName.WaitForControlExist(Configurations.SyncTime); /*lsobj.UserName.Text = LoginCredentials.UserName; * Console.WriteLine("Entered username as " + LoginCredentials.UserName); * lsobj.Password.Text = LoginCredentials.Password; * Console.WriteLine("Entered password"); * Mouse.Click(lsobj.LoginButton); * Console.WriteLine("Clicked on Login button"); */ Login.LoginToApplication(TC_002_bw, LoginCredentials.UserName, LoginCredentials.Password); } catch (Exception) { throw; } try { hpobj.DetaieldSearchLink.WaitForControlExist(Configurations.SyncTime); Console.WriteLine("Detailed Search Link is displayed"); Mouse.Click(hpobj.DetaieldSearchLink); Console.WriteLine("Clicked on Detailed Search Link to expand"); } catch (Exception) { throw; } try { hpobj.PropertyType.WaitForControlExist(Configurations.SyncTime); Mouse.Click(hpobj.PropertyType); Playback.Wait(500); Keyboard.SendKeys("{TAB}"); Playback.Wait(500); Keyboard.SendKeys(TestData.M20_Auto_004_005_PropertyTypeValue); Console.WriteLine("Entered Property Type as " + TestData.M20_Auto_004_005_PropertyTypeValue); Mouse.Click(hpobj.PropertyPhase); Playback.Wait(500); Keyboard.SendKeys("{TAB}"); Playback.Wait(500); Keyboard.SendKeys(TestData.M20_Auto_004_005_PropertyPhaseValue); Console.WriteLine("Entered Property Phase as " + TestData.M20_Auto_004_005_PropertyPhaseValue); Mouse.Click(hpobj.PropertyStatus); Playback.Wait(500); Keyboard.SendKeys("{TAB}"); Playback.Wait(500); Keyboard.SendKeys(TestData.M20_Auto_004_005_PropertyStatusValue); Console.WriteLine("Entered Property Status as " + TestData.M20_Auto_004_005_PropertyStatusValue); Mouse.Click(hpobj.AssetType); Playback.Wait(500); Keyboard.SendKeys("{TAB}"); Playback.Wait(500); Keyboard.SendKeys(TestData.M20_Auto_004_005_AssetTypeValue); Console.WriteLine("Entered Asset Type as " + TestData.M20_Auto_004_005_AssetTypeValue); Mouse.Click(hpobj.SearchButton); Playback.Wait(5000); Console.WriteLine("Clicked on Search Button"); Playback.PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.AllThreads; Mouse.Click(hpobj.PropertyPhase); Playback.Wait(500); Keyboard.SendKeys("^{END}"); int RecordCount = Int32.Parse(hpobj.PaginationText.InnerText.Trim().Split('-')[0].Trim()); if (RecordCount == 0) { Assert.Fail("Clicking on Search button did not display any records"); } if (RecordCount == 1) { Console.WriteLine("Clicking on Search button has displayed records"); } Mouse.Click(hpobj.ExportToExcel); Console.WriteLine("Clicked on Export to Excel option"); Playback.Wait(10000); String filename = "PropertySearch.xlsx"; FileInfo f = new FileInfo(filename); String fullname = f.FullName; if (Directory.Exists(Path.GetDirectoryName(fullname))) { Console.WriteLine("Results are exported to excel file"); } else { Assert.Fail("Results are not exported to excel file"); } } catch (Exception) { throw; } }
public static void Execute() { //Playback settings Playback.PlaybackSettings.WaitForReadyTimeout = Configurations.SyncTime; Playback.PlaybackSettings.SearchTimeout = Configurations.SyncTime; Playback.PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.UIThreadOnly; BrowserWindow.CurrentBrowser = Configurations.BrowserName; BrowserWindow TC_002_bw = BrowserWindow.Launch(new Uri(Configurations.MainUrl)); TC_002_bw.Maximized = true; LoginScreen lsobj = new LoginScreen(TC_002_bw); HomePage hpobj = new HomePage(TC_002_bw); RelocationScreen rlsobj = new RelocationScreen(TC_002_bw); try { lsobj.UserName.WaitForControlExist(Configurations.SyncTime); /*lsobj.UserName.Text = LoginCredentials.UserName; * Console.WriteLine("Entered username as " + LoginCredentials.UserName); * lsobj.Password.Text = LoginCredentials.Password; * Console.WriteLine("Entered password"); * Mouse.Click(lsobj.LoginButton); * Console.WriteLine("Clicked on Login button"); */ Login.LoginToApplication(TC_002_bw, LoginCredentials.UserName, LoginCredentials.Password); } catch (Exception) { throw; } try { hpobj.DetaieldSearchLink.WaitForControlExist(Configurations.SyncTime); Console.WriteLine("Detailed Search Link is displayed"); Mouse.Click(hpobj.DetaieldSearchLink); Console.WriteLine("Clicked on Detailed Search Link to expand"); } catch (Exception) { throw; } try { hpobj.PropertyType.WaitForControlExist(Configurations.SyncTime); TestData.M20_Auto_004_005_PropertyPhaseValue = "Relocation"; Mouse.Click(hpobj.PropertyPhase); Playback.Wait(500); Keyboard.SendKeys("{TAB}"); Playback.Wait(500); Keyboard.SendKeys(TestData.M20_Auto_004_005_PropertyPhaseValue); Console.WriteLine("Entered Property Phase as " + TestData.M20_Auto_004_005_PropertyPhaseValue); Mouse.Click(hpobj.SearchButton); Playback.Wait(5000); Console.WriteLine("Clicked on Search Button"); Mouse.Click(hpobj.PropertyPhase); Playback.Wait(500); Keyboard.SendKeys("^{END}"); int RecordCount = Int32.Parse(hpobj.PaginationText.InnerText.Trim().Split('-')[0].Trim()); if (RecordCount == 0) { Assert.Fail("Clicking on Search button did not display any records"); } if (RecordCount == 1) { Console.WriteLine("Clicking on Search button has displayed records"); } } catch (Exception) { throw; } //hpobj.RelocationPhaseCellLink.WaitForControlExist(Configurations.SyncTime); try { var pid = hpobj.PIDTableCell.InnerText.Trim(); Mouse.Click(hpobj.RelocationPhaseCellLink); Console.WriteLine("Clicked on FIrst Relocation link"); Keyboard.SendKeys("^{END}"); rlsobj.RelocationHeader.WaitForControlExist(Configurations.SyncTime); Console.WriteLine("Relocation Page is displayed"); if (rlsobj.RelocationReportLink.Exists) { Console.WriteLine("Relocation Report link is displayed"); } else { Assert.Fail("Relocation Report link is displayed"); } Mouse.Click(rlsobj.RelocationReportLink); Console.WriteLine("Clicked on Relocation Report Link"); //rlrobj.RelocationReportText.WaitForControlExist(Configurations.SyncTime); //Playback.Wait(90000); BrowserWindow bw1 = new BrowserWindow(); RelocationReport rlrobj = new RelocationReport(bw1); Playback.PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.AllThreads; HtmlDiv RelocationReportText = new HtmlDiv(bw1); RelocationReportText.SearchProperties[HtmlDiv.PropertyNames.InnerText] = "Relocation Report"; Playback.Wait(60000); RelocationReportText.WaitForControlReady(Configurations.SyncTime); Mouse.Click(RelocationReportText); /*if (RelocationReportText.Exists) * { * Console.WriteLine("Relocation Report is displayed"); * } * else * { * Assert.Fail("Relocation Report is not displayed"); * }*/ } catch (Exception) { throw; } }
public static void Execute() { //Playback settings Playback.PlaybackSettings.WaitForReadyTimeout = Configurations.SyncTime; Playback.PlaybackSettings.SearchTimeout = Configurations.SyncTime; BrowserWindow.CurrentBrowser = Configurations.BrowserName; BrowserWindow TC_002_bw = BrowserWindow.Launch(new Uri(Configurations.MainUrl)); TC_002_bw.Maximized = true; LoginScreen lsobj = new LoginScreen(TC_002_bw); HomePage hpobj = new HomePage(TC_002_bw); RehabScreen rbsobj = new RehabScreen(TC_002_bw); try { lsobj.UserName.WaitForControlExist(Configurations.SyncTime); /* lsobj.UserName.Text = LoginCredentials.UserName; * Console.WriteLine("Entered username as " + LoginCredentials.UserName); * lsobj.Password.Text = LoginCredentials.Password; * Console.WriteLine("Entered password"); * Mouse.Click(lsobj.LoginButton); * Console.WriteLine("Clicked on Login button"); */ Login.LoginToApplication(TC_002_bw, LoginCredentials.UserName, LoginCredentials.Password); } catch (Exception) { throw; } try { hpobj.DetaieldSearchLink.WaitForControlExist(Configurations.SyncTime); Console.WriteLine("Detailed Search Link is displayed"); Mouse.Click(hpobj.DetaieldSearchLink); Console.WriteLine("Clicked on Detailed Search Link to expand"); } catch (Exception) { throw; } try { hpobj.PropertyType.WaitForControlExist(Configurations.SyncTime); TestData.M20_Auto_004_005_PropertyPhaseValue = "Rehab"; Mouse.Click(hpobj.PropertyPhase); Playback.Wait(500); Keyboard.SendKeys("{TAB}"); Playback.Wait(500); Keyboard.SendKeys(TestData.M20_Auto_004_005_PropertyPhaseValue); Console.WriteLine("Entered Property Phase as " + TestData.M20_Auto_004_005_PropertyPhaseValue); Mouse.Click(hpobj.SearchButton); Playback.Wait(5000); Console.WriteLine("Clicked on Search Button"); Playback.PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.AllThreads; Mouse.Click(hpobj.PropertyPhase); Playback.Wait(500); Keyboard.SendKeys("^{END}"); int RecordCount = Int32.Parse(hpobj.PaginationText.InnerText.Trim().Split('-')[0].Trim()); if (RecordCount == 0) { Assert.Fail("Clicking on Search button did not display any records"); } if (RecordCount == 1) { Console.WriteLine("Clicking on Search button has displayed records"); } } catch (Exception) { throw; } hpobj.RehabPhaseCellLink.WaitForControlExist(Configurations.SyncTime); try { Mouse.Click(hpobj.RehabPhaseCellLink); Console.WriteLine("Clicked on First Rehab link"); Playback.PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.AllThreads; rbsobj.MajorSystemsHeading.WaitForControlExist(Configurations.SyncTime); if (rbsobj.MajorSystemsHeading.Exists) { Console.WriteLine("Major Systems Heading under budget is displayed. So Budget Tab is selected by default"); } else { Assert.Fail("Budget Tab is not selected by default"); } rbsobj.HeaderSection.WaitForControlExist(Configurations.SyncTime); if (rbsobj.HeaderSection.InnerText.Contains("Status: Active")) { Console.WriteLine("Status: Active"); } else { Assert.Fail("Status is not displayed as Active"); } if (rbsobj.HeaderSection.InnerText.Contains("Phase: Rehab")) { Console.WriteLine("Property Phase is Rehab"); } else { Assert.Fail("Property Phase is not displayed as Rehab"); } if (rbsobj.HeaderSection.InnerText.Contains("Phase: Rehab")) { Console.WriteLine("Property ID is : 34100"); } else { Assert.Fail("Property ID is not 34100"); } } catch (Exception) { throw; } }