/// <summary> /// Method is to check search an element in the XPOD list and return whether its present or not /// /// </summary> /// <param name="DataObj"></param> /// <returns></returns> public XPOD_HomePage_Xpodlist searchfunction(Object DataObj) { CommonMethods.PageLoadWait(driver, PageLoader()); var data = GetDataAsJsonObject.DataReaderJobject(DataObj, "BVT_TestData"); var SearchVal = data["Searchvalue"]; CommonMethods.WebdriverWait_ElementClickable(driver, Table_FirstEle()); if (NoOfRows() == 0) { Console.WriteLine("Search element is not present"); } else { for (int i = 1; i <= NoOfRows(); i++) { int counter = 0; IList <IWebElement> rowele = driver.FindElements(By.XPath("//mat-table[@id='validationList']//mat-row[" + i + "]/mat-cell")); foreach (var Ele in rowele) { if (Ele.Text.Equals(SearchVal.ToString()) || Ele.Text.Contains(SearchVal.ToString())) { counter = counter + 1; } } Assert.NotEqual(0, counter); } } return(new XPOD_HomePage_Xpodlist(driver)); }
/// <summary> /// this method is to compare the dropdown view values and the list of mandatory values /// given in the JSON file /// </summary> /// <param name="DataObj"></param> /// <returns></returns> public XPOD_HomePage_Xpodlist Method_SystemViewOptions_Validation(Object DataObj) { var data = GetDataAsJsonObject.DataReaderJobject(DataObj, "ViewList"); int NumberofRec = 8;//Convert.ToInt16( data["NoRec"]); CommonMethods.WebdriverWait_ElementClickable(driver, dd_views()); SelectElement options = new SelectElement(dd_views()); IList <IWebElement> ViewOptions = options.Options; for (int i = 1; i <= NumberofRec; i++) { String s = i.ToString(); int counter = 0; foreach (var Ele in ViewOptions) { if ((data[s].ToString().Trim()).Equals(Ele.Text.Trim())) { counter = counter + 1; } } Assert.NotEqual(0, counter); } return(new XPOD_HomePage_Xpodlist(driver)); }
/// <summary> ///Method to enter the search value in the search text box. ///Search value have passed as object JSON Objects /// </summary> /// <param name="DataObj"></param> /// <returns></returns> public XPOD_HomePage_Xpodlist Method_Enter_SearchElement(Object DataObj) { var data = GetDataAsJsonObject.DataReaderJobject(DataObj, "BVT_TestData"); var SearchVal = data["Searchvalue"]; TextBox_SeachEle().SendKeys(SearchVal.ToString());//sending the search value to the search textbox return(new XPOD_HomePage_Xpodlist(driver)); }
//Actons /// <summary> /// Loading the Technical Validation Page and validating the header text is displayed. /// Passing URL and details through the object from the JSON file /// </summary> /// <param name="value"></param> /// <returns></returns> public XPOD_HomePage_Header Login_XPOD(Object value) { var data = GetDataAsJsonObject.DataReaderJobject(value, "BVT_TestData"); var url = data["URL"]; driver.Navigate().GoToUrl(url.ToString()); Assert.True(txt_page_header().Displayed); return(new XPOD_HomePage_Header(driver)); }
/// <summary> /// this method is to select dropdown view in the advanced find page /// </summary> /// <param name="DataObj"></param> /// <param name="TestName"></param> /// <param name="TestValue"></param> /// <returns></returns> public AdvancedFind_Page AdvancedFind_SelectView(Object DataObj, String TestName, String TestValue) { var data = GetDataAsJsonObject.DataReaderJobject(DataObj, TestName); var viewname = data[TestValue]; SelectElement View = new SelectElement(dd_AdvancedViewSelect()); View.SelectByText(viewname.ToString()); return(new AdvancedFind_Page(driver)); }
public XPOD_ValidatePage Method_Validate_SelectedResComment(Object DataObj, String TestName, String RespOption) { var Data = GetDataAsJsonObject.DataReaderJobject(DataObj, TestName); String ValRespComments = Data[RespOption].ToString(); String Respcom = TextArea_Comments().GetAttribute("value"); Assert.Contains(ValRespComments, Respcom); return(new XPOD_ValidatePage(driver)); }
/// <summary> /// This method is to edit the editable field DealID /// </summary> /// <param name="DataObj"></param> public XPOD_Genral_OI_Page Method_EditDealID_Field(Object DataObj) { Txtbox_DealID().Clear(); CommonMethods.Wait_TillTextbox_Clear(driver, Txtbox_DealID()); var data = GetDataAsJsonObject.DataReaderJobject(DataObj, "TestData"); Txtbox_DealID().SendKeys(data["EditDealID"].ToString()); return(new XPOD_Genral_OI_Page(driver)); }
public XPOD_Genral_OI_Page Method_Validate_EditedOIPageFields(Object DataObj) { var data = GetDataAsJsonObject.DataReaderJobject(DataObj, "TestData"); String strEditDealID = data["EditDealID"].ToString(); String strDealIDValue = Txtbox_DealID().GetAttribute("value"); Assert.Equal(strEditDealID, strDealIDValue); return(new XPOD_Genral_OI_Page(driver)); }
public XPOD_HomePage_Header EnterSearchElement_FullDbSearch(Object DataObj) { var data = GetDataAsJsonObject.DataReaderJobject(DataObj, "BVT_TestData"); var searchval = data["Searchvalue"]; TextBox_Fulldb_Search().SendKeys(searchval.ToString()); CommonMethods.PageLoadWait(driver, PageLoader()); CommonMethods.WebdriverWait_ElementClickable(driver, FullDbSearch_SearchBtn()); FullDbSearch_SearchBtn().Click(); return(new XPOD_HomePage_Header(driver)); }
/// <summary> /// Selecting the view value from the dropdown. /// values are passed through parameters. /// </summary> /// <param name="DataObj"></param> /// <param name="TestName"></param> /// <param name="TestValue"></param> /// <returns></returns> public XPOD_HomePage_Xpodlist Method_SelectViewValue(Object DataObj, String TestName, String TestValue) { var data = GetDataAsJsonObject.DataReaderJobject(DataObj, TestName); var viewName = data[TestValue]; CommonMethods.WebdriverWait_ElementClickable(driver, dd_views()); SelectElement options = new SelectElement(dd_views()); options.SelectByText(viewName.ToString()); return(new XPOD_HomePage_Xpodlist(driver)); }
public XPOD_NotesTab_Page Creating_Notes(Object DataObj) { var data = GetDataAsJsonObject.DataReaderJobject(DataObj, "BVT_TestData"); var Notes = data["Notes"]; TxtArea_AddNote().SendKeys(Notes.ToString()); CommonMethods.WebdriverWait_TillElementReady(driver, Btn_CreateNote()); Btn_CreateNote().Click(); CommonMethods.WebdriverWait_TillElementReady(driver, Notes_table()); return(new XPOD_NotesTab_Page(driver)); }
/// <summary> /// This method is to compare the passed view name and the default view name /// </summary> /// <param name="DataObj"></param> /// <param name="TestName"></param> /// <param name="TestValue"></param> public XPOD_HomePage_Xpodlist Method_ViewDropdown_ValueValidation(Object DataObj, String TestName, String TestValue) { var data = GetDataAsJsonObject.DataReaderJobject(DataObj, TestName); var viewname = data[TestValue]; CommonMethods.WebdriverWait_ElementClickable(driver, dd_views()); SelectElement dropdown = new SelectElement(dd_views()); String str = dropdown.SelectedOption.Text; Assert.Equal(str.Trim(), viewname.ToString().Trim()); return(new XPOD_HomePage_Xpodlist(driver)); }
public XPOD_HomePage_Xpodlist Method_ValidateDefaultView(Object DataObj, String TestName, String TestValue) { var data = GetDataAsJsonObject.DataReaderJobject(DataObj, TestName); SelectElement dd_Select = new SelectElement(dd_views()); CommonMethods.WebdriverWait_TillElementReady(driver, dd_views()); String strDefalutvalue = dd_Select.SelectedOption.Text.Trim(); String strUsergivenView = data[TestValue].ToString().Trim(); Assert.True(strDefalutvalue.Equals(strUsergivenView)); return(new XPOD_HomePage_Xpodlist(driver)); }
public void Method_Validate_ResponseComments(Object DataObj, String TestName, String RespName, int OldNotesCount) { int NotesLatestCount = Getting_NotesTableCount(); Assert.True(NotesLatestCount > OldNotesCount); var data = GetDataAsJsonObject.DataReaderJobject(DataObj, TestName); String Notes = data[RespName].ToString(); CommonMethods.WebdriverWait_TillElementReady(driver, Notes_table()); Assert.True(Notes_table().Displayed); Assert.Contains(Notes, FirstCell_NotesTable().Text); }
public XPOD_NotesTab_Page CreatedNote_Validation(Object DataObj, int OldNoteCount) { int NotesCountLatest = Getting_NotesTableCount(); Assert.True(NotesCountLatest > OldNoteCount); var data = GetDataAsJsonObject.DataReaderJobject(DataObj, "BVT_TestData"); var Notes = data["Notes"]; CommonMethods.WebdriverWait_TillElementReady(driver, Notes_table()); Assert.True(Notes_table().Displayed); Assert.Equal(Notes.ToString(), FirstCell_NotesTable().Text); return(new XPOD_NotesTab_Page(driver)); }
public XPOD_AssignPage selectSEC(Object DataObj, String TestName, String TestValue) { var data = GetDataAsJsonObject.DataReaderJobject(DataObj, TestName); var names = data[TestValue]; CommonMethods.WebdriverWait_TillElementReady(driver, assignDropdown()); SelectElement sec = new SelectElement(assignDropdown()); sec.SelectByText(names.ToString()); assignBtn().Click(); CommonMethods.WebdriverWait_TillElementReady(driver, closeBtn()); Assert.True(closeBtn().Enabled); return(new XPOD_AssignPage(driver)); }
public XPOD_InstallationSec_Page Validating_Edited_Fields(Object DataObj) { CommonMethods.PageLoadWait(driver, PageLoader()); var data = GetDataAsJsonObject.DataReaderJobject(DataObj, "InstallationSec"); Assert.Equal(data["Addressline1"].ToString(), Txtbox_Addressline1().GetAttribute("value")); //Assert.Equal(data["Addressline2"].ToString(), Txtbox_Addressline2().GetAttribute("value")); Assert.Equal(data["City"].ToString(), Txtbox_City().GetAttribute("value")); Assert.Equal(data["State"].ToString(), Txtbox_State().GetAttribute("value")); Assert.Equal(data["Country"].ToString(), Txtbox_Country().GetAttribute("value")); Assert.Equal(data["Zipcode"].ToString(), Txtbox_ZipCode().GetAttribute("value")); return(new XPOD_InstallationSec_Page(driver)); }
/// <summary> /// This method is to edit the fields the editable fields in General Tab /// Three frields are editable. Giving random values to those fields /// </summary> /// <returns></returns> public XPOD_General_RI_Page Method_EditFields(Object DataObj) { CommonMethods.WebdriverWait_TillElementReady(driver, dd_Ordertype()); var data = GetDataAsJsonObject.DataReaderJobject(DataObj, "TestData"); SelectElement OrdeType = new SelectElement(dd_Ordertype()); OrdeType.SelectByText(data["EditOrdeType"].ToString()); SelectElement Region = new SelectElement(dd_Region()); Region.SelectByText(data["EditRegion"].ToString()); return(new XPOD_General_RI_Page(driver)); }
/// <summary> /// This method is to Enter the New view details on the corresponding fields /// The data is passed through JSON file /// </summary> /// <param name="DataObj"></param> /// <returns></returns> public AdvancedFind_Page Entering_NewView_Details(Object DataObj) { var data = GetDataAsJsonObject.DataReaderJobject(DataObj, "TestData"); String Viewname = data["View"].ToString(); String ViewDesc = data["ViewDesc"].ToString(); CommonMethods.WebdriverWait_TillElementReady(driver, Txtbox_ViewName()); Txtbox_ViewName().SendKeys(Viewname); CommonMethods.WebdriverWait_TillElementReady(driver, Txtbox_ViewDescription()); Txtbox_ViewDescription().SendKeys(ViewDesc); AddingStatus_Denitedfilter(); return(new AdvancedFind_Page(driver)); }
public XPOD_General_RI_Page Method_Validate_EditedFields(Object DataObj) { CommonMethods.WebdriverWait_TillElementReady(driver, dd_Ordertype()); var data = GetDataAsJsonObject.DataReaderJobject(DataObj, "TestData"); SelectElement OrderType = new SelectElement(dd_Ordertype()); String strOrdertypeOption = OrderType.SelectedOption.Text.Trim(); String strEditOrdertype = data["EditOrdeType"].ToString(); Assert.Equal(strEditOrdertype, strOrdertypeOption); SelectElement Region = new SelectElement(dd_Region()); Assert.Equal((data["EditRegion"].ToString()), (Region.SelectedOption.Text.Trim())); return(new XPOD_General_RI_Page(driver)); }
public void Method_ComparingDefaultView_UsergivenValue(Object DataObj, String TestName, String TestVal) { var data = GetDataAsJsonObject.DataReaderJobject(DataObj, TestName); var view = data[TestVal]; SelectElement sel = new SelectElement(dd_AdvancedViewSelect()); String defaultvalue = sel.SelectedOption.Text; String uservalue = view.ToString().Trim(); if (defaultvalue.Equals(uservalue)) { Console.Write("The mentioned View is already the Default View for the user"); AdvanceFind_CloseFun(); } else { AdvancedFind_SelectView(DataObj, "Test5867945", "View1").Clicking_SetDefaultView(); } }
public XPOD_HomePage_Xpodlist SystemView_SelectionValidations(Object DataObj) { var data = GetDataAsJsonObject.DataReaderJobject(DataObj, "ViewList"); int NumberofRec = 2; CommonMethods.WebdriverWait_ElementClickable(driver, dd_views()); SelectElement options = new SelectElement(dd_views()); for (int i = 0; i <= NumberofRec; i++) { options.SelectByText((data[i.ToString()]).ToString()); if (i == 1) { Status_Column(); } } return(new XPOD_HomePage_Xpodlist(driver)); }
public AdvancedFind_Page Method_EditAdvanvedFind_Views(Object DataObj) { var data = GetDataAsJsonObject.DataReaderJobject(DataObj, "TestData"); String strEditedViewName = data["EditViewname"].ToString(); String strEditViewDesc = data["EditViewdesc"].ToString(); CommonMethods.WebdriverWait_TillElementReady(driver, Txtbox_ViewName()); Txtbox_ViewName().Clear(); CommonMethods.WebdriverWait_TillElementReady(driver, Txtbox_ViewName()); Txtbox_ViewName().SendKeys(strEditedViewName); CommonMethods.WebdriverWait_TillElementReady(driver, Txtbox_ViewDescription()); Txtbox_ViewDescription().Clear(); CommonMethods.WebdriverWait_TillElementReady(driver, Txtbox_ViewDescription()); Txtbox_ViewDescription().SendKeys(strEditViewDesc); //Method_Remove_AllFilter(); //Thread.Sleep(2000); //Btn_AddFilter().Click(); Method_AddSourceOSC_Filter(); Assert.True(Btn_SaveView().Enabled); return(new AdvancedFind_Page(driver)); }
/// <summary> /// This method is to Edit the existing fields and save /// </summary> /// <returns></returns> public XPOD_InstallationSec_Page FieldEdit_Validation(Object DataObj) { var data = GetDataAsJsonObject.DataReaderJobject(DataObj, "InstallationSec"); Txtbox_Addressline1().Clear(); Txtbox_Addressline1().SendKeys(data["Addressline1"].ToString()); Txtbox_Addressline2().Clear(); Txtbox_Addressline2().SendKeys(data["Addressline2"].ToString()); Txtbox_City().Clear(); Txtbox_City().SendKeys(data["City"].ToString()); Txtbox_State().Clear(); Txtbox_State().SendKeys(data["State"].ToString()); Txtbox_Country().Clear(); Txtbox_Country().SendKeys(data["Country"].ToString()); Txtbox_ZipCode().Clear(); Txtbox_ZipCode().SendKeys(data["Zipcode"].ToString()); CommonMethods.WebdriverWait_ElementClickable(driver, Btn_SaveInstallInfo()); CommonMethods.Page_Scrolldown(driver); Btn_SaveInstallInfo().Click(); //CommonMethods.Page_ScrollUp(driver); return(new XPOD_InstallationSec_Page(driver)); }
public XPOD_ValidationResponse_Page Method_ValidateResponsesInMultiselectValues(Object DataObj, String TestData, int NoResp) { var data = GetDataAsJsonObject.DataReaderJobject(DataObj, TestData); CommonMethods.WebdriverWait_ElementClickable(driver, MultiSelect_Resp()); SelectElement options = new SelectElement(MultiSelect_Resp()); IList <IWebElement> ViewOptions = options.Options; if (NoResp == 0) { foreach (var Ele in ViewOptions) { Assert.Equal(data["0"].ToString().Trim(), Ele.Text.Trim()); break; } } else { for (int i = 1; i <= NoResp; i++) { String s = i.ToString(); int counter = 0; foreach (var Ele in ViewOptions) { if ((data[s].ToString().Trim()).Equals(Ele.Text.Trim())) { counter = counter + 1; break; } } Assert.NotEqual(0, counter); } } return(new XPOD_ValidationResponse_Page(driver)); }