/// <summary> /// Finds the edit module content link for the module specified. /// </summary> /// <param name="moduleNum">The index of the module on the page. To find the action menu image for the first module on the page use 0.</param> /// <returns>The edit module link for the module.</returns> public Link GetEditModuleContentLink(int moduleNum) { //Returns the edit module content link for the module specified by moduleNum //0 being the first module on the page DivCollection actionMenu = IEInstance.Divs.Filter(Find.ByClass("dnnActionMenu")); if (actionMenu.Count > moduleNum) { return(actionMenu[moduleNum].Link(Find.ByText(s => s.Contains("Edit Content")))); } return(IEInstance.Link(Find.ByText(s => s.Contains("Edit Content")))); }
/// <summary> /// Clicks the expand button for a resource in the resources tree on the language editor page. /// </summary> /// <param name="resourceName">The name of the resource.</param> public void ClickExpandButtonForResource(string resourceName) { DivCollection TreeViewDivs = ContentPaneDiv.Divs.Filter(Find.ByClass("rtTop")); foreach (Div d in TreeViewDivs) { if (d.InnerHtml.Contains(resourceName)) { d.Span(Find.ByClass("rtPlus")).Click(); return; } continue; } }
public void Search(string isbn) { bool result = false; // SELENIUM // try // { // // If Navigation is required enter it here // string filePath = System.AppDomain.CurrentDomain.BaseDirectory.ToString(); // ieo = new InternetExplorerOptions(); // driver = new InternetExplorerDriver(filePath, ieo, TimeSpan.FromMinutes(5)); // driver = (IWebDriver)Browser.AttachTo<IE>(Find.ByTitle(browser.Title)); // } // catch(Exception e) // { // Console.WriteLine(e.Message); // } try { // Div container = browser.Div(Find.ByClass("srg")); DivCollection bookDivs = browser.Divs.Filter(Find.ByClass("g")); if (!result) { foreach (Div div in bookDivs) { div.Links[0].Click(); Table isbnTable = browser.Table(Find.ById("metadata_content_table")); if (isbnTable.OuterText.Contains(isbn)) { result = true; PullReferences(); } } } } catch (System.Runtime.InteropServices.COMException ce) { Console.WriteLine(ce.Message); //browser is locked up. return; } catch (Exception e) { // productItem.Close(); da.RecordDetailedErrorData(e, WebsiteID, 1); // isErrorred = true; // if (productItem != null) // productItem.ForceClose(); } finally { //if (CheckIfTooManyErrors()) allPagesDone = true; } }