/// <summary> /// expand Initial Item Settings /// </summary> public void ExpandInitialItemSettings() { InitialItemSettingsContainer.FakeAttributeClass = "accordion-body collapse"; string classAttribute = InitialItemSettingsContainer.WaitUntilExists(3).GetAttribute("class"); Report.Write("InitialItemSettingsContainer class: " + classAttribute); if (classAttribute.Contains("accordion-body collapse")) { InitialItemSettingsLink.MoveToElement(); InitialItemSettingsLink.Wait(3).Click(); //wait a second for the page to render Thread.Sleep(TimeSpan.FromSeconds(1)); } try { EnableTextFormatting.UseItemSettings.Wait(5); } catch (Exception e) { //The first click is not happening, re-click with different element, using the expand arrow. Report.Write("Re-attempting to click this element by: '" + InitialItemSettingsExpandArrow.By.ToString() + "'."); InitialItemSettingsExpandArrow.Wait(1).Click(); } }
/// <summary> /// collapse Initial Item Settings /// </summary> public void CollapseInitialItemSettings() { InitialItemSettingsContainer.FakeAttributeClass = "accordion-body in collapse"; string classAttribute = InitialItemSettingsContainer.WaitUntilExists(3).GetAttribute("class"); Report.Write("InitialItemSettingsContainer class: " + classAttribute); if (classAttribute.Contains("accordion-body in collapse")) { InitialItemSettingsLink.Wait(3).Click(); //wait a second for the page to render Thread.Sleep(TimeSpan.FromSeconds(1)); } }