Exemplo n.º 1
0
        public void CheckForEditableRow(string ColumnName)
        {
            int i;
            IList <IWebElement> rows = HtmlTable_DCN.FindElements(By.TagName("tr"));
            int    RowCnt            = rows.Count;
            int    ColNo             = GetTable_ColNo(ColumnName);
            string ColDataxpath      = "(//table)[2]/tbody/tr/td" + "[" + ColNo + "]";

            for (i = 1; i <= RowCnt; i++)
            {
                CellXpath = "(" + ColDataxpath + ")" + "[" + i + "]";
                IWebElement ColumnInput = BrowserFactory.Driver.FindElement(By.XPath(CellXpath));
                ColumnInput.WebClick();

                try
                {
                    IWebElement Row_Disabled = BrowserFactory.Driver.FindElement(By.XPath(CellXpath + "//input[@disabled]"));
                    Disabled_Cell = Row_Disabled.Displayed;
                }
                catch {
                    Exception e;
                    Disabled_Cell = false;
                    break;
                }
            }

            //Get The SerialNo of the row which is editable

            int    SNO_Colno        = GetTable_ColNo("Serial Number");
            string Sno_ColDataxpath = "((//table)[2]/tbody/tr/td" + "[" + SNO_Colno + "])" + "[" + i + "]";

            Serial_Number = BrowserFactory.Driver.FindElement(By.XPath(Sno_ColDataxpath)).GetText();
        }
Exemplo n.º 2
0
        public void verifyError_count(string username, string OrganizationId)
        {
            int    registeredAsset_Count = 0;
            int    registeredAssetCount  = RegisteredAssetcount(username, OrganizationId);
            string countmsg          = EleErrorCount.GetText();
            IList <IWebElement> rows = HtmlTable_DCN.FindElements(By.TagName("tr"));
            int RowCnt = rows.Count;

            registeredAsset_Count = RowCnt - registeredAssetCount - 1;  //Subtract by 1 as header is also counted as 1 row
            Assert.AreEqual(true, countmsg.Contains(registeredAsset_Count.ToString()), "Count Matches for unregistered asset");
        }
Exemplo n.º 3
0
        public string[] Flow_GetTableData()
        {
            //bool a = BtnSave_Next.Displayed;
            //bool c = HtmlTable_DCN.Displayed;

            IList <IWebElement> rows = HtmlTable_DCN.FindElements(By.TagName("tr"));
            int RowCnt = rows.Count;
            //IList<IWebElement> Columns = HtmlTable_DCN.FindElements(By.TagName("th"));
            // IList<IWebElement> rows_header = HtmlTable_Header_DCN.FindElements(By.TagName("tr"));
            int i       = 0;
            int Counter = 0;

            String[] DataArray = new String[RowCnt];
            //int rowindex = 0;
            foreach (var row in rows)
            {
                Counter++;
                if (Counter == 1)
                {
                    var ColData = row.FindElements(By.TagName("th"));
                    foreach (var colvalue in ColData)
                    {
                        DataArray[i] = DataArray[i] + "^#$@~" + colvalue.GetText().Trim().ToString();
                    }
                    i++;
                }
                else
                {
                    var ColData = row.FindElements(By.TagName("td"));
                    foreach (var colvalue in ColData)
                    {
                        DataArray[i] = DataArray[i] + "^#$@~" + colvalue.GetText().Trim().ToString();
                    }
                    i++;
                }
            }
            return(DataArray);
        }