public void Reportclick2(DataTable dt, LowisMainWindow lw2, LReportPane lp2)
        {
            foreach (DataRow dr in dt.Rows)
            {
                string tcname = dr["TestCaseID"].ToString();
                string linkname = dr["Name"].ToString();
                string reptype = dr["Type"].ToString();
                string tindex = dr["TitleHTMLTableIndex"].ToString();
                string ttext = dr["TitleText"].ToString();
                string colindex = dr["ColumnNameHTMLTableIndex"].ToString();
                string colnametext = dr["ColumnNameText"].ToString();
                string tableType = dr["TableType"].ToString();
                // Verify
                lw2.lowisDwait();
                lp2.ClickHtmlLink(linkname);
                if (linkname == "Auto Welltest Evaluation Report")
                {
                    if (lp2.btnOKAutoReport.Exists)
                    {
                        lp2.btnOKAutoReport.Click();
                    }
                }
                else if (linkname == "Most Recent Coded Test Rpt (Wells)" || linkname == "Most Recent Coded Tests Rpt (Facility)")
                {
                    if (lp2.btnOKCodedReport.Exists)
                    {
                        lp2.btnOKCodedReport.Click();
                    }

                }

                lw2.lowisDwait();
                lp2.VerifyReportPage(tcname, linkname, tableType, reptype, tindex, ttext, colindex, colnametext);
            }
        }
        public void VerifyBeamChartsLink()
        {
            LowisMainWindow Lwindow = new LowisMainWindow();
            LReportPane lpnae = new LReportPane();
            Helper hr = new Helper();
            string srchWell1 = ConfigurationManager.AppSettings["testwell1"];
            try
            {

                string repeat = new string('=', 50);
                hr.LogtoTextFile(repeat + "Test execution Started" + repeat);
                Lwindow.All.DoubleClick();
                Lwindow.AllWels.Click();
                Lwindow.WellTypes.DoubleClick();
                Lwindow.AllBeamWells.Click();
                Lwindow.RefreshWells.Click();
                Lwindow.Start.WaitForControlReady();
                Lwindow.Start.Click();
                Lwindow.clickMenuitem(".Charts", "Beam Chart Viewer");
                //Select a Sepecific Well that can have good data to test these
                Lwindow.SelectWellfromSearch(srchWell1);
                DataTable dt = hr.dtFromExcelFile(System.IO.Directory.GetCurrentDirectory() + "\\BeamChartsLinksName.xls", "Sheet1", "ReportTabPage", "All");
                Chartclick(dt, Lwindow, lpnae);
                dt.Clear();

                dt = hr.dtFromExcelFile(System.IO.Directory.GetCurrentDirectory() + "\\BeamChartsLinksName.xls", "Sheet1", "ReportTabPage", "Welltest");
                lpnae.tabWelltest.Click();
                Chartclick(dt, Lwindow, lpnae);
                dt.Clear();

                dt = hr.dtFromExcelFile(System.IO.Directory.GetCurrentDirectory() + "\\BeamChartsLinksName.xls", "Sheet1", "ReportTabPage", "Analysis Charts");
                lpnae.tabAlarms.Click();
                Chartclick(dt, Lwindow, lpnae);
                dt.Clear();

                dt = hr.dtFromExcelFile(System.IO.Directory.GetCurrentDirectory() + "\\BeamChartsLinksName.xls", "Sheet1", "ReportTabPage", "WSM Charts");
                lpnae.tabParameters.Click();
                Chartclick(dt, Lwindow, lpnae);
                dt.Clear();

                dt = hr.dtFromExcelFile(System.IO.Directory.GetCurrentDirectory() + "\\BeamChartsLinksName.xls", "Sheet1", "ReportTabPage", "Charts By Controller");
                lpnae.tabConfiguration.Click();
                Chartclick(dt, Lwindow, lpnae);

                hr.LogtoTextFile(repeat + "Test execution Ended" + repeat);
            }
            catch (Exception ex)
            {
                hr.LogtoTextFile("Exeption occured : " + ex.Message.ToString());

            }
        }
        public void espwellgrpconfig()
        {
            LowisMainWindow Lwindow = new LowisMainWindow();
            LReportPane lpnae = new LReportPane();
            Helper hr = new Helper();
            string srchWell1 = ConfigurationManager.AppSettings["testwell1"];
            try
            {

                string repeat = new string('=', 50);
                hr.LogtoTextFile(repeat + "Test execution Started" + repeat);
                //Lwindow.All.DoubleClick();
                //Lwindow.AllWels.Click();
                //Lwindow.WellTypes.DoubleClick();
                //Lwindow.AllESPWells.Click();
                //Lwindow.RefreshWells.Click();
                //Lwindow.Start.WaitForControlReady();
                //Lwindow.Start.Click();
                //Lwindow.clickMenuitem(".Configuration", "ESP Well Group Configuration");
                //Select a Sepecific Well that can have good data to test these
              //  Lwindow.SelectWellfromSearch(srchWell1);
             //   DataTable dt = hr.dtFromExcelFile(System.IO.Directory.GetCurrentDirectory() + "\\BeamChartsLinksName.xls", "Sheet1", "ReportTabPage", "All");
                string wellnamesfile = @"C:\test\wellnames.txt";
                UIObect ui = new UIObect();
              //  System.IO.File.Open(wellnamesfile, FileMode.Open);
                StreamReader fs = new StreamReader(wellnamesfile);
                string line = "";
                while ((line = fs.ReadLine()) != null)
                {
                    Lwindow.SelectWellfromSearch(line.Trim());
                    Playback.Wait(2000);
                    ui.AddData(System.IO.Directory.GetCurrentDirectory() + "\\ESP_Config_Params.xls", "TC_AEPOC_step_1_3");
                }

              //  Lwindow.SelectWellfromSearch(srchWell1);

                hr.LogtoTextFile(repeat + "Test execution Ended" + repeat);

            }
            catch (Exception ex)
            {
                hr.LogtoTextFile("Exeption occured : " + ex.Message.ToString());

            }
        }
 public void Reportclick(DataTable dt, LowisMainWindow lw1, LReportPane lp1)
 {
     foreach (DataRow dr in dt.Rows)
     {
         string tcname = dr["TestCaseID"].ToString();
         string linkname = dr["Name"].ToString();
         string reptype = dr["Type"].ToString();
         string tindex = dr["TitleHTMLTableIndex"].ToString();
         string ttext = dr["TitleText"].ToString();
         string colindex = dr["ColumnNameHTMLTableIndex"].ToString();
         string colnametext = dr["ColumnNameText"].ToString();
         string tableType = dr["TableType"].ToString();
         // Verify
         lw1.lowisDwait();
         lp1.ClickHtmlLink(linkname);
         lw1.lowisDwait();
         lp1.VerifyReportPage(tcname, linkname, tableType, reptype, tindex, ttext, colindex, colnametext);
     }
 }
 public void Chartclick(DataTable dt, LowisMainWindow lw1, LReportPane lp1)
 {
     foreach (DataRow dr in dt.Rows)
     {
         string tcname = dr["TestCaseID"].ToString();
         string linkname = dr["Name"].ToString();
         string chartindex= dr["ChartIndex"].ToString();
         string charttitle = dr["ChartTitle"].ToString();
         string chartytitle = dr["ChartYTitle"].ToString();
         string chartxtitle = dr["ChartXTilte"].ToString();
         string charty2title = dr["ChartY2Title"].ToString();
         string chartlegends = dr["ChartLegends"].ToString();
         // Verify
         lw1.lowisDwait();
         lp1.ClickHtmlLink(linkname);
         lw1.lowisDwait();
         lp1.VerifyChartPage(tcname, linkname, chartindex, charttitle, chartytitle, charty2title, chartxtitle, chartlegends);
     }
 }
        public void LaunchLowisServer()
        {
            LowisConnectDialog lconndlg = new LowisConnectDialog();
            LowisSettingsDialog lsettings = new LowisSettingsDialog();
            LowisMainWindow lwin = new LowisMainWindow();
            try
            {
                TestApp = ApplicationUnderTest.Launch(lowisclientbinlocation);
                lconndlg.selectServer(lowisserver);
                if (lowisusername.Length == 0 && lowispassword.Length == 0)
                {
                    //use default readio button Simply connect
                    lconndlg.Settings.Click();
                    lsettings.storepath.Text = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile).ToString(), "csstore", DateTime.Now.ToString("ddMMMyyyyhhmmss"));
                    lsettings.btnSavesettings.Click();
                    lconndlg.Connect.Click();
                    lwin.Analysis.WaitForControlReady();
                    lwin.Analysis.Click();

                }
                else
                {
                    lconndlg.usecredentails.Click();
                    lconndlg.txtuserName.Text = lowisusername;
                    lconndlg.txtuserName.Text = lowispassword;
                    lconndlg.Settings.Click();
                    lsettings.storepath.Text = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile).ToString(), "csstore", DateTime.Now.ToString("ddMMMyyyyhhmmss"));
                    lsettings.btnSavesettings.Click();
                    lconndlg.Connect.Click();
                    lwin.Analysis.WaitForControlReady();
                    lwin.Analysis.Click();

                }
            }
            catch (Exception ex)
            {
                TestContext.WriteLine("Encountered Exception: " + ex.Message);
            }
        }
        public void VerifyBeamReportsLink()
        {
            LowisMainWindow Lwindow = new LowisMainWindow();
            LReportPane lpnae = new LReportPane();
            Helper hr = new Helper();
            string repeat = new string('=', 50);
            hr.LogtoTextFile(repeat + "Test execution Started" + repeat);
            Lwindow.All.DoubleClick();
            Lwindow.AllWels.Click();
            Lwindow.WellTypes.DoubleClick();
            Lwindow.AllBeamWells.Click();
            Lwindow.RefreshWells.Click();
            Lwindow.Start.WaitForControlReady();
            Lwindow.Start.Click();
            Lwindow.clickMenuitem(".Reports");
            Lwindow.clickMenuitem("Beam Reports");
            DataTable dt = hr.dtFromExcelFile(System.IO.Directory.GetCurrentDirectory() + "\\BeamReportsLinksName.xls", "Sheet1", "ReportTabPage", "All");
            this.Reportclick(dt, Lwindow, lpnae);
            dt.Clear();
            dt = hr.dtFromExcelFile(System.IO.Directory.GetCurrentDirectory() + "\\BeamReportsLinksName.xls", "Sheet1", "ReportTabPage", "Status");
            lpnae.tabStatus.Click();
            Reportclick(dt, Lwindow, lpnae);
            dt.Clear();
            dt = hr.dtFromExcelFile(System.IO.Directory.GetCurrentDirectory() + "\\BeamReportsLinksName.xls", "Sheet1", "ReportTabPage", "Analysis");
            lpnae.tabAnalysis.Click();
            Reportclick(dt, Lwindow, lpnae);
            dt.Clear();
            dt = hr.dtFromExcelFile(System.IO.Directory.GetCurrentDirectory() + "\\BeamReportsLinksName.xls", "Sheet1", "ReportTabPage", "Welltest");
            lpnae.tabWelltest.Click();
            Reportclick2(dt, Lwindow, lpnae);
            dt.Clear();
            dt = hr.dtFromExcelFile(System.IO.Directory.GetCurrentDirectory() + "\\BeamReportsLinksName.xls", "Sheet1", "ReportTabPage", "Alarms");
            lpnae.tabAlarms.Click();
            for (int i = 0; i < 3; i++)
            {
                lpnae.btnLess.Click();
            }
            Reportclick2(dt, Lwindow, lpnae);
            dt.Clear();
            dt = hr.dtFromExcelFile(System.IO.Directory.GetCurrentDirectory() + "\\BeamReportsLinksName.xls", "Sheet1", "ReportTabPage", "Parameters");
            lpnae.tabParameters.Click();
            Reportclick(dt, Lwindow, lpnae);
            dt.Clear();
            dt = hr.dtFromExcelFile(System.IO.Directory.GetCurrentDirectory() + "\\BeamReportsLinksName.xls", "Sheet1", "ReportTabPage", "Configuration");
            lpnae.tabConfiguration.Click();
            Reportclick(dt, Lwindow, lpnae);

            hr.LogtoTextFile(repeat + "Test execution Ended" + repeat);
        }
 public void VerifySeparataorLink()
 {
     LowisMainWindow Lwindow = new LowisMainWindow();
     LReportPane lpnae = new LReportPane();
     Helper hr = new Helper();
     string repeat = new string('=', 25);
     hr.LogtoTextFile(repeat + "Test execution Started" + repeat);
     Lwindow.All.DoubleClick();
     Lwindow.AllWels.Click();
     Lwindow.WellTypes.DoubleClick();
     Lwindow.AllBeamWells.Click();
     Lwindow.RefreshWells.Click();
     Lwindow.Start.WaitForControlReady();
     Lwindow.Start.Click();
     Lwindow.clickMenuitem(".Status", "Group Separator Status");
     Lwindow.ClickYestoAutoUpdates();
     Lwindow.wintaballseparatorreport.Click();
     hr.LogtoTextFile("Execution Path  is " + System.IO.Directory.GetCurrentDirectory() + "\\SeparatorReportsLinksName.xls");
     DataTable dt = hr.dtFromExcelFile(System.IO.Directory.GetCurrentDirectory() + "\\SeparatorReportsLinksName.xls", "Sheet1", "ReportTabPage", "All");
     this.Reportclick(dt, Lwindow, lpnae);
     dt.Clear();
     hr.LogtoTextFile(repeat + "Test execution Ended" + repeat);
 }