public void WhenIAddAd_HocQueryType(string queryType) { try { BBCRMHomePage.OpenAnalysisFA(); //open the analysis functional area AnalysisFunctionalArea.InformationLibrary(); //open the information library InformationLibraryPanel.SelectTab("Queries"); //Select the queries tab string querystring = "//div/table/tbody/tr//td/table/tbody/tr//td/div/../..//td/table/tbody/tr/td/em/button[./text() = 'Add an ad-hoc query']"; InformationLibraryPanel.WaitClick(querystring, 10); //click on the "ad-hoc query" button Dialog.SetDropDown(Dialog.getXInput("AdHocQueryNewForm", "RECORDTYPE_value"), queryType); //start the adhoc query for the selected querytype string gridRowXPath = ""; if (queryType == "Constituent") { //Fundraisers gridRowXPath = "//div[contains(@id,'AdHocQueryNewForm')]//div[contains(@id, 'GROUPTYPE-Constituent-bd')]/div[3]/table"; } else if (queryType == "Revenue") { gridRowXPath = "//div[contains(@id,'AdHocQueryNewForm')]//div[contains(@id, 'GROUPTYPE-Revenue-bd')]/div[2]/table"; } InformationLibraryPanel.WaitClick(gridRowXPath, 20); //click on that row InformationLibraryPanel.WaitClick(Dialog.getXOKButton, 20); } catch (Exception ex) { throw new Exception("Error: could not add an adhoc query. " + ex.Message); } }
public void WhenIAddAConstituentAdhocQueryType() { try { BBCRMHomePage.OpenAnalysisFA(); //open the analysis functional area AnalysisFunctionalArea.InformationLibrary(); //open the information library InformationLibraryPanel.SelectTab("Queries"); //Select the queries tab string querystring = "//div[contains(@class,'bbui-pages-contentcontainer')" + "and not(contains(@class,'hide'))]//div[not(contains(@class,'x-hide-display'))" + "and contains(@class,'bbui-pages-pagesection') and not(contains(@class,'row'))]//div[contains(@id,'pageSection')]" + "/div/table/tbody/tr//td/table/tbody/tr//td/div/../..//td/table/tbody/tr/td/em/button[./text() = 'Add an ad-hoc query']"; InformationLibraryPanel.WaitClick(querystring, 10); //click on the "ad-hoc query" button string gridRowXPath = "//div[contains(@id,'GROUPTYPE-Most commonly used')]/div[1]/table/tbody/tr"; //select one of the rows for that query type InformationLibraryPanel.WaitClick(gridRowXPath, 10); //click on that row InformationLibraryPanel.WaitClick(Dialog.getXOKButton, 10); } catch (Exception ex) { throw new Exception("Error: could not add a constituent ad hoc query type. " + ex.Message); } }