Example #1
0
        public static void Execute()
        {
            Playback.PlaybackSettings.WaitForReadyTimeout = Configurations.SyncTime;
            Playback.PlaybackSettings.SearchTimeout       = Configurations.SyncTime;

            BrowserWindow.CurrentBrowser = Configurations.BrowserName;
            BrowserWindow TC_001_bw = BrowserWindow.Launch(new Uri(Configurations.MainUrl));

            TC_001_bw.Maximized = true;

            LoginScreen lsobj = new LoginScreen(TC_001_bw);

            try
            {
                lsobj.UserName.WaitForControlExist(Configurations.SyncTime);

                /*lsobj.UserName.Text = LoginCredentials.InvalidUserName;
                 * Console.WriteLine("Entered username as " + LoginCredentials.InvalidUserName);
                 * lsobj.Password.Text = LoginCredentials.Password;
                 * Console.WriteLine("Entered password");
                 * Mouse.Click(lsobj.LoginButton);
                 * Console.WriteLine("Clicked on Login button");
                 */
                Login.LoginToApplication(TC_001_bw, "Wedgewood\\rvallepu1", "Tesla12!");
            }
            catch (Exception)
            {
                throw;
            }

            try
            {
                lsobj.InvalidLoginErrorTextMsg.WaitForControlExist(Configurations.SyncTime);
                String ExpMsg = "Incorrect user ID or password. Type the correct user ID and password, and try again.";
                String ActMsg = lsobj.InvalidLoginErrorTextMsg.InnerText.Trim();
                if (ExpMsg == ActMsg)
                {
                    Console.WriteLine("Values matched");
                    Console.WriteLine("Expected Value: " + ExpMsg);
                    Console.WriteLine("Actual value: " + ActMsg);
                }
                else
                {
                    Console.WriteLine("Expected Value: " + ExpMsg);
                    Console.WriteLine("Actual value: " + ActMsg);
                    Assert.Fail("Values did not match");
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #2
0
        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);
            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");

                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.RelocationPhaseCellLink.WaitForControlExist(Configurations.SyncTime);
            try
            {
                var pid = hpobj.PIDTableCell.InnerText.Trim();
                Mouse.Click(hpobj.RelocationPhaseCellLink);
                Console.WriteLine("Clicked on FIrst Relocation link");
                Keyboard.SendKeys("^{HOME}");
                rlsobj.RelocationHeader.WaitForControlExist(Configurations.SyncTime);
                Console.WriteLine("Relocation Page is displayed");
                if (rlsobj.GeneralInfoHeader.Exists)
                {
                    Console.WriteLine("Relocation Tab is selected by default");
                }
                else
                {
                    Assert.Fail("Relocation Tab is not selected by default");
                }

                //Console.WriteLine(rlsobj.RelocationTab.InnerText);
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #3
0
        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);

            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.PropertySearchLink.WaitForControlExist(Configurations.SyncTime);
                Console.WriteLine("Property Search Link is displayed");
            }
            catch (Exception)
            {
                throw;
            }



            try
            {
                hpobj.SearchbyAddress.WaitForControlExist(Configurations.SyncTime);
                Console.WriteLine("Search By Address field is displyed. 'Property Search' search criteria is expanded.");
                Mouse.Click(hpobj.PropertySearchLink);
                Console.WriteLine("Clicked on Property Search Link");
                if (hpobj.SearchbyAddress.Width == 0 && hpobj.SearchbyAddress.Height == 0)
                {
                    Console.WriteLine("Search By Address field is not displayed. 'Property Search' search criteria is collapsed.");
                }
                else
                {
                    Assert.Fail("Search By Address field is not displayed. 'Property Search' search criteria is not collapsed.");
                }


                Mouse.Click(hpobj.PropertySearchLink);
                if (hpobj.PropertyType.Height == 0 && hpobj.PropertyType.Width == 0)
                {
                    Console.WriteLine("Property Type label is not displayed. 'Detailed Search' search criteria is collapsed");
                }
                else
                {
                    Assert.Fail("Property Type label is displayed. 'Detailed Search' search criteria is not collapsed");
                }

                Mouse.Click(hpobj.DetaieldSearchLink);
                Console.WriteLine("Clicked on Detailed Search Link");
                hpobj.PropertyType.WaitForControlExist(Configurations.SyncTime);
                Console.WriteLine("Property Type Label is displayed. 'Detailed Search' search criteria is expanded");
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #4
0
        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);

            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.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 = "33956";
                Keyboard.SendKeys(value1);
                Console.WriteLine("Entered Property ID as " + value1);

                Mouse.Click(hpobj.SearchButton);
                Console.WriteLine("Clicked on Search Button");

                try
                {
                    hpobj.PaginationText.WaitForControlExist(Configurations.SyncTime);
                    int RecordCount = Int32.Parse(hpobj.PaginationText.InnerText.Trim().Split('-')[0]);
                    if (RecordCount == 1)
                    {
                        Assert.Fail("Record is displayed");
                    }
                    if (RecordCount == 0)
                    {
                        Console.WriteLine("Search did not display any records");
                    }
                }
                catch (Exception)
                {
                    throw;
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #5
0
        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.PropertySearchLink.WaitForControlExist(Configurations.SyncTime);
                Console.WriteLine("Property Search Link is displayed");
            }
            catch (Exception)
            {
                throw;
            }

            try
            {
                string ExpMsg = "RAVI VALLEPU";
                string ActMsg = hpobj.Loggedinusername.InnerText.Trim();
                if (ExpMsg == ActMsg)
                {
                    Console.WriteLine("Values matched");
                    Console.WriteLine("Expected Message: " + ExpMsg);
                    Console.WriteLine("Actual Message: " + ActMsg);
                }
                else
                {
                    Console.WriteLine("Expected Message: " + ExpMsg);
                    Console.WriteLine("Actual Message: " + ActMsg);
                    Assert.Fail("Values did not match");
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #6
0
        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;
            }
        }
Example #7
0
        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;
            }
        }
Example #8
0
        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;
            }
        }
Example #9
0
        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;
            }
        }