private Excel.Worksheet InsertOKToModifyItemData(AddinRibbonController ribbon, string itemName, bool getSecondInstance)
        {
            //Login
            if (!getSecondInstance)
            {
                AddinTestUtility.LoginExpectSuccess(ribbon, AddinTestUtility.LoginEmail, AddinTestUtility.LoginPsw);
            }

            //Insert item
            ribbon.InvokeButton(AddinRibbonButton.InsertItem);

            var itemDlg = InsertItemDriver.FindFromParent(ribbon.ExcelElement);

            itemDlg.SelectedItem = itemName;
            itemDlg.AllowPublish = true;
            itemDlg.SelectInsertVerifySuccess();

            //Wait for item to be inserted in item-named worksheet
            var sheetName = itemName;

            if (getSecondInstance)
            {
                sheetName += " 1";
            }
            var ws = ExcelAutoUtility.GetWorkSheetWithTimeout(_wb.Wb, sheetName, AddinTestUtility.WebServiceResponsePopulateTimeout);

            //Wait for access to worksheet to be stable
            ExcelAutoUtility.WaitForNewWorksheetToBeAccessible(ws);

            return(ws);
        }
        private void CreateItemDialogCreateSimpleItem(AddinRibbonController ribbon, string newItemName, string newItemDescr)
        {
            //Login
            AddinTestUtility.LoginExpectSuccess(ribbon, AddinTestUtility.LoginEmail, AddinTestUtility.LoginPsw);

            //Create a data range from which to create item
            var sheet = _wb.Wb.ActiveSheet as Excel.Worksheet;

            ExcelAutoUtility.SetCellValue(sheet, 1, 1, "colA");
            ExcelAutoUtility.SetCellValue(sheet, 1, 2, "colB");
            ExcelAutoUtility.SetCellValue(sheet, 2, 1, 1);
            ExcelAutoUtility.SetCellValue(sheet, 2, 2, 2);
            ExcelAutoUtility.SetCellValue(sheet, 3, 1, 3);
            ExcelAutoUtility.SetCellValue(sheet, 3, 2, 4);

            var range = sheet.get_Range("A1", "B3");

            range.Select();

            //Create item
            ribbon.InvokeButton(AddinRibbonButton.Create);

            var createItemDlg = CreateItemDriver.FindFromParent(ribbon.ExcelElement);

            createItemDlg.Name = newItemName;
            createItemDlg.Desc = newItemDescr;

            createItemDlg.SelectCreateVerifySuccess();
        }