//USEUNIT ChangeStatus //USEUNIT CommonFunctions //USEUNIT GeneralFunctions //USEUNIT ParseFunction function CallLaunchChrome(url) { //To Launch the R&D Suite Application if(LaunchChrome(url,"Opcenter Research, Development and Laboratory","Panel")== true) { createjson(jsonstr,i++, "Pass|Launched Opcenter Research, Development and Laboratory application succesfully","Pass",pathJSON,"Pass",testSteps)// to create Json Log.Message("Pass|Launched Opcenter Research, Development and Laboratory application succesfully","Passed",300,Passattr) if (to_Verify_Configuration("RnDSuite")==true) { Log.Message("Pass|Username is displayed","Config",50,Passattr) createjson(jsonstr,i++, "Pass|Username is displayed and <Save> is clicked","Pass",pathJSON,"Pass",testSteps) } else { Log.Message("Config Window does not exists..","Config",50,Verifyattr) createjson(jsonstr,i++, "Configuration window is not displayed","Pass",pathJSON,"Pass",testSteps) } } else { throw "Failed to Launch Opcenter Research, Development and Laboratory application" } } function CallChangeRoleToLabWorker(strLabWorker) { Log.AppendFolder("Change Role to Lab worker") if(ChangeRole(strLabWorker)==true) { WaitCheck("Opcenter Research, Development and Laboratory","Panel") Log.Message("User role is successfully changed to lab worker","Passed",300,Passattr) createjson(jsonstr,i++, "User role is successfully changed to lab worker","Pass",pathJSON,"Pass",testSteps) } else { throw "Failed to change role to Lab Worker" } Log.PopLogFolder() } function CallClickCreateSample(strCurrentTask) { Log.AppendFolder("Click on Create Sample") if (ClickMainButton("CREATE SAMPLE")==true) { Log.Message("Clicked on <Create Sample> in Home screen","Passed",300,Passattr) createjson(jsonstr,i++, "Clicked on <Create Sample> in Home screen","Pass",pathJSON,"Pass",testSteps) ProgressBar() Delay(3000,"Waiting for Current Task") WaitCheck("Currently selected Task","TextNode") CreateSampleWizardFilterCriteriaMapping() if(SelectCurrentTask(strCurrentTask) == true) { IndicatorDemo("Create and Open Sample",3000) createjson(jsonstr,i++,"Selected "+strCurrentTask+" from the dropdown.","Pass",pathJSON,"Pass",testSteps) Log.Message("Clicked on <Apply>","Passed",300,Passattr) } else { throw "Current task is not selected" } } else { throw "Failed to Click on the Create Sample button in Home screen" } Log.PopLogFolder() } function CallFilterSearch(strSampleShortDescr) { Log.AppendFolder("Enter Filter criteria") FindFilterInColumn("ShortDescription") ColumnFilterMapping() if(EnterValueInFilterSearch(strSampleShortDescr)==true) { Log.Message("Entered sample type in filter search","Passed",300,Passattr) createjson(jsonstr,i++,"Sample type is successfully entered in search filter","Pass",pathJSON,"Pass",testSteps) btn_Fil_Filter.Click() Log.Message("Sample is filtered via column filter","Passed",300,Passattr) } else { throw "Failed to filter the results from Search filter" } Log.PopLogFolder() } /********************************************************************************** Purpose: Create Sample for any HRF / CDA sample (exception: HRF_RF_EU19, CDA_RF_EU19, HRF_RF_EU19_mod) Input: url,strSampleShortDescr,testkey,testexecutionkey url - URL of testing environment strSampleShortDescr - should be same as that mentioned in datasheet testkey - Test Set ID testexecutionkey - Test Execution ID Returns: None **********************************************************************************/ function SC_CreateSample_HRF_CDA(url,strSampleShortDescr,testkey,testexecutionkey) { try { i = 1 strTestExecutionUrl="https://issuetracking.bsh-sdd.com/browse/"+testexecutionkey // to get the value of the jsonStr jsonstr = returnjson(testkey,testexecutionkey) pathJSON = Project.Path + "\JSONfiles\\"+testkey+".json" Log.Message(pathJSON); if (!aqFile.Exists(pathJSON)) { aqFile.Create(pathJSON) } else { aqFileSystem.DeleteFile(pathJSON) aqFile.Create(pathJSON) } //Start video if(strVideo == "Yes") StartVideo_CreateSrtFile(sPath) else Log.Message("Video and srt file is not required") //trim scenario name to get sample type if(strSampleShortDescr.includes("_PhasedOut",6) == true) { strSampleType = strSampleShortDescr.replace("_PhasedOut",'') strFinalStatus = "Phased out" } else if(strSampleShortDescr.includes("_Rejected",6) == true) { strSampleType = strSampleShortDescr.replace("_Rejected",'') strFinalStatus = "Rejected" } else if(strSampleShortDescr.includes("_OneCompartment",6) == true) { strSampleType = strSampleShortDescr.replace("_OneCompartment",'') strFinalStatus = "Phased out" } else if(strSampleShortDescr.includes("_TwoCompartments",6) == true) { strSampleType = strSampleShortDescr.replace("_TwoCompartments",'') strFinalStatus = "Phased out" } else strSampleType = strSampleShortDescr //Find Domain (HRF or CDA) of sample type and assign Current Task (create and open), data sheet file name if(strSampleType.includes("HRF",0) == true) { strCurrentTask = "Create Measurement Order" strFileName= "VMP_data.xlsx" strOpenCurrentTask = "Open Measurement Order" //Assign user roles, declare info-cards array and total number of steps for each test if(strSampleType.includes("DC",3) == true) { strLabWorker = "HRF_DC_LabWorker" strLabManager = "HRF_DC_Approver" arrInfoCards = Array("General") testSteps = 24 } else if(strSampleType.includes("LCC",3) == true) { strLabWorker = "HRF_LCC_LabWorker" strLabManager = "HRF_LCC_Approver" arrInfoCards = Array("General") testSteps = 24 } else if(strSampleType.includes("LCW",3) == true) { strLabWorker = "HRF_LCW_LabWorker" strLabManager = "HRF_LCW_Approver" arrInfoCards = Array("General") testSteps = 24 } else if(strSampleType.includes("LCD",3) == true) { strLabWorker = "HRF_LCD_LabWorker" strLabManager = "HRF_LCD_Approver" arrInfoCards = Array("General") testSteps = 24 } else if(strSampleType.includes("RF",3) == true) { strLabWorker = "HRF_RF_LabWorker" strLabManager = "HRF_RF_Approver" arrInfoCards = Array("General Data for Wine Storage","Global Compartment Data","Frost Free information","Outer Dimensions") testSteps = 24 } } else if(strSampleType.includes("CDA",0) == true) { strCurrentTask = "Create Declaration Order" strFileName= "CDA_data.xlsx" strOpenCurrentTask = "Open Declaration Order" //Assign user roles, declare info-cards array and total number of steps for each test if(strSampleType.includes("DC",3) == true) { strLabWorker = "CDA_DC_LabWorker" strLabManager = "CDA_DC_Approver" arrInfoCards = Array("General") testSteps = 24 } else if(strSampleType.includes("LCC",3) == true) { strLabWorker = "CDA_LCC_LabWorker" strLabManager = "CDA_LCC_Approver" arrInfoCards = Array("General") testSteps = 24 } else if(strSampleType.includes("LCW",3) == true) { strLabWorker = "CDA_LCW_LabWorker" strLabManager = "CDA_LCW_Approver" arrInfoCards = Array("General") testSteps = 24 } else if(strSampleType.includes("LCD",3) == true) { strLabWorker = "CDA_LCD_LabWorker" strLabManager = "CDA_LCD_Approver" arrInfoCards = Array("General") testSteps = 24 } else if(strSampleType.includes("RF",3) == true) { strLabWorker = "CDA_RF_LabWorker" strLabManager = "CDA_RF_Approver" arrInfoCards = Array("General","Compartment Data") testSteps = 24 } } else { throw "Sample type is not valid.. Please pass valid sample type" } //To Launch the R&D Suite Application CallLaunchChrome(url) //Change Role to Lab Worker CallChangeRoleToLabWorker(strLabWorker) //To create the sample Log.AppendFolder("Create Sample for "+strSampleType) CallClickCreateSample(strCurrentTask) //To create and Open the sample by using the <Create and Open> ActionBar button Log.AppendFolder("Create and Open Sample") if(RowSelectionSingleClick("ShortDescription",strSampleType)==true) {//6 if (ClickDropdownIconInActionBarBasedOnName("CreateSampleCreate","Create and Open")==true) { ProgressBar() Log.Message("Clicked on Create and Open ActionBar button","Passed",300,Passattr) createjson(jsonstr,i++, "Clicked on Create and Open ActionBar button","Pass",pathJSON,"Pass",testSteps) WaitCheck("Status to Cancelled","Panel") ClickButton("Filter") //To get the created sample details strSampleSCValue = SampleIDOfNewSample() if(strSampleSCValue != "") { Log.Message("Retrieved the sample ID as "+strSampleSCValue,"Passed",300,Passattr) if (GetStatusDescriptionOfSample("Available")==true == true) {//7 Log.Message("Status of the sample is Available","Passed",300,Passattr) createjson(jsonstr,i++, "Status of the sample is Available","Pass",pathJSON,"Pass",testSteps) } else { throw "Status of the sample is not Available" } } else { throw "Unable to retrieve the sample" } } else { throw "Failed to click on the Create and Open" } } else { throw "Sample is not shown = "+strSampleType } Log.PopLogFolder() Log.AppendFolder("Check for the info-cards") ClickCloseTabButton() NavigateToInfoCards() if(VerifyAllInfoCards(arrInfoCards) == true) {//8 Log.Message("All info-cards are present","Info Cards",300,Passattr) createjson(jsonstr,i++, "All info-cards are present","Pass",pathJSON,"Pass",testSteps) } else { Log.Message("All info-cards are not present","Info Cards",300,FailAttr) createjson(jsonstr,i++, "All info-cards are not present","Fail",pathJSON,"Fail",testSteps) } Log.PopLogFolder() Log.AppendFolder("Switch to Approver role and check for Info-fields state") if(ChangeRole(strLabManager)==true) {//9 WaitCheck("Opcenter Research, Development and Laboratory","Panel") Log.Message("User role is successfully changed to Approver","Passed",300,Passattr) createjson(jsonstr,i++, "User role is successfully changed to lab worker","Pass",pathJSON,"Pass",testSteps) } else { throw "Failed to change role to Approver" } if(ClickMainButton("OPEN SAMPLE")==true) {//10 SelectCurrentTask(strOpenCurrentTask) Log.Message("Navigated to Open Sample Wizard screen","Passed",300,Passattr) if(RowSelectionSingleClick("ShortDescription",strSampleSCValue)==true) { Log.Message("Sample is selected","Passed",300,Passattr) } else { throw "Failed to select sample"+strSampleSCValue } Log.Message("Check if all info-fields are disabled","Passed",300,Passattr) createjson(jsonstr,i++, "Check if all info-fields are disabled","Pass",pathJSON,"Pass",testSteps) } else { throw "Failed to navigate to Open Sample screen" } Log.PopLogFolder() Log.AppendFolder("Switch to Lab Worker role") if(ChangeRole(strLabWorker)==true) {//11 WaitCheck("Opcenter Research, Development and Laboratory","Panel") Log.Message("User role is successfully changed to Lab Worker","Passed",300,Passattr) createjson(jsonstr,i++, "User role is successfully changed to Lab Worker","Pass",pathJSON,"Pass",testSteps) } else { throw "Failed to change role to Lab Worker" } if(ClickMainButton("OPEN SAMPLE")==true) { SelectCurrentTask(strOpenCurrentTask) Log.Message("Navigated to Open Sample Wizard screen","Passed",300,Passattr) if(RowSelectionSingleClick("ShortDescription",strSampleSCValue)==true) {//12 Log.Message("Sample is selected","Passed",300,Passattr) createjson(jsonstr,i++, "Navigated to Open Sample screen and Sample is selected","Pass",pathJSON,"Pass",testSteps) } else { throw "Failed to select sample" } //13 strInfoSheet = "InfoCards" WriteIntoInfoCards(strSampleShortDescr,getExcelPath(strFileName),strInfoSheet) createjson(jsonstr,i++, "Info-Card details are entered. Check log for details","Pass",pathJSON,"Pass",testSteps) //Enter details into info-fields after save (for any additional info-fields after save) if((strSampleType.includes("LCD_CD",4) == true) || strSampleType.includes("LCW_P",4) == true) { NavigateToInfoCards() WriteIntoInfoCards(strSampleShortDescr+"_AfterSave",getExcelPath(strFileName),strInfoSheet) createjson(jsonstr,i++, "Info-Card details are entered. Check log for details","Pass",pathJSON,"Pass",testSteps) } Log.Message("All details entered for the Info-cards","Info Cards",300,Passattr) } else { throw "Failed to navigate to Open Sample screen" } Log.PopLogFolder() //To enter the details in the Results grid for different parameters Log.AppendFolder("Enter details in results") VerticalCommandBarMapping() if(btn_Results.Exists) {//14 btn_Results.Click() Log.Message("Navigated to results tab","Passed",300,Passattr) createjson(jsonstr,i++, "Parameter profiles are navigated","Pass",pathJSON,"Pass",testSteps) //Validation for parameter profiles //15 createjson(jsonstr,i++, "Clicked on the Parameter profiles","Pass",pathJSON,"Pass",testSteps) strResultsSheet = "Parameters" WriteToValueColumn(strSampleShortDescr,getExcelPath(strFileName),strResultsSheet) Log.Message("All details entered in results","Results",300,Passattr) //16 createjson(jsonstr,i++, "All details are entered in parameters","Pass",pathJSON,"Pass",testSteps) } else { throw "Fail|Results Navigation Bar is not visible" } Log.PopLogFolder() //To change the Status of the Sample to "Submit" Log.AppendFolder("Status Change - 1") if (ClickActionBarButton("Status Change")==true) { Log.Message("Clicked on Status Change button","Passed",300,Passattr) ChangeStatusMapping() //To select the required Status if(DropdownValueSelection(dd_CS_Status," Submit")==true) { Log.Message("Available dropdown value is selected","Passed",300,Passattr) } else {//17 Log.Error("Unable to select Available dropdown value","Failed",300,FailAttr) createjson(jsonstr,i, "Unable to select Available dropdown value..Please investigate","Fail",pathJSON,"Fail",testSteps) } //To select the Status Reason if(DropdownValueSelection(dd_CS_PredefinedReason,"Ready to use")==true) { Log.Message("Reason dropdown value is selected","Passed",300,Passattr) } else {//17 Log.Error("Unable to select Reason dropdown value","Failed",300,FailAttr) createjson(jsonstr,i, "Unable to select Reason dropdown value..Please investigate","Fail",pathJSON,"Fail",testSteps) } btn_CS_Ok.Click() //To check the Status Description if (GetStatusDescriptionOfSample("Submit")==true) {//17 Log.Message("Status of the sample is Submit","Passed",300,Passattr) createjson(jsonstr,i++, "Status of the sample is changed to Submit","Pass",pathJSON,"Pass",testSteps) } else { throw "Status of the sample is not Submit..Please investigate" } } else { throw "Failed to change the status to Submit" } Log.PopLogFolder() Log.AppendFolder("Check if all info-fields are disabled") NavigateToInfoCards() Log.Message("Check if all info-fields are disabled","Passed",300,Passattr) createjson(jsonstr,i++, "Check if all info-fields are disabled","Pass",pathJSON,"Pass",testSteps) Log.PopLogFolder() //Change Role to Lab Manager to approve the sample Log.AppendFolder("Change Role to Lab Manager") if(ChangeRole(strLabManager)==true) { Log.Message("Role is successfully changed to HRF_Lab Manager","Change Role",300,Passattr) createjson(jsonstr,i++,"Role is successfully changed to 'Lab Manager'","Pass",pathJSON,"Pass",testSteps) WaitCheck("Opcenter Research, Development and Laboratory","Panel") if(ClickMainButton("OPEN SAMPLE")==true) { WaitCheck("Currently selected Task","TextNode") CreateSampleWizardFilterCriteriaMapping() btn_SC_Apply.Click() Delay(1000,"Open Sample to approve") ProgressBar() Log.Message("Navigated to Open Sample Wizard screen","Passed",300,Passattr) if(RowSelectionSingleClick("ShortDescription",strSampleSCValue)==true) {//21 Log.Message("Sample is selected","Passed",300,Passattr) Log.Message("Check if all info-fields are disabled","Passed",300,Passattr) ClickCloseTabButton() createjson(jsonstr,i++, "Check if all info-fields are disabled","Pass",pathJSON,"Pass",testSteps) } else { throw "Failed to select sample" } } else { throw "Failed to navigate to Open Sample screen" } } else { throw "Failed to change the role to Lab Manager" } Log.PopLogFolder() //To change the status to "Approved" Status Log.AppendFolder("Status Change - 2") if(strFinalStatus == "Phased out") //First change the status to 'Approved' and then to 'Phased out' { if(ClickActionBarButton("Status Change")==true) { ChangeStatusMapping() if(DropdownValueSelection(dd_CS_Status," Approved")==true) { Log.Message("Available dropdown value is selected","Passed",300,Passattr) } else {//22 Log.Error("Unable to select Available dropdown value","Failed",300,FailAttr) createjson(jsonstr,i++,"Unable to select Available dropdown value..Please investigate","Fail",pathJSON,"Fail",testSteps) } //To select the Status Reason if(DropdownValueSelection(dd_CS_PredefinedReason,"Approved by Lab Manager")==true) { Log.Message("Reason dropdown value is selected","Passed",300,Passattr) } else {//22 Log.Error("Unable to select Reason dropdown value","Failed",300,FailAttr) createjson(jsonstr,i++,"Unable to select Reason dropdown value..Please investigate","Fail",pathJSON,"Fail",testSteps) } btn_CS_Ok.Click() } //To verify if the sample status is 'Approved' if (GetStatusDescriptionOfSample("Approved")==true) {//22 Log.Message("Status of the sample is Approved","Passed",300,Passattr) createjson(jsonstr,i++, "Status of sample is Approved","Pass",pathJSON,"Pass",testSteps) } else { throw "Status of the sample is not Approved...Please investigate" } Log.AppendFolder("Data to be exported - Report") strURL = Geturl() if(ClickDropdownIconInActionBarBasedOnName("Report4","Data to be Exported")==true) { //////////////////////////////Expected result validation to be done manually Log.Message("<Data to be Exported> is clicked","Passed",300,Passattr) createjson(jsonstr,i++, "Check manually for exported data","Pass",pathJSON,"Pass",testSteps) Sys.Browser("chrome").Page(strURL).Click() } else { Log.Error("<Data to be Exported> is not clicked","Failed",300,FailAttr) createjson(jsonstr,i++, "<Data to be Exported> is not clicked..Please investigate","Fail",pathJSON,"Fail",testSteps) //Since this is not a blocker, script execution can be continued } Log.PopLogFolder() } if(ClickActionBarButton("Status Change")==true) { Log.Message("Clicked on Status Change button","Passed",300,Passattr) ChangeStatusMapping() //To select the required Status to 'Phased out' or 'Rejected' if(DropdownValueSelection(dd_CS_Status," "+strFinalStatus)==true) { Log.Message("Available dropdown value is selected","Passed",300,Passattr) } else {//22 Log.Error("Unable to select Available dropdown value","Failed",300,FailAttr) createjson(jsonstr,i,"Unable to select Available dropdown value..Please investigate","Fail",pathJSON,"Fail",testSteps) } //To select the Status Reason if(DropdownValueSelection(dd_CS_PredefinedReason,"No longer relevant")==true) { Log.Message("Reason dropdown value is selected","Passed",300,Passattr) } else {//22 Log.Error("Unable to select Reason dropdown value","Failed",300,FailAttr) createjson(jsonstr,i,"Unable to select Reason dropdown value..Please investigate","Fail",pathJSON,"Fail",testSteps) } btn_CS_Ok.Click() //To verify if the sample status is 'Phased out' or 'Rejected' if (GetStatusDescriptionOfSample(strFinalStatus)==true) {//22 Log.Message("Status of the sample is "+strFinalStatus,"Passed",300,Passattr) createjson(jsonstr,i++, "Status of sample is "+strFinalStatus,"Pass",pathJSON,"Pass",testSteps) } else { throw "Status of the sample is not "+strFinalStatus+"...Please investigate" } } else { throw "Status change button is not clicked" } Log.PopLogFolder() // //Navigating to Home Page if(HomeClick()==true) { Log.Message("Pass|Navigated to home page","Passed",300,Passattr) createjson(jsonstr,i++, "Homepage is navigated","Pass",pathJSON,"Pass",testSteps) } else { throw "Not able to click the Home button" } if(strVideo=="Yes") StopVideo_Merge_Srt() if(strFinalStatus == "Rejected") { //Compaing the values in XML file with that of database Log.AppendFolder("Compare Database values and XML file") var strXMLFile = "GERVMP.GERM0C.PC.V."+strSampleSCValue; Log.Message("XML file name should be :"+strXMLFile) if((strXMPFileNamePath = GetXMLFileName(strXMLFile,url))==false) { strXMPFileNamePath = GetXMLFileName(strXMLFile,url) if (strXMPFileNamePath == "") {//24 Log.Message("Xml file is not generated for sample = "+strSampleSCValue) createjson(jsonstr,i,"XML file is generated for sample = "+strSampleSCValue,"Pass",pathJSON,"Pass",testSteps) import_JSONXRayResults(strTestExecutionUrl,pathJSON) return } else { throw "XML file is generated" } } else { throw "To CMD folder path is found" } Log.PopLogFolder() } else if(strFinalStatus == "Phased out") { //Compaing the values in XML file with that of database Log.AppendFolder("Compare Database values and XML file") var strXMLFile = "GERVMP.GERM0C.PC.V."+strSampleSCValue; Log.Message(strXMLFile) if((strXMPFileNamePath = GetXMLFileName(strXMLFile,url))!=false) { strXMPFileNamePath = GetXMLFileName(strXMLFile,url) if (strXMPFileNamePath != "") { Log.Message("Xml file is generated for sample = "+strSampleSCValue) IndicatorDemo("Waiting for XML and Database Parameter and InfoCard values comparison",5000) var arrInfoCards = [] arrInfoCards = GetDataFromXMLFile(strXMPFileNamePath,"InfoCards",url) var arrDBInfoCards = [] sQryInfoCards = " SELECT DISTINCT Table2.II_SHORT_DESC,Table2.VALUE,Table2.IIVALUE from ( select SCIi.II_SHORT_DESC, IeAU.VALUE,SCIi.IIVALUE,IeAU.AUSEQ " + " from [DB_UniLab01D_SQL].[RndSuite].[RndtScIc] SCIC " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtSc] SC ON SC.SC=SCIC.SC " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtScIi] SCIi on SCIi.IC=SCIC.IC " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtIeAu] IeAU on SCIi.II=IeAU.IE " + " where SC.SC_VALUE= '"+ strSampleSCValue +"' and SCIi.SC=SC.SC and SCIi.IE_VERSION=IeAU.VERSION " + " and IeAU.VALUE='Yes' " + " group by II_SHORT_DESC,IeAU.VALUE,SCIi.IIVALUE,IeAU.AUSEQ) as Table1 " + " inner join (select SCIi.II_SHORT_DESC, IeAU.VALUE,SCIi.IIVALUE " + " from [DB_UniLab01D_SQL].[RndSuite].[RndtScIc] SCIC " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtSc] SC ON SC.SC=SCIC.SC " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtScIi] SCIi on SCIi.IC=SCIC.IC " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtIeAu] IeAU on SCIi.II=IeAU.IE " + " where SC.SC_VALUE= '"+ strSampleSCValue +"' and SCIi.SC=SC.SC and SCIi.IE_VERSION=IeAU.VERSION " + " and IeAU.AU in (13) ) as Table2 on Table1.II_SHORT_DESC=Table2.II_SHORT_DESC "; //To compare the Info cards of the Database and XML arrDBInfoCards = GetDataFromDatabase_Infocards(url,sQryInfoCards,"InfoCards") //CompareTwoArrays(arrInfoCards,arrDBInfoCards) if (CompareTwoArrays(arrInfoCards,arrDBInfoCards)==true) { Log.Message("Infocards are compared correctly","Passed",100,Passattr) createjson(jsonstr,i++,"Infocards are compared correctly from xml and database","Pass",pathJSON,"Pass",testSteps) } else { Log.Error("Info Cards are not compared correctly","Failed",100,FailAttr) createjson(jsonstr,i++,"Infocards are not compared correctly from xml and database..Please investigate","Fail",pathJSON,"Fail",testSteps) } var arrParameter = [] arrParameter = GetDataFromXMLFile(strXMPFileNamePath,"Parameter",url); var arrDBParameter = [] sQryParameter = "SELECT table2.VALUE, table2.PA_SHORT_DESC, table2.VALUE_S from (SELECT SCPAAU.VALUE, SCPA.PA_SHORT_DESC, SCPA.VALUE_S " + " FROM [DB_UniLab01D_SQL].[RndSuite].[RndtScPaAu] SCPAAU " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtScPa] SCPA on SCPA.PA=SCPAAU.PA " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtSc] SC on SC.SC = SCPA.SC " + " Where SC.SC_VALUE='"+ strSampleSCValue +"' and SCPAAU.AU in (9,13) " + " and SCPA.SC=SCPAAU.SC and SCPAAU.VALUE is not null and SCPAAU.VALUE='Yes') as table1 " + " inner join " + " ( "+ " SELECT SCPAAU.VALUE, SCPA.PA_SHORT_DESC, SCPA.VALUE_S "+ " FROM [DB_UniLab01D_SQL].[RndSuite].[RndtScPaAu] SCPAAU "+ " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtScPa] SCPA on SCPA.PA=SCPAAU.PA "+ " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtSc] SC on SC.SC = SCPA.SC "+ " Where SC.SC_VALUE='"+ strSampleSCValue + "' and SCPAAU.AU in (13) "+ " and SCPA.SC=SCPAAU.SC and SCPAAU.VALUE is not null "+ " ) as table2 on table1.PA_SHORT_DESC=table2.PA_SHORT_DESC ;"; arrDBParameter = GetDataFromDatabase_Parameters(url,sQryParameter,"Parameter") //Compare the Parameters in DB and XML if(CompareTwoArrays(arrParameter,arrDBParameter)==true) { Log.Message("Parameters are compared correctly","Passed",100,Passattr) createjson(jsonstr,i++, "Parameters are compared correctly from xml and database","Pass",pathJSON,"Pass",testSteps) import_JSONXRayResults(strTestExecutionUrl,pathJSON) } else { throw "Parameters are not compared correctly" } Log.PopLogFolder() } else { throw "XML file is not generated" } } else { throw "To CMD folder path is not found" } } Log.PopLogFolder() } catch(err) { Log.Error(err,"Failed",300,FailAttr) createjson(jsonstr,i,err,"Fail",pathJSON,"Fail",testSteps) import_JSONXRayResults(strTestExecutionUrl,pathJSON) return } } /********************************************************************************** Purpose: Create Sample for HRF_RF_EU19 sample and validate scenarios when "Chill verfification test passed? = N" Input: url,strSampleShortDescr,testkey,testexecutionkey,strScenario Returns: None **********************************************************************************/ function SC_CreateSample_HRF_RF_EU19_ChillVeri_N(url,strSampleShortDescr,testkey,testexecutionkey,strScenario) { strCurrentTask = "Create Measurement Order" strFileName = "HRF_EU19_data.xlsx" strInfoSheet = "HRF_RF_EU19_InfoCards" strResultsSheet = "HRF_RF_EU19_Parameters" strResultFileName = "RF_EU19_Results.xlsx" strAvailableStatus = " Submit" strStatusChangeReason = "Ready to use" strSubmitStatus = " Approved" strStatusChangeReasonSubmit = "Approved by lab manager" strLabWorker = "HRF_RF_LabWorker" strLabManager = "HRF_RF_Approver" testSteps=23; //Total number of teststeps in the test mentioned in first line strTestExecutionUrl="https://issuetracking.bsh-sdd.com/browse/"+testexecutionkey i=1 jsonstr = returnjson(testkey,testexecutionkey); //to get the value of the jsonStr pathJSON = Project.Path + "\JSONfiles\\"+testkey+".json" Log.Message(pathJSON); if (!aqFile.Exists(pathJSON)) { aqFile.Create(pathJSON) } else { aqFileSystem.DeleteFile(pathJSON) aqFile.Create(pathJSON) } //Start video and create .srt file if(strVideo == "Yes") StartVideo_CreateSrtFile(sPath) else Log.Message("Video and srt file is not required") try { //Launch Chrome CallLaunchChrome(url) //Change role to Lab Worker CallChangeRoleToLabWorker(strLabWorker) //To create the sample Log.AppendFolder("Create Sample for "+strScenario) CallClickCreateSample(strCurrentTask) //Filtering the Required Sample Type CallFilterSearch(strSampleShortDescr) Log.AppendFolder("Check if HRF_Regulation column exists") if(FindIfColumnExistsInGrid("HRF_Regulation")== true) { Log.Message("HRF_Regulation column exists","Passed",300,Passattr) if(RowSelectionSingleClick("HRF_Regulation","EU19 EnergyLabel")== true) { createjson(jsonstr,i++, "Pass|HRF_Regulation column exists","Pass",pathJSON,"Pass",testSteps) Log.Message("Value in HRF_Regulation = EU 2019 EnergyLabel","Passed",300,Passattr) } else { Log.Message("Fail|Value in HRF_Regulation != EU 2019 EnergyLabel","Failed",300,FailAttr) createjson(jsonstr,i++,"Fail|Value in HRF_Regulation != EU 2019 EnergyLabel","Failed",300,FailAttr) //Continue execution as this doesn't block the next steps } } else { Log.Message("HRF_Regulation column does not exist","Failed",300,FailAttr) createjson(jsonstr,i++,"Fail|HRF_Regulation column does not exist","Failed",300,FailAttr) //Continue execution as this doesn't block the next steps } Log.PopLogFolder() Log.AppendFolder("Check for the description of HRF_Regulation for this sample type") if(RowSelectionSingleClick("Description","EU19 Measurement Refrigeration")== true) { Log.Message("Sample description = EU19 Measurement Refrigeration","Passed",300,Passattr) createjson(jsonstr,i++, "Pass|Description of the sample - EU19 Measurement Refrigeration","Pass",pathJSON,"Pass",testSteps) } else { Log.Message("Sample description != EU19 Measurement Refrigeration","Failed",300,FailAttr) createjson(jsonstr,i++,"Fail|Sample description != EU19 Measurement Refrigeration","Failed",300,FailAttr) //Continue execution as this doesn't block the next steps } Log.PopLogFolder() // // //To create and Open the sample by using the <Create and Open> ActionBar button Log.AppendFolder("Create and Open Sample") if(RowSelectionSingleClick("ShortDescription",strSampleShortDescr)==true) { if(ClickDropdownIconInActionBarBasedOnName("CreateSampleCreate","Create and Open")==true) { ProgressBar() Log.Message("Clicked on Create and Open ActionBar button","Passed",300,Passattr) createjson(jsonstr,i++, "Clicked on Create and Open ActionBar button","Pass",pathJSON,"Pass",testSteps) WaitCheck("Status to Cancelled","Panel") Statustocan=GetActionBar().FindEx(Array("ObjectType","contentText"),Array("TextNode","Status to Cancelled"),10,true,100) WaitCheck("Filter","TextNode") ClickButton("Filter") //To get the created sample details strSampleSCValue = SampleIDOfNewSample() if(strSampleSCValue != "") { Log.Message("Retrieved the sample ID as "+strSampleSCValue,"Passed",300,Passattr) if (GetStatusDescriptionOfSample("Available") == true) { Log.Message("Status of the sample is Available","Passed",300,Passattr) } else { Log.Error("Status of the sample is not Available","Failed",300,FailAttr) } } else { Log.Error("Unable to retrieve the sample","Failed",300,FailAttr) } } else { throw "Failed to click on the Create and Open" } } else { throw "Sample is not shown "+strSampleShortDescr } Log.PopLogFolder() //To navigate to Open the Info cards through Side navigation Bar and enter the details Log.AppendFolder("Enter details in Info Cards") ClickCloseTabButton() if(NavigateToInfoCards() == true) { Log.Message("Info-cards Navigation Bar is selected","Passed",300,Passattr) createjson(jsonstr,i++, "Info-cards Navigation Bar is selected","Pass",pathJSON,"Pass",testSteps) TileSelection("Mandatory instructions for use") strMandatoryInstructions = Sys.Browser("chrome").FindChild("className","specInfoField infoFieldElement infoFieldCustom",25,true).contentText aqFile.WriteToTextFile(getExcelPath("HRF_RF_EU19_ManadtoryInstructionsForUseActual.txt"),strMandatoryInstructions,aqFile.ctUTF8,true) if(aqFile.Compare(getExcelPath("HRF_RF_EU19_ManadtoryInstructionsForUseActual.txt"),getExcelPath("HRF_RF_EU19_ManadtoryInstructionsForUseExpected.txt"))) { Log.Message("Mandatory instructions for use are correct","Info-card",300,Passattr) createjson(jsonstr,i++, "Fail|Mandatory instructions for use are correct","Pass",pathJSON,"Pass",testSteps) } else { Log.Error("Mandatory instructions for use are not correct","Info-card",300,FailAttr) createjson(jsonstr,i++, "Fail|Mandatory instructions for use are not correct...Please investigate","Fail",pathJSON,"Fail") } TabSwitch("Info Cards of Sample *") TileSelection("Additional Information") TabSwitch("Additional Information") strAdditionalInfo = Sys.Browser("chrome").FindChild("className","k-spreadsheet-fixed-container",26,true).contentText aqFile.WriteToTextFile(getExcelPath("HRF_RF_EU19_AdditionalInfoActual.txt"),strAdditionalInfo,aqFile.ctUTF8,true) if(aqFile.Compare(getExcelPath("HRF_RF_EU19_AdditionalInfoActual.txt"),getExcelPath("HRF_RF_EU19_AdditionalInfoExpected.txt"))) { Log.Message("Additional Information are correct","Info-card",300,Passattr) createjson(jsonstr,i++, "Fail|Additional Information are correct","Pass",pathJSON,"Pass",testSteps) } else { Log.Error("Additional Information are not correct","Info-card",300,FailAttr) createjson(jsonstr,i++, "Fail|Additional Information are not correct...Please investigate","Fail",pathJSON,"Fail") } TabSwitch("Info Cards of Sample *") if(strEquivalenceGroup = WriteIntoInfoCards_RF_EU19(strScenario,getExcelPath(strFileName),strInfoSheet,strSampleSCValue,url) != false) { createjson(jsonstr,i++, "Entered all values in info-card General","Pass",pathJSON,"Pass",testSteps) createjson(jsonstr,i++, "Entered all values in info-card Compartment Parameters","Pass",pathJSON,"Pass",testSteps) createjson(jsonstr,i++, "Entered all values in info-card Compartment Parameters after saving","Pass",pathJSON,"Pass",testSteps) createjson(jsonstr,i++, "Entered all values in info-card Test Verification","Pass",pathJSON,"Pass",testSteps) Log.Message("All details entered for the Info-cards","Info Cards",300,Passattr) } else { throw "All values in info-cards are not entered" } } else { throw "Info-cards Navigation Bar is not visible" } Log.PopLogFolder() //Check for the equivalence group in column Log.AppendFolder("Equivelance Group in display") if(RowSelectionSingleClick("EquivalenceGroup",strEquivalenceGroup)==true) { Log.Message("Equivalence Group is shown","Passed",300,Passattr) createjson(jsonstr,i++, "Pass|Equivalence Group is shown","Pass",pathJSON,"Pass",testSteps) if (GetStatusDescriptionOfSample("In Execution") ==true) { Log.Message("Status of the sample is In Execution","Passed",300,Passattr) } else { Log.Error("Status of the sample is not In Execution..Please investigate","Failed",300,FailAttr) } } else { Log.Error("Correct Equivalence Group is not shown","Failed",300,FailAttr) createjson(jsonstr,i++, "Correct Equivalence Group is not shown..Please investigate","Fail",pathJSON,"Fail") //As this step is not dependent on the next steps, execution is not stopped } Log.PopLogFolder() //To enter the details in the Results grid for different parameters Log.AppendFolder("Enter details in results") VerticalCommandBarMapping() if(btn_Results.Exists) { btn_Results.Click() Log.Message("Navigated to results tab","Passed",300,Passattr) createjson(jsonstr,i++, "Parameter profiles are navigated","Pass",pathJSON,"Pass",testSteps) WriteToValueColumn(strScenario,getExcelPath(strFileName),strResultsSheet) Log.Message("All details entered in results","Results",300,Passattr) createjson(jsonstr,i++, "Values in Volume Data is entered and saved","Pass",pathJSON,"Pass",testSteps) createjson(jsonstr,i++, "Values in Performance Data is entered and saved","Pass",pathJSON,"Pass",testSteps) createjson(jsonstr,i++, "Values in Acoustics Data is entered and saved","Pass",pathJSON,"Pass",testSteps) //Compare if all the entered parameter values and methods are correct VerticalCommandBarMapping() btn_Results.Click() ValidateParameterAndMethodsAfterSave(strScenario,getExcelPath(strFileName),strResultsSheet) } else { throw "Results Navigation Bar is not visible" } Log.PopLogFolder() ClickActionBarButton("Refresh") ProgressBar() //To change the Status of the Sample to "Submit" Log.AppendFolder("Status Change - 1") if (ClickActionBarButton("Status Change")==false && ClickActionBarButton("Status to Submit")==false) { Log.Message("<Status Change> is not shown","Passed",300,Passattr) createjson(jsonstr,i++,"<Status change> is not shown","Pass",pathJSON,"Pass",testSteps) } else { throw "<Status Change> is shown though 'Chill verification test passed? = N'" } Log.PopLogFolder() //To change the Status of the Sample to "Status to Cancelled" Log.AppendFolder("Status Change - 2") if (ClickActionBarButton("Status to Cancelled")==true) { Log.Message("<Status to Cancelled> is shown and clicked","Passed",300,Passattr) createjson(jsonstr,i++,"<Status to Cancelled> is shown and clicked","Pass",pathJSON,"Pass",testSteps) //To select the Status Reason ChangeStatusMapping() if(DropdownValueSelection(dd_CS_PredefinedReason,"No longer relevant")==true) { Log.Message("Reason dropdown value is selected","Passed",300,Passattr) } else { throw "Unable to select Reason dropdown value" } btn_CS_Ok.Click() Delay(2000, "Status is changed") } else { throw "<Status to Cancelled> is not shown" } Log.PopLogFolder() Log.PopLogFolder() import_JSONXRayResults(strTestExecutionUrl,pathJSON) } catch(err) { Log.Error(err,"Failed",300,FailAttr) createjson(jsonstr,i,err,"Fail",pathJSON,"Fail",testSteps) import_JSONXRayResults(strTestExecutionUrl,pathJSON) return } } function HRF_RF_EU19_ChillVeri_N(url,strSampleShortDescr,testkey,testexecutionkey) { c = Sys.Process("WerFault").Dialog("Internet Explorer") if(c.Exists) Sys.Process("WerFault").Dialog("Internet Explorer").Window("DirectUIHWND", "", 1).Window("CtrlNotifySink", "", 7).Window("Button", "Close the program", 1).Click() var Excel; var strFromExcel; var strExcelParameter; var strExcelParamValue; Excel = Sys.OleObject("Excel.Application"); Excel.Visible = false; a = Excel.Workbooks.Open(getExcelPath("HRF_RF_EU19\\HRF_RF_EU19_ChillVeri_N_DDT_All.xlsx")) var sheet = Excel.Sheets.Item("Sheet1") sheet.activate(); let RowCount = sheet.UsedRange.Rows.Count for(j=2;j<=RowCount;j++) { strScenario = VarToString(sheet.Cells.Item(j, 1)) Log.AppendFolder(strScenario) SC_CreateSample_HRF_RF_EU19_ChillVeri_N(url,strSampleShortDescr,testkey,testexecutionkey,strScenario) Log.PopLogFolder() } } /********************************************************************************** Purpose: Create Sample for HRF_RF_EU19 sample (positive scenarios) Input: url,strSampleShortDescr,testkey,testexecutionkey,strScenario Returns: None **********************************************************************************/ function SC_CreateSample_HRF_RF_EU19(url,strSampleShortDescr,testkey,testexecutionkey,strScenario) { strCurrentTask = "Create Measurement Order" strFileName = "HRF_EU19_data.xlsx" strInfoSheet = "HRF_RF_EU19_InfoCards" strResultsSheet = "HRF_RF_EU19_Parameters" strResultFileName = "RF_EU19_Results.xlsx" strAvailableStatus = " Submit" strStatusChangeReason = "Ready to use" strSubmitStatus = " Approved" strStatusChangeReasonSubmit = "Approved by lab manager" strLabWorker = "HRF_RF_LabWorker" strLabManager = "HRF_RF_Approver" i=1 testSteps=36; //Total number of teststeps in the test mentioned in first line strTestExecutionUrl="https://issuetracking.bsh-sdd.com/browse/"+testexecutionkey jsonstr = returnjson(testkey,testexecutionkey); //to get the value of the jsonStr pathJSON = Project.Path + "\JSONfiles\\"+testkey+".json" Log.Message(pathJSON); if (!aqFile.Exists(pathJSON)) { aqFile.Create(pathJSON) } else { aqFileSystem.DeleteFile(pathJSON) aqFile.Create(pathJSON) } //Start video and create .srt file if(strVideo == "Yes") StartVideo_CreateSrtFile(sPath) else Log.Message("Video and srt file is not required") try { //Launch Chrome CallLaunchChrome(url) //Change role to Lab Worker CallChangeRoleToLabWorker(strLabWorker) //To create the sample Log.AppendFolder("Create Sample for "+strScenario) CallClickCreateSample(strCurrentTask) //Filtering the Required Sample Type CallFilterSearch(strSampleShortDescr) Log.AppendFolder("Check if HRF_Regulation column exists") if(FindIfColumnExistsInGrid("HRF_Regulation")== true) { Log.Message("HRF_Regulation column exists","Passed",300,Passattr) if(RowSelectionSingleClick("HRF_Regulation","EU 2019 EnergyLabel")== true) { createjson(jsonstr,i++, "Pass|HRF_Regulation column exists","Pass",pathJSON,"Pass",testSteps) Log.Message("Value in HRF_Regulation = EU 2019 EnergyLabel","Passed",300,Passattr) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,8,"Pass") } else { Log.Message("Fail|Value in HRF_Regulation != EU 2019 EnergyLabel","Failed",300,FailAttr) createjson(jsonstr,i++,"Fail|Value in HRF_Regulation != EU 2019 EnergyLabel","Fail",pathJSON,"Fail",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,8,"Fail") //Continue execution as this doesn't block the next steps } } else { Log.Message("HRF_Regulation column does not exist","Failed",300,FailAttr) createjson(jsonstr,i++,"Fail|HRF_Regulation column does not exist","Fail",pathJSON,"Fail",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,8,"Fail") //Continue execution as this doesn't block the next steps } Log.PopLogFolder() Log.AppendFolder("Check for the description of HRF_Regulation for this sample type") if(RowSelectionSingleClick("Description","EU19 Measurement Refrigeration")== true) { Log.Message("Sample description = EU19 Measurement Refrigeration","Passed",300,Passattr) createjson(jsonstr,i++, "Pass|Description of the sample - EU19 Measurement Refrigeration","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,9,"Pass") } else { Log.Message("Sample description != EU19 Measurement Refrigeration","Failed",300,FailAttr) createjson(jsonstr,i++,"Fail|Sample description != EU19 Measurement Refrigeration","Fail",pathJSON,"Fail",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,9,"Fail") //Continue execution as this doesn't block the next steps } Log.PopLogFolder() //To create and Open the sample by using the <Create and Open> ActionBar button Log.AppendFolder("Create and Open Sample") if(RowSelectionSingleClick("ShortDescription",strSampleShortDescr)==true) { dropdowntoselect=GetActionBar().FindEx(Array("ObjectType","className","Visible"),Array("Panel","icon-arrow-down",true),7,true,100) if(ClickDropdownIconInActionBarBasedOnName("CreateSampleCreate","Create and Open")==true) { ProgressBar() Log.Message("Clicked on Create and Open ActionBar button","Passed",300,Passattr) createjson(jsonstr,i++, "Clicked on Create and Open ActionBar button","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,10,"Pass") WaitCheck("Status to Cancelled","Panel") Statustocan=GetActionBar().FindEx(Array("ObjectType","contentText"),Array("TextNode","Status to Cancelled"),10,true,100) WaitCheck("Filter","TextNode") ClickButton("Filter") //To get the created sample details strSampleSCValue = SampleIDOfNewSample() if(strSampleSCValue != "") { Log.Message("Retrieved the sample ID as "+strSampleSCValue,"Passed",300,Passattr) if (GetStatusDescriptionOfSample("Available") == true) { Log.Message("Status of the sample is Available","Passed",300,Passattr) } else { Log.Error("Status of the sample is not Available","Failed",300,FailAttr) } } else { Log.Error("Unable to retrieve the sample","Failed",300,FailAttr) } } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,10,"Fail") } } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,10,"Fail") throw "Sample is not shown "+strSampleShortDescr } Log.PopLogFolder() //To navigate to Open the Info cards through Side navigation Bar and enter the details Log.AppendFolder("Enter details in Info Cards") ClickCloseTabButton() VerticalCommandBarMapping() if(btn_InfoCards.Exists) { btn_InfoCards.Click() DragInfoCardOrParameterScreen() Log.Message("Info-cards Navigation Bar is selected","Passed",300,Passattr) createjson(jsonstr,i++, "Info-cards Navigation Bar is selected","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,11,"Pass") TileSelection("Mandatory instructions for use") strMandatoryInstructions = Sys.Browser("chrome").FindChild("className","specInfoField infoFieldElement infoFieldCustom",25,true).contentText aqFile.WriteToTextFile(getExcelPath("HRF_RF_EU19_ManadtoryInstructionsForUseActual.txt"),strMandatoryInstructions,aqFile.ctUTF8,true) if(aqFile.Compare(getExcelPath("HRF_RF_EU19_ManadtoryInstructionsForUseActual.txt"),getExcelPath("HRF_RF_EU19_ManadtoryInstructionsForUseExpected.txt"))) { Log.Message("Mandatory instructions for use are correct","Info-card",300,Passattr) createjson(jsonstr,i++, "Fail|Mandatory instructions for use are correct","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,12,"Pass") } else { Log.Error("Mandatory instructions for use are not correct","Info-card",300,FailAttr) createjson(jsonstr,i++, "Fail|Mandatory instructions for use are not correct...Please investigate","Fail",pathJSON,"Fail",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,12,"Fail") } TabSwitch("Info Cards of Sample *") TileSelection("Additional Information") TabSwitch("*Additional Information*") strAdditionalInfo = Sys.Browser("chrome").FindChild("className","k-spreadsheet-fixed-container",26,true).contentText aqFile.WriteToTextFile(getExcelPath("HRF_RF_EU19_AdditionalInfoActual.txt"),strAdditionalInfo,aqFile.ctUTF8,true) if(aqFile.Compare(getExcelPath("HRF_RF_EU19_AdditionalInfoActual.txt"),getExcelPath("HRF_RF_EU19_AdditionalInfoExpected.txt"))) { Log.Message("Additional Information are correct","Info-card",300,Passattr) createjson(jsonstr,i++, "Additional Information are correct","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,13,"Pass") } else { Log.Error("Additional Information are not correct","Info-card",300,FailAttr) createjson(jsonstr,i++, "Fail|Additional Information are not correct...Please investigate","Fail",pathJSON,"Fail",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,13,"Fail") } TabSwitch("Info Cards of Sample *") if((strEquivalenceGroup = WriteIntoInfoCards_RF_EU19(strScenario,getExcelPath(strFileName),strInfoSheet,strSampleSCValue,url)) != false) { createjson(jsonstr,i++, "Entered all values in info-card General","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,14,"Pass") createjson(jsonstr,i++, "Entered all values in info-card Compartment Parameters","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,15,"Pass") createjson(jsonstr,i++, "Entered all values in info-card Compartment Parameters after saving","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,16,"Pass") createjson(jsonstr,i++, "Entered all values in info-card Test Verification","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,17,"Pass") createjson(jsonstr,i++, "Entered values in info-card Approval Information","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,17,"Pass") Log.Message("All details entered for the Info-cards","Info Cards",300,Passattr) } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,14,"Fail") throw "All values in info-cards are not entered" } } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,11,"Pass") throw "Info-cards Navigation Bar is not visible" } Log.PopLogFolder() //Check for the equivalence group in column Log.AppendFolder("Equivelance Group in display") if(RowSelectionSingleClick("EquivalenceGroup",strEquivalenceGroup)==true) { Log.Message("Equivalence Group is shown","Passed",300,Passattr) createjson(jsonstr,i++, "Pass|Equivalence Group is shown","Pass",pathJSON,"Pass",testSteps) // WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,18,"Pass") if (GetStatusDescriptionOfSample("In Execution") ==true) { Log.Message("Status of the sample is In Execution","Passed",300,Passattr) } else { Log.Error("Status of the sample is not In Execution..Please investigate","Failed",300,FailAttr) } } else { Log.Error("Correct Equivalence Group is not shown","Failed",300,FailAttr) createjson(jsonstr,i++, "Fail|Correct Equivalence Group is not shown..Please investigate","Fail",pathJSON,"Fail",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,18,"Fail") //As this step is not dependent on the next steps, execution is not stopped } Log.PopLogFolder() //To enter the details in the Results grid for different parameters Log.AppendFolder("Enter details in results") VerticalCommandBarMapping() if(btn_Results.Exists) { btn_Results.Click() Log.Message("Navigated to results tab","Passed",300,Passattr) createjson(jsonstr,i++, "Parameter profiles are navigated","Pass",pathJSON,"Pass",testSteps) // WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,19,"Pass") WriteToValueColumn(strScenario,getExcelPath(strFileName),strResultsSheet) Log.Message("All details entered in results","Results",300,Passattr) createjson(jsonstr,i++, "Values in Volume Data is entered and saved","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,20,"Pass") createjson(jsonstr,i++, "Values in Performance Data is entered and saved","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,21,"Pass") createjson(jsonstr,i++, "Values in Acoustics Data, Overall Dimensions is entered and saved","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,22,"Pass") //Compare if all the entered parameter values and methods are correct VerticalCommandBarMapping() btn_Results.Click() ValidateParameterAndMethodsAfterSave(strScenario,getExcelPath(strFileName),strResultsSheet) } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,19,"Fail") throw "Results Navigation Bar is not visible" } Log.PopLogFolder() //This is a defect and need to be fixed ClickActionBarButton("Refresh") ProgressBar() //To change the Status of the Sample to "Submit" Log.AppendFolder("Status Change - 1") if (ClickActionBarButton("Status Change")==true) { Log.Message("Clicked on Status Change button","Passed",300,Passattr) ChangeStatusMapping() //To select the required Status if(DropdownValueSelection(dd_CS_Status,strAvailableStatus)==true) { Log.Message("Available dropdown value is selected","Passed",300,Passattr) } else { Log.Error("Unable to select Available dropdown value","Failed",300,FailAttr) createjson(jsonstr,i++, "Unable to select Available dropdown value..Please investigate","Fail",pathJSON,"Fail",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,24,"Fail") } //To select the Status Reason if(DropdownValueSelection(dd_CS_PredefinedReason,strStatusChangeReason)==true) { Log.Message("Reason dropdown value is selected","Passed",300,Passattr) } else { Log.Error("Unable to select Reason dropdown value","Failed",300,FailAttr) } btn_CS_Ok.Click() ProgressBar() //To check the Status Description if (GetStatusDescriptionOfSample("Submit")==true) { Log.Message("Status of the sample is Submit","Passed",300,Passattr) createjson(jsonstr,i++, "Submit status is changed for the sample","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,24,"Pass") } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,24,"Fail") throw "Status of the sample is not Submit" } } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,24,"Fail") throw "Failed to change the status to Submit" } Log.PopLogFolder() ////////////////////////////////////////// Check manually for email createjson(jsonstr,i++, "Check mail manually","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,25,"Pass") //Change Role to Lab Manager to approve the sample Log.AppendFolder("Change Role to Lab Manager") if(ChangeRole(strLabManager)==true) { Log.Message("Role is successfully changed to HRF_Lab Manager","Change Role",300,Passattr) createjson(jsonstr,i++,"Role is successfully changed to HRF_Lab Manager","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,26,"Pass") WaitCheck("Opcenter Research, Development and Laboratory","Panel") if(ClickMainButton("OPEN SAMPLE")==true) { ProgressBar() CreateSampleWizardFilterCriteriaMapping() DropdownValueSelection(dd_SC_CurrentTask,"Open Measurement Order") btn_SC_Apply.Click() ProgressBar() Log.Message("Navigated to Open Sample Wizard screen","Passed",300,Passattr) FindFilterInColumn("ShortDescription") ColumnFilterMapping() EnterValueInFilterSearch(strSampleSCValue) btn_Fil_Filter.Click() ProgressBar() if(RowSelectionSingleClick("ShortDescription",strSampleSCValue)==true) { Log.Message("Sample is selected","Passed",300,Passattr) createjson(jsonstr,i++, "Navigated to Open Sample screen and Sample is selected","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,27,"Pass") } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,27,"Fail") throw "Failed to select sample" } } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,27,"Fail") throw "Failed to navigate to Open Sample screen" } } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,27,"Fail") throw "Failed to change the role to Lab Manager" } Log.PopLogFolder() //To change the status to "Approved" Status Log.AppendFolder("Status Change - 2") if(ClickActionBarButton("Status Change")==true) { Log.Message("Clicked on Status Change button","Passed",300,Passattr) ChangeStatusMapping() //To select the required Status if(DropdownValueSelection(dd_CS_Status,strSubmitStatus)==true) { Log.Message("Available dropdown value is selected","Passed",300,Passattr) } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,28,"Fail") throw "Unable to select Available dropdown value" } //To select the Status Reason if(DropdownValueSelection(dd_CS_PredefinedReason,strStatusChangeReasonSubmit)==true) { Log.Message("Reason dropdown value is selected","Passed",300,Passattr) } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,28,"Fail") throw "Unable to select Reason dropdown value" } btn_CS_Ok.Click() ProgressBar() Delay(2000, "Waiting for fetching sample status") //To verify if the sample status is Approved if (GetStatusDescriptionOfSample("Approved")==true) { Log.Message("Status of the sample is Approved","Passed",300,Passattr) createjson(jsonstr,i++, "Approved status is changed for the sample","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,28,"Pass") } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,28,"Fail") throw "Status of the sample is not Approved" } } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,28,"Fail") throw "Status change button is not clicked" } Log.PopLogFolder() //////////////////////Add validations for 32 - 36 (also in step 38 -> Cancel parameter validation to be added Log.AppendFolder("Check Data Sync status") Delay(1000,"Check for data sync status") btnArrowButton = Sys.Browser("chrome").FindChild(Array("className","hidden"),Array("arrow right button right-button button-3d",false),10,true) btnArrowButton.Click() Delay(1000,"Check for data sync status") if(ClickActionBarButton("Check Data Sync Status")==true) { //////////////////////////////Expected result validation to be done manually Log.Message("<Check Data Sync Status> is clicked","Passed",300,Passattr) createjson(jsonstr,i++, "Pass|<Check Data Sync Status> is clicked","Pass",pathJSON,"Pass",testSteps) do { Delay(100) popupSAPData = Sys.Browser("chrome").Page("*").FindChild("contentText","SAP Data synchronizing....",4,true) }while(!popupSAPData.Exists) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,29,"Pass") } else { Log.Error("<Check Data Sync Status> is not clicked...Please investigate","Failed",300,FailAttr) createjson(jsonstr,i++, "Fail|<Check Data Sync Status> is not clicked..Please investigate","Fail",pathJSON,"Fail",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,29,"Fail") //Since this is not a blocker, script execution can be continued } Log.PopLogFolder() Log.AppendFolder("Data to be exported - Report") strURL = Geturl() if(ClickDropdownIconInActionBarBasedOnName("Report4","Data to be Exported")==true) { //////////////////////////////Expected result validation to be done manually Log.Message("<Data to be Exported> is clicked","Passed",300,Passattr) createjson(jsonstr,i++, "Pass|<Data to be Exported> is clicked","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,30,"Pass") createjson(jsonstr,i++, "Check manually for exported data","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,31,"Pass") Sys.Browser("chrome").Page(strURL).Click() } else { Log.Error("<Data to be Exported> is not clicked...Please investigate","Failed",300,FailAttr) createjson(jsonstr,i++, "Fail|<Data to be Exported> is not clicked..Please investigate","Fail",pathJSON,"Fail",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,30,"Fail") //Since this is not a blocker, script execution can be continued } Log.PopLogFolder() Log.AppendFolder("Test report EN-62552-2020 - Report") strURL = Geturl() if(ClickDropdownIconInActionBarBasedOnName("Report4","Report EN-62552-2020")==true) { //////////////////////////////Expected result validation to be done manually Log.Message("<Report EN-62552-2020> is clicked","Passed",300,Passattr) createjson(jsonstr,i++, "Pass|<Report EN-62552-2020> is clicked","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,32,"Pass") createjson(jsonstr,i++, "Check manually for exported data","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,33,"Pass") Sys.Browser("chrome").Page(strURL).Click() } else { Log.Error("<Report EN-62552-2020> is not clicked...Please investigate","Failed",300,FailAttr) createjson(jsonstr,i++, "Fail|<Report EN-62552-2020> is not clicked..Please investigate","Fail",pathJSON,"Fail",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,31,"Fail") //Since this is not a blocker, script execution can be continued } Log.PopLogFolder() //To change the status to "Phased out" Status Log.AppendFolder("Status Change - 3") if(ClickActionBarButton("Status Change")==true) { Log.Message("Clicked on Status Change button","Passed",300,Passattr) ChangeStatusMapping() //To select the required Status if(DropdownValueSelection(dd_CS_Status," Phased out")==true) { Log.Message("Available dropdown value is selected","Passed",300,Passattr) } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,34,"Fail") throw "Unable to select Available dropdown value" } //To select the Status Reason if(DropdownValueSelection(dd_CS_PredefinedReason,strStatusChangeReasonSubmit)==true) { Log.Message("Reason dropdown value is selected","Passed",300,Passattr) } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,34,"Fail") throw "Unable to select Reason dropdown value" } btn_CS_Ok.Click() ProgressBar() Delay(2000, "Waiting for fetching sample status") //To verify if the sample status is Phased out if (GetStatusDescriptionOfSample("Phased out")==true) { Log.Message("Status of the sample is Phased out","Passed",300,Passattr) createjson(jsonstr,i++, "Phased out status is changed for the sample","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,34,"Pass") } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,34,"Fail") throw "Status of the sample is not Phased out" } } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,34,"Fail") throw "Status change button is not clicked" } Log.PopLogFolder() //Navigating to Home Page if(HomeClick()==true) { Log.Message("Pass|Navigated to home page","Passed",300,Passattr) createjson(jsonstr,i++, "Homepage is navigated","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,35,"Pass") } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,35,"Fail") throw "Not able to click the Home button" } if(strVideo=="Yes") StopVideo_Merge_Srt() //Compaing the values in XML file with that of database Log.AppendFolder("Compare Database values and XML file") var strXMLFile = "GERVMP.GERM0C.PC.V."+strSampleSCValue; Log.Message(strXMLFile) if((strXMPFileNamePath = GetXMLFileName(strXMLFile,url))!=false) { strXMPFileNamePath = GetXMLFileName(strXMLFile,url) if (strXMPFileNamePath != "") { Log.Message("Xml file is generated for sample = "+strSampleSCValue) IndicatorDemo("Waiting for XML and Database Parameter and InfoCard values comparison",5000) var arrParameter = [] arrParameter = GetDataFromXMLFile(strXMPFileNamePath,"Parameter",url); var arrDBParameter = [] sQryParameter = "SELECT table2.VALUE, table2.PA_SHORT_DESC, table2.VALUE_S from (SELECT SCPAAU.VALUE, SCPA.PA_SHORT_DESC, SCPA.VALUE_S " + " FROM [DB_UniLab01D_SQL].[RndSuite].[RndtScPaAu] SCPAAU " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtScPa] SCPA on SCPA.PA=SCPAAU.PA " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtSc] SC on SC.SC = SCPA.SC " + " Where SC.SC_VALUE='"+ strSampleSCValue +"' and SCPAAU.AU in (9,13) " + " and SCPA.SC=SCPAAU.SC and SCPAAU.VALUE is not null and SCPAAU.VALUE='Yes') as table1 " + " inner join " + " ( "+ " SELECT SCPAAU.VALUE, SCPA.PA_SHORT_DESC, SCPA.VALUE_S "+ " FROM [DB_UniLab01D_SQL].[RndSuite].[RndtScPaAu] SCPAAU "+ " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtScPa] SCPA on SCPA.PA=SCPAAU.PA "+ " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtSc] SC on SC.SC = SCPA.SC "+ " Where SC.SC_VALUE='"+ strSampleSCValue + "' and SCPAAU.AU in (13) "+ " and SCPA.SC=SCPAAU.SC and SCPAAU.VALUE is not null "+ " ) as table2 on table1.PA_SHORT_DESC=table2.PA_SHORT_DESC ;"; arrDBParameter = GetDataFromDatabase_Parameters(url,sQryParameter,"Parameter") //Compare the Parameters in DB and XML if(CompareTwoArrays(arrParameter,arrDBParameter)==true) { Log.Message("Parameters are compared correctly","Passed",100,Passattr) createjson(jsonstr,i++, "Parameters are compared correctly from xml and database","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,36,"Pass") } else { Log.Error("Parameters are not compared correctly","Failed",100,FailAttr) createjson(jsonstr,i++, "Parameters are not compared correctly from xml and database..Please investigate","Fail",pathJSON,"Fail",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,36,"Fail") } var arrInfoCards = [] arrInfoCards = GetDataFromXMLFile(strXMPFileNamePath,"InfoCards",url) var arrDBInfoCards = [] sQryInfoCards = " SELECT DISTINCT Table2.II_SHORT_DESC,Table2.VALUE,Table2.IIVALUE from ( select SCIi.II_SHORT_DESC, IeAU.VALUE,SCIi.IIVALUE,IeAU.AUSEQ " + " from [DB_UniLab01D_SQL].[RndSuite].[RndtScIc] SCIC " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtSc] SC ON SC.SC=SCIC.SC " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtScIi] SCIi on SCIi.IC=SCIC.IC " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtIeAu] IeAU on SCIi.II=IeAU.IE " + " where SC.SC_VALUE= '"+ strSampleSCValue +"' and SCIi.SC=SC.SC and SCIi.IE_VERSION=IeAU.VERSION " + " and IeAU.VALUE='Yes' " + " group by II_SHORT_DESC,IeAU.VALUE,SCIi.IIVALUE,IeAU.AUSEQ) as Table1 " + " inner join (select SCIi.II_SHORT_DESC, IeAU.VALUE,SCIi.IIVALUE " + " from [DB_UniLab01D_SQL].[RndSuite].[RndtScIc] SCIC " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtSc] SC ON SC.SC=SCIC.SC " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtScIi] SCIi on SCIi.IC=SCIC.IC " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtIeAu] IeAU on SCIi.II=IeAU.IE " + " where SC.SC_VALUE= '"+ strSampleSCValue +"' and SCIi.SC=SC.SC and SCIi.IE_VERSION=IeAU.VERSION " + " and IeAU.AU in (13) ) as Table2 on Table1.II_SHORT_DESC=Table2.II_SHORT_DESC "; //To compare the Info cards of the Database and XML arrDBInfoCards = GetDataFromDatabase_Infocards(url,sQryInfoCards,"InfoCards") //CompareTwoArrays(arrInfoCards,arrDBInfoCards) if (CompareTwoArrays(arrInfoCards,arrDBInfoCards)==true) { Log.Message("Infocards are compared correctly","Passed",100,Passattr) createjson(jsonstr,i++,"Infocards are compared correctly from xml and database","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,37,"Pass") } else { Log.Error("Info Cards are not compared correctly","Failed",100,FailAttr) createjson(jsonstr,i++,"Infocards are not compared correctly from xml and database..Please investigate","Fail",pathJSON,"Fail",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,37,"Fail") } } else { Log.Error("XML file is not generated","Failed",300,FailAttr) createjson(jsonstr,i++,"Fail|XML file is not generated for sample = "+strSampleSCValue,"Fail",pathJSON,"Fail",testSteps) import_JSONXRayResults(strTestExecutionUrl) return } } else { Log.Error("To CMD folder path is not found","Failed",300,FailAttr) createjson(jsonstr,i++,"Fail|To CMD folder path is not found","Fail",pathJSON,"Fail",testSteps) import_JSONXRayResults(strTestExecutionUrl) return } Log.PopLogFolder() Log.PopLogFolder() import_JSONXRayResults(strTestExecutionUrl) } catch(err) { Log.Error(err,"Failed",300,FailAttr) createjson(jsonstr,i,err,"Fail",pathJSON,"Fail",testSteps) import_JSONXRayResults(strTestExecutionUrl,pathJSON) return } } function HRF_RF_EU19(url,strSampleShortDescr,testkey,testexecutionkey) { var Excel; var strFromExcel; var strExcelParameter; var strExcelParamValue; Excel = Sys.OleObject("Excel.Application"); Excel.Visible = false; a = Excel.Workbooks.Open(getExcelPath("HRF_RF_EU19\\HRF_RF_EU19_DDT_All.xlsx")) var sheet = Excel.Sheets.Item("Sheet1") sheet.activate(); let RowCount = sheet.UsedRange.Rows.Count for(k=2;k<=RowCount;k++) { Log.AppendFolder(VarToString(sheet.Cells.Item(k, 1))) SC_CreateSample_HRF_RF_EU19(url,strSampleShortDescr,testkey,testexecutionkey, VarToString(sheet.Cells.Item(k, 1))) Log.PopLogFolder() Log.PopLogFolder() } } /********************************************************************************** Purpose: Create Sample for HRF_RF_EU19_mod sample (positive scenarios) Input: url,strInfoYesOrNo,testkey,testexecutionkey,strScenario Returns: None **********************************************************************************/ function SC_CreateSample_HRF_RF_EU19_mod(url,strSampleShortDescr,testkey,testexecutionkey,strScenario) { strCurrentTask = "Create Measurement Order" strFileName = "HRF_EU19_data.xlsx" strInfoSheet = "HRF_RF_EU19_InfoCards" strResultsSheet = "HRF_RF_EU19_Parameters" strInfoSheetMod = "HRF_RF_EU19_mod_InfoCards" strResultsSheetMod = "HRF_RF_EU19_mod_Parameters" strAvailableStatus = " Submit" strStatusChangeReason = "Ready to use" strSubmitStatus = " Approved" strStatusChangeReasonSubmit = "Approved by lab manager" strLabWorker = "HRF_RF_LabWorker" strLabManager = "HRF_RF_Approver" strResultFileName = "RF_EU19_Results.xlsx" testSteps=33; //Total number of teststeps in the test mentioned in first line strTestExecutionUrl="https://issuetracking.bsh-sdd.com/browse/"+testexecutionkey i=1 jsonstr = returnjson(testkey,testexecutionkey); //to get the value of the jsonStr pathJSON = Project.Path + "\JSONfiles\\"+testkey+".json" Log.Message(pathJSON); if (!aqFile.Exists(pathJSON)) { aqFile.Create(pathJSON) } else { aqFileSystem.DeleteFile(pathJSON) aqFile.Create(pathJSON) } try { //Launch Chrome CallLaunchChrome(url) //Change role to Lab Worker CallChangeRoleToLabWorker(strLabWorker) //To create the sample Log.AppendFolder("Create Sample for "+strScenario) CallClickCreateSample(strCurrentTask) //Filtering the Required Sample Type CallFilterSearch(strSampleShortDescr) Log.AppendFolder("Check if HRF_Regulation column exists") if(FindIfColumnExistsInGrid("HRF_Regulation")== true) { Log.Message("HRF_Regulation column exists","Passed",300,Passattr) if(RowSelectionSingleClick("HRF_Regulation","EU 2019 EnergyLabel")== true) { createjson(jsonstr,i++, "Pass|HRF_Regulation column exists","Pass",pathJSON,"Pass",testSteps) Log.Message("Value in HRF_Regulation = EU 2019 EnergyLabel","Passed",300,Passattr) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,8,"Pass") } else { Log.Message("Fail|Value in HRF_Regulation != EU 2019 EnergyLabel","Failed",300,FailAttr) createjson(jsonstr,i++,"Fail|Value in HRF_Regulation != EU 2019 EnergyLabel","Fail",pathJSON,"Fail",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,8,"Fail") //Continue execution as this doesn't block the next steps } } else { Log.Message("HRF_Regulation column does not exist","Failed",300,FailAttr) createjson(jsonstr,i++,"Fail|HRF_Regulation column does not exist","Fail",pathJSON,"Fail",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,8,"Fail") //Continue execution as this doesn't block the next steps } Log.PopLogFolder() Log.AppendFolder("Check for the description of HRF_Regulation for this sample type") if(RowSelectionSingleClick("Description","EU19 Measurement Refrigeration")== true) { Log.Message("Sample description = EU19 Measurement Refrigeration","Passed",300,Passattr) createjson(jsonstr,i++, "Pass|Description of the sample - EU19 Measurement Refrigeration","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,9,"Pass") } else { Log.Message("Sample description != EU19 Measurement Refrigeration","Failed",300,FailAttr) createjson(jsonstr,i++,"Fail|Sample description != EU19 Measurement Refrigeration","Fail",pathJSON,"Fail",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,9,"Fail") //Continue execution as this doesn't block the next steps } Log.PopLogFolder() //To create and Open the sample by using the <Create and Open> ActionBar button Log.AppendFolder("Create and Open Sample") if(RowSelectionSingleClick("ShortDescription",strSampleShortDescr)==true) { dropdowntoselect=GetActionBar().FindEx(Array("ObjectType","className","Visible"),Array("Panel","icon-arrow-down",true),7,true,100) if(ClickDropdownIconInActionBarBasedOnName("CreateSampleCreate","Create and Open")==true) { ProgressBar() Log.Message("Clicked on Create and Open ActionBar button","Passed",300,Passattr) createjson(jsonstr,i++, "Clicked on Create and Open ActionBar button","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,10,"Pass") WaitCheck("Status to Cancelled","Panel") Statustocan=GetActionBar().FindEx(Array("ObjectType","contentText"),Array("TextNode","Status to Cancelled"),10,true,100) WaitCheck("Filter","TextNode") ClickButton("Filter") //To get the created sample details strSampleSCValue = SampleIDOfNewSample() if(strSampleSCValue != "") { Log.Message("Retrieved the sample ID as "+strSampleSCValue,"Passed",300,Passattr) if (GetStatusDescriptionOfSample("Available") == true) { Log.Message("Status of the sample is Available","Passed",300,Passattr) } else { Log.Error("Status of the sample is not Available","Failed",300,FailAttr) } } else { Log.Error("Unable to retrieve the sample","Failed",300,FailAttr) } } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,10,"Fail") } } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,10,"Fail") throw "Sample is not shown "+strSampleShortDescr } Log.PopLogFolder() //To navigate to Open the Info cards through Side navigation Bar and enter the details Log.AppendFolder("Enter details in Info Cards") ClickCloseTabButton() VerticalCommandBarMapping() if(btn_InfoCards.Exists) { btn_InfoCards.Click() DragInfoCardOrParameterScreen() Log.Message("Info-cards Navigation Bar is selected","Passed",300,Passattr) createjson(jsonstr,i++, "Info-cards Navigation Bar is selected","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,11,"Pass") TileSelection("Mandatory instructions for use") strMandatoryInstructions = Sys.Browser("chrome").FindChild("className","specInfoField infoFieldElement infoFieldCustom",25,true).contentText aqFile.WriteToTextFile(getExcelPath("HRF_RF_EU19_ManadtoryInstructionsForUseActual.txt"),strMandatoryInstructions,aqFile.ctUTF8,true) if(aqFile.Compare(getExcelPath("HRF_RF_EU19_ManadtoryInstructionsForUseActual.txt"),getExcelPath("HRF_RF_EU19_ManadtoryInstructionsForUseExpected.txt"))) { Log.Message("Mandatory instructions for use are correct","Info-card",300,Passattr) createjson(jsonstr,i++, "Fail|Mandatory instructions for use are correct","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,12,"Pass") } else { Log.Error("Mandatory instructions for use are not correct","Info-card",300,FailAttr) createjson(jsonstr,i++, "Fail|Mandatory instructions for use are not correct...Please investigate","Fail",pathJSON,"Fail",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,12,"Fail") } TabSwitch("Info Cards of Sample *") TileSelection("Additional Information") TabSwitch("*Additional Information*") strAdditionalInfo = Sys.Browser("chrome").FindChild("className","k-spreadsheet-fixed-container",26,true).contentText aqFile.WriteToTextFile(getExcelPath("HRF_RF_EU19_AdditionalInfoActual.txt"),strAdditionalInfo,aqFile.ctUTF8,true) if(aqFile.Compare(getExcelPath("HRF_RF_EU19_AdditionalInfoActual.txt"),getExcelPath("HRF_RF_EU19_AdditionalInfoExpected.txt"))) { Log.Message("Additional Information are correct","Info-card",300,Passattr) createjson(jsonstr,i++, "Additional Information are correct","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,13,"Pass") } else { Log.Error("Additional Information are not correct","Info-card",300,FailAttr) createjson(jsonstr,i++, "Fail|Additional Information are not correct...Please investigate","Fail",pathJSON,"Fail",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,13,"Fail") } TabSwitch("Info Cards of Sample *") if((strEquivalenceGroup = WriteIntoInfoCards_RF_EU19(strScenario,getExcelPath(strFileName),strInfoSheet,strSampleSCValue,url)) != false) { createjson(jsonstr,i++, "Entered all values in info-card General","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,14,"Pass") createjson(jsonstr,i++, "Entered all values in info-card Compartment Parameters","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,15,"Pass") createjson(jsonstr,i++, "Entered all values in info-card Compartment Parameters after saving","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,16,"Pass") createjson(jsonstr,i++, "Entered all values in info-card Test Verification","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,17,"Pass") createjson(jsonstr,i++, "Entered values in info-card Approval Information","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,17,"Pass") Log.Message("All details entered for the Info-cards","Info Cards",300,Passattr) } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,14,"Fail") throw "All values in info-cards are not entered" } } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,11,"Pass") throw "Info-cards Navigation Bar is not visible" } Log.PopLogFolder() //Check for the equivalence group in column Log.AppendFolder("Equivelance Group in display") if(RowSelectionSingleClick("EquivalenceGroup",strEquivalenceGroup)==true) { Log.Message("Equivalence Group is shown","Passed",300,Passattr) createjson(jsonstr,i++, "Pass|Equivalence Group is shown","Pass",pathJSON,"Pass",testSteps) // WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,18,"Pass") if (GetStatusDescriptionOfSample("In Execution") ==true) { Log.Message("Status of the sample is In Execution","Passed",300,Passattr) } else { Log.Error("Status of the sample is not In Execution..Please investigate","Failed",300,FailAttr) } } else { Log.Error("Correct Equivalence Group is not shown","Failed",300,FailAttr) createjson(jsonstr,i++, "Fail|Correct Equivalence Group is not shown..Please investigate","Fail",pathJSON,"Fail",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,18,"Fail") //As this step is not dependent on the next steps, execution is not stopped } Log.PopLogFolder() //To enter the details in the Results grid for different parameters Log.AppendFolder("Enter details in results") VerticalCommandBarMapping() if(btn_Results.Exists) { btn_Results.Click() Log.Message("Navigated to results tab","Passed",300,Passattr) createjson(jsonstr,i++, "Parameter profiles are navigated","Pass",pathJSON,"Pass",testSteps) // WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,19,"Pass") WriteToValueColumn(strScenario,getExcelPath(strFileName),strResultsSheet) Log.Message("All details entered in results","Results",300,Passattr) createjson(jsonstr,i++, "Values in Volume Data is entered and saved","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,20,"Pass") createjson(jsonstr,i++, "Values in Performance Data is entered and saved","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,21,"Pass") createjson(jsonstr,i++, "Values in Acoustics Data, Overall Dimensions is entered and saved","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,22,"Pass") //Compare if all the entered parameter values and methods are correct VerticalCommandBarMapping() btn_Results.Click() ValidateParameterAndMethodsAfterSave(strScenario,getExcelPath(strFileName),strResultsSheet) } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,19,"Fail") throw "Results Navigation Bar is not visible" } Log.PopLogFolder() //This is a defect and need to be fixed ClickActionBarButton("Refresh") ProgressBar() //To change the Status of the Sample to "Submit" Log.AppendFolder("Status Change - 1") if (ClickActionBarButton("Status Change")==true) { Log.Message("Clicked on Status Change button","Passed",300,Passattr) ChangeStatusMapping() //To select the required Status if(DropdownValueSelection(dd_CS_Status,strAvailableStatus)==true) { Log.Message("Available dropdown value is selected","Passed",300,Passattr) } else { Log.Error("Unable to select Available dropdown value","Failed",300,FailAttr) createjson(jsonstr,i++, "Unable to select Available dropdown value..Please investigate","Fail",pathJSON,"Fail",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,24,"Fail") } //To select the Status Reason if(DropdownValueSelection(dd_CS_PredefinedReason,strStatusChangeReason)==true) { Log.Message("Reason dropdown value is selected","Passed",300,Passattr) } else { Log.Error("Unable to select Reason dropdown value","Failed",300,FailAttr) } btn_CS_Ok.Click() ProgressBar() //To check the Status Description if (GetStatusDescriptionOfSample("Submit")==true) { Log.Message("Status of the sample is Submit","Passed",300,Passattr) createjson(jsonstr,i++, "Submit status is changed for the sample","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,24,"Pass") } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,24,"Fail") throw "Status of the sample is not Submit" } } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,24,"Fail") throw "Failed to change the status to Submit" } Log.PopLogFolder() ////////////////////////////////////////// Check manually for email createjson(jsonstr,i++, "Check mail manually","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,25,"Pass") //Change Role to Lab Manager to approve the sample Log.AppendFolder("Change Role to Lab Manager") if(ChangeRole(strLabManager)==true) { Log.Message("Role is successfully changed to HRF_Lab Manager","Change Role",300,Passattr) createjson(jsonstr,i++,"Role is successfully changed to HRF_Lab Manager","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,26,"Pass") WaitCheck("Opcenter Research, Development and Laboratory","Panel") if(ClickMainButton("OPEN SAMPLE")==true) { ProgressBar() CreateSampleWizardFilterCriteriaMapping() DropdownValueSelection(dd_SC_CurrentTask,"Open Measurement Order") btn_SC_Apply.Click() ProgressBar() Log.Message("Navigated to Open Sample Wizard screen","Passed",300,Passattr) FindFilterInColumn("ShortDescription") ColumnFilterMapping() EnterValueInFilterSearch(strSampleSCValue) btn_Fil_Filter.Click() ProgressBar() if(RowSelectionSingleClick("ShortDescription",strSampleSCValue)==true) { Log.Message("Sample is selected","Passed",300,Passattr) createjson(jsonstr,i++, "Navigated to Open Sample screen and Sample is selected","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,27,"Pass") } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,27,"Fail") throw "Failed to select sample" } } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,27,"Fail") throw "Failed to navigate to Open Sample screen" } } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,27,"Fail") throw "Failed to change the role to Lab Manager" } Log.PopLogFolder() //To change the status to "Approved" Status Log.AppendFolder("Status Change - 2") if(ClickActionBarButton("Status Change")==true) { Log.Message("Clicked on Status Change button","Passed",300,Passattr) ChangeStatusMapping() //To select the required Status if(DropdownValueSelection(dd_CS_Status,strSubmitStatus)==true) { Log.Message("Available dropdown value is selected","Passed",300,Passattr) } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,28,"Fail") throw "Unable to select Available dropdown value" } //To select the Status Reason if(DropdownValueSelection(dd_CS_PredefinedReason,strStatusChangeReasonSubmit)==true) { Log.Message("Reason dropdown value is selected","Passed",300,Passattr) } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,28,"Fail") throw "Unable to select Reason dropdown value" } btn_CS_Ok.Click() ProgressBar() Delay(2000, "Waiting for fetching sample status") //To verify if the sample status is Approved if (GetStatusDescriptionOfSample("Approved")==true) { Log.Message("Status of the sample is Approved","Passed",300,Passattr) createjson(jsonstr,i++, "Approved status is changed for the sample","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,28,"Pass") } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,28,"Fail") throw "Status of the sample is not Approved" } } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,28,"Fail") throw "Status change button is not clicked" } Log.PopLogFolder() //////////////////////Add validations for 32 - 36 (also in step 38 -> Cancel parameter validation to be added Log.AppendFolder("Check Data Sync status") Delay(1000,"Check for data sync status") btnArrowButton = Sys.Browser("chrome").FindChild(Array("className","hidden"),Array("arrow right button right-button button-3d",false),10,true) btnArrowButton.Click() Delay(1000,"Check for data sync status") if(ClickActionBarButton("Check Data Sync Status")==true) { //////////////////////////////Expected result validation to be done manually Log.Message("<Check Data Sync Status> is clicked","Passed",300,Passattr) createjson(jsonstr,i++, "Pass|<Check Data Sync Status> is clicked","Pass",pathJSON,"Pass",testSteps) do { Delay(100) popupSAPData = Sys.Browser("chrome").Page("*").FindChild("contentText","SAP Data synchronizing....",4,true) }while(!popupSAPData.Exists) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,29,"Pass") } else { Log.Error("<Check Data Sync Status> is not clicked...Please investigate","Failed",300,FailAttr) createjson(jsonstr,i++, "Fail|<Check Data Sync Status> is not clicked..Please investigate","Fail",pathJSON,"Fail",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,29,"Fail") //Since this is not a blocker, script execution can be continued } Log.PopLogFolder() Log.AppendFolder("Data to be exported - Report") strURL = Geturl() if(ClickDropdownIconInActionBarBasedOnName("Report4","Data to be Exported")==true) { //////////////////////////////Expected result validation to be done manually Log.Message("<Data to be Exported> is clicked","Passed",300,Passattr) createjson(jsonstr,i++, "Pass|<Data to be Exported> is clicked","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,30,"Pass") createjson(jsonstr,i++, "Check manually for exported data","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,31,"Pass") Sys.Browser("chrome").Page(strURL).Click() } else { Log.Error("<Data to be Exported> is not clicked...Please investigate","Failed",300,FailAttr) createjson(jsonstr,i++, "Fail|<Data to be Exported> is not clicked..Please investigate","Fail",pathJSON,"Fail",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,30,"Fail") //Since this is not a blocker, script execution can be continued } Log.PopLogFolder() Log.AppendFolder("Test report EN-62552-2020 - Report") strURL = Geturl() if(ClickDropdownIconInActionBarBasedOnName("Report4","Report EN-62552-2020")==true) { //////////////////////////////Expected result validation to be done manually Log.Message("<Report EN-62552-2020> is clicked","Passed",300,Passattr) createjson(jsonstr,i++, "Pass|<Report EN-62552-2020> is clicked","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,32,"Pass") createjson(jsonstr,i++, "Check manually for exported data","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,33,"Pass") Sys.Browser("chrome").Page(strURL).Click() } else { Log.Error("<Report EN-62552-2020> is not clicked...Please investigate","Failed",300,FailAttr) createjson(jsonstr,i++, "Fail|<Report EN-62552-2020> is not clicked..Please investigate","Fail",pathJSON,"Fail",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,31,"Fail") //Since this is not a blocker, script execution can be continued } Log.PopLogFolder() //Navigating to Home Page if(HomeClick()==true) { Log.Message("Pass|Navigated to home page","Passed",300,Passattr) createjson(jsonstr,i++, "Homepage is navigated","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,35,"Pass") } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,35,"Fail") throw "Not able to click the Home button" } //Compaing the values in XML file with that of database Log.AppendFolder("Compare Database values and XML file") var strXMLFile = "GERVMP.GERM0C.PC.V."+strSampleSCValue; Log.Message(strXMLFile) if((strXMPFileNamePath = GetXMLFileName(strXMLFile,url))!=false) { strXMPFileNamePath = GetXMLFileName(strXMLFile,url) if (strXMPFileNamePath != "") { Log.Message("Xml file is generated for sample = "+strSampleSCValue) IndicatorDemo("Waiting for XML and Database Parameter and InfoCard values comparison",5000) var arrParameter = [] arrParameter = GetDataFromXMLFile(strXMPFileNamePath,"Parameter",url); var arrDBParameter = [] sQryParameter = "SELECT table2.VALUE, table2.PA_SHORT_DESC, table2.VALUE_S from (SELECT SCPAAU.VALUE, SCPA.PA_SHORT_DESC, SCPA.VALUE_S " + " FROM [DB_UniLab01D_SQL].[RndSuite].[RndtScPaAu] SCPAAU " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtScPa] SCPA on SCPA.PA=SCPAAU.PA " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtSc] SC on SC.SC = SCPA.SC " + " Where SC.SC_VALUE='"+ strSampleSCValue +"' and SCPAAU.AU in (9,13) " + " and SCPA.SC=SCPAAU.SC and SCPAAU.VALUE is not null and SCPAAU.VALUE='Yes') as table1 " + " inner join " + " ( "+ " SELECT SCPAAU.VALUE, SCPA.PA_SHORT_DESC, SCPA.VALUE_S "+ " FROM [DB_UniLab01D_SQL].[RndSuite].[RndtScPaAu] SCPAAU "+ " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtScPa] SCPA on SCPA.PA=SCPAAU.PA "+ " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtSc] SC on SC.SC = SCPA.SC "+ " Where SC.SC_VALUE='"+ strSampleSCValue + "' and SCPAAU.AU in (13) "+ " and SCPA.SC=SCPAAU.SC and SCPAAU.VALUE is not null "+ " ) as table2 on table1.PA_SHORT_DESC=table2.PA_SHORT_DESC ;"; arrDBParameter = GetDataFromDatabase_Parameters(url,sQryParameter,"Parameter") //Compare the Parameters in DB and XML if(CompareTwoArrays(arrParameter,arrDBParameter)==true) { Log.Message("Parameters are compared correctly","Passed",100,Passattr) createjson(jsonstr,i++, "Parameters are compared correctly from xml and database","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,36,"Pass") } else { Log.Error("Parameters are not compared correctly","Failed",100,FailAttr) createjson(jsonstr,i++, "Parameters are not compared correctly from xml and database..Please investigate","Fail",pathJSON,"Fail",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,36,"Fail") } var arrInfoCards = [] arrInfoCards = GetDataFromXMLFile(strXMPFileNamePath,"InfoCards",url) var arrDBInfoCards = [] sQryInfoCards = " SELECT DISTINCT Table2.II_SHORT_DESC,Table2.VALUE,Table2.IIVALUE from ( select SCIi.II_SHORT_DESC, IeAU.VALUE,SCIi.IIVALUE,IeAU.AUSEQ " + " from [DB_UniLab01D_SQL].[RndSuite].[RndtScIc] SCIC " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtSc] SC ON SC.SC=SCIC.SC " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtScIi] SCIi on SCIi.IC=SCIC.IC " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtIeAu] IeAU on SCIi.II=IeAU.IE " + " where SC.SC_VALUE= '"+ strSampleSCValue +"' and SCIi.SC=SC.SC and SCIi.IE_VERSION=IeAU.VERSION " + " and IeAU.VALUE='Yes' " + " group by II_SHORT_DESC,IeAU.VALUE,SCIi.IIVALUE,IeAU.AUSEQ) as Table1 " + " inner join (select SCIi.II_SHORT_DESC, IeAU.VALUE,SCIi.IIVALUE " + " from [DB_UniLab01D_SQL].[RndSuite].[RndtScIc] SCIC " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtSc] SC ON SC.SC=SCIC.SC " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtScIi] SCIi on SCIi.IC=SCIC.IC " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtIeAu] IeAU on SCIi.II=IeAU.IE " + " where SC.SC_VALUE= '"+ strSampleSCValue +"' and SCIi.SC=SC.SC and SCIi.IE_VERSION=IeAU.VERSION " + " and IeAU.AU in (13) ) as Table2 on Table1.II_SHORT_DESC=Table2.II_SHORT_DESC "; //To compare the Info cards of the Database and XML arrDBInfoCards = GetDataFromDatabase_Infocards(url,sQryInfoCards,"InfoCards") //CompareTwoArrays(arrInfoCards,arrDBInfoCards) if (CompareTwoArrays(arrInfoCards,arrDBInfoCards)==true) { Log.Message("Infocards are compared correctly","Passed",100,Passattr) createjson(jsonstr,i++,"Infocards are compared correctly from xml and database","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,37,"Pass") } else { Log.Error("Info Cards are not compared correctly","Failed",100,FailAttr) createjson(jsonstr,i++,"Infocards are not compared correctly from xml and database..Please investigate","Fail",pathJSON,"Fail",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,37,"Fail") } } else { Log.Error("XML file is not generated","Failed",300,FailAttr) createjson(jsonstr,i++,"Fail|XML file is not generated for sample = "+strSampleSCValue,"Fail",pathJSON,"Fail",testSteps) import_JSONXRayResults(strTestExecutionUrl) return } } else { Log.Error("To CMD folder path is not found","Failed",300,FailAttr) createjson(jsonstr,i++,"Fail|To CMD folder path is not found","Fail",pathJSON,"Fail",testSteps) import_JSONXRayResults(strTestExecutionUrl) return } Log.PopLogFolder() Log.PopLogFolder() ////////////////////////////////////////////Subsample CallChangeRoleToLabWorker(strLabWorker) //To create the sample Log.AppendFolder("Open Sample for "+strSampleShortDescr+"_mod") if(ClickMainButton("OPEN SAMPLE")==true) { ProgressBar() Delay(1000,"Waiting to select Current Task") CreateSampleWizardFilterCriteriaMapping() DropdownValueSelection(dd_SC_CurrentTask,"Open Measurement Order") btn_SC_Apply.Click() WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,42,"Pass") ProgressBar() Log.Message("Navigated to Open Sample Wizard screen","Passed",300,Passattr) if(RowSelectionSingleClick("ShortDescription",strSampleSCValue)==true) { Log.Message("Sample is selected","Passed",300,Passattr) createjson(jsonstr,i++, "Navigated to Open Sample screen and Sample is selected","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,43,"Pass") } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,43,"Fail") throw "Failed to select sample" } } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,42,"Fail") throw "Failed to navigate to Open Sample screen" } ClickActionBarButton("Refresh") Delay(5000) //Click on <Assign New Sub-Sample> Log.AppendFolder("Enter Filter criteria") if(ClickActionBarButton("Assign New Sub-Sample")==true) { ClickActionBarButton("Refresh") ProgressBar() Log.Message("Clicked on <Assign New Sub-Sample>","Passed",300,Passattr) createjson(jsonstr,i++,"Clicked on <Assign New Sub-Sample>","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,44,"Pass") //To get the created sample details strSampleSCValue_mod = SampleIDOfNewSample() if(strSampleSCValue_mod != "") { Log.Message("Retrieved the sample ID as "+strSampleSCValue_mod,"Passed",300,Passattr) if (GetStatusDescriptionOfSample("Available") == true) { Log.Message("Status of the sample is Available","Passed",300,Passattr) } else { Log.Error("Status of the sample is not Available","Failed",300,FailAttr) } } else { Log.Error("Unable to retrieve the sample","Failed",300,FailAttr) } } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,44,"Fail") throw "Failed to click on <Assign New Sub-Sample>" } Log.PopLogFolder() //To create and Open the sample by using the <Create and Open> ActionBar button Log.AppendFolder("Select the newly created sub-sample"+strSampleSCValue_mod) if(RowSelectionSingleClick("ShortDescription",strSampleSCValue_mod)==true) { ProgressBar() Log.Message("Sub-Sample is selected","Passed",300,Passattr) createjson(jsonstr,i++, "Sub-Sample is selected","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,45,"Pass") WaitCheck("Status to Cancelled","Panel") Statustocan=GetActionBar().FindEx(Array("ObjectType","contentText"),Array("TextNode","Status to Cancelled"),10,true,100) } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,45,"Fail") throw "Sub-Sample is not shown "+strSampleSCValue_mod } Log.PopLogFolder() //To navigate to Open the Info cards through Side navigation Bar and enter the details Log.AppendFolder("Enter details in Info Cards") ClickCloseTabButton() VerticalCommandBarMapping() if(btn_InfoCards.Exists) { btn_InfoCards.Click() DragInfoCardOrParameterScreen() Log.Message("Info-cards Navigation Bar is selected","Passed",300,Passattr) createjson(jsonstr,i++, "Info-cards Navigation Bar is selected","Pass",pathJSON,"Pass",testSteps) TileSelection("Mandatory instructions for use") strMandatoryInstructions = Sys.Browser("chrome").FindChild("className","specInfoField infoFieldElement infoFieldCustom",25,true).contentText aqFile.WriteToTextFile(getExcelPath("HRF_RF_EU19_ManadtoryInstructionsForUseActual_mod.txt"),strMandatoryInstructions,aqFile.ctUTF8,true) if(aqFile.Compare(getExcelPath("HRF_RF_EU19_ManadtoryInstructionsForUseActual_mod.txt"),getExcelPath("HRF_RF_EU19_ManadtoryInstructionsForUseExpected.txt"))) { Log.Message("Mandatory instructions for use are correct","Info-card",300,Passattr) createjson(jsonstr,i++, "Fail|Mandatory instructions for use are correct","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,46,"Pass") } else { Log.Error("Mandatory instructions for use are not correct","Info-card",300,FailAttr) createjson(jsonstr,i++, "Fail|Mandatory instructions for use are not correct...Please investigate","Fail",pathJSON,"Fail") WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,46,"Fail") } TabSwitch("Info Cards of Sample *") TileSelection("Additional Information") TabSwitch("Additional Information") strAdditionalInfo = Sys.Browser("chrome").FindChild("className","k-spreadsheet-fixed-container",26,true).contentText aqFile.WriteToTextFile(getExcelPath("HRF_RF_EU19_AdditionalInfoActual_mod.txt"),strAdditionalInfo,aqFile.ctUTF8,true) if(aqFile.Compare(getExcelPath("HRF_RF_EU19_AdditionalInfoActual_mod.txt"),getExcelPath("HRF_RF_EU19_AdditionalInfoExpected.txt"))) { Log.Message("Additional Information are correct","Info-card",300,Passattr) createjson(jsonstr,i++, "Fail|Additional Information are correct","Pass",pathJSON,"Pass",testSteps) // WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,47,"Pass") } else { Log.Error("Additional Information are not correct","Info-card",300,FailAttr) createjson(jsonstr,i++, "Fail|Additional Information are not correct...Please investigate","Fail",pathJSON,"Fail") // WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,47,"Fail") } TabSwitch("Info Cards of Sample *") if((strEquivalenceGroup = WriteIntoInfoCards_RF_EU19(strScenario,getExcelPath(strFileName),strInfoSheetMod,strSampleSCValue_mod,url)) != false) { createjson(jsonstr,i++, "Entered all values in info-card General","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,48,"Pass") createjson(jsonstr,i++, "Entered all values in info-card Compartment Parameters","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,49,"Pass") createjson(jsonstr,i++, "Entered all values in info-card Compartment Parameters after saving","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,50,"Pass") createjson(jsonstr,i++, "Entered all values in info-card Test Verification","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,51,"Pass") createjson(jsonstr,i++, "Entered all values in info-card Subsample Information","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,52,"Pass") Log.Message("All details entered for the Info-cards","Info Cards",300,Passattr) } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,48,"Fail") throw "All values in info-cards are not entered" } } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,45,"Fail") throw "Info-cards Navigation Bar is not visible" } Log.PopLogFolder() //To enter the details in the Results grid for different parameters Log.AppendFolder("Enter details in results") VerticalCommandBarMapping() if(btn_Results.Exists) { btn_Results.Click() Log.Message("Navigated to results tab","Passed",300,Passattr) createjson(jsonstr,i++, "Parameter profiles are navigated","Pass",pathJSON,"Pass",testSteps) // WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,53,"Pass") WriteToValueColumn(strScenario,getExcelPath(strFileName),strResultsSheetMod) Log.Message("All details entered in results","Results",300,Passattr) createjson(jsonstr,i++, "Values in Volume Data is entered and saved","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,54,"Fail") createjson(jsonstr,i++, "Values in Performance Data is entered and saved","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,55,"Fail") createjson(jsonstr,i++, "Values in Acoustics Data is entered and saved","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,56,"Fail") createjson(jsonstr,i++, "Values in Overall Dimensions is entered and saved","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,57,"Fail") //Compare if all the entered parameter values and methods are correct VerticalCommandBarMapping() btn_Results.Click() ValidateParameterAndMethodsAfterSave(strScenario,getExcelPath(strFileName),strResultsSheetMod) } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,53,"Fail") throw "Results Navigation Bar is not visible" } Log.PopLogFolder() //This is a defect and need to be fixed ClickActionBarButton("Refresh") ProgressBar() //To change the Status of the Sample to "Submit" Log.AppendFolder("Status Change - 1") if (ClickActionBarButton("Status Change")==true) { Log.Message("Clicked on Status Change button","Passed",300,Passattr) createjson(jsonstr,i++,"Status change button is clicked","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,58,"Pass") ChangeStatusMapping() //To select the required Status if(DropdownValueSelection(dd_CS_Status,strAvailableStatus)==true) { Log.Message("Available dropdown value is selected","Passed",300,Passattr) createjson(jsonstr,i++, "Available dropdown value is selected","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,59,"Pass") } else { Log.Error("Unable to select Available dropdown value","Failed",300,FailAttr) createjson(jsonstr,i++, "Unable to select Available dropdown value..Please investigate","Fail",pathJSON,"Fail") } //To select the Status Reason if(DropdownValueSelection(dd_CS_PredefinedReason,strStatusChangeReason)==true) { Log.Message("Reason dropdown value is selected","Passed",300,Passattr) createjson(jsonstr,i++, "Reason dropdown value is selected","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,60,"Pass") } else { Log.Error("Unable to select Reason dropdown value","Failed",300,FailAttr) createjson(jsonstr,i++, "Unable to select Reason dropdown value..Please investigate","Fail",pathJSON,"Fail") } btn_CS_Ok.Click() //To check the Status Description if (GetStatusDescriptionOfSample("Submit")==true) { Log.Message("Status of the sample is Submit","Passed",300,Passattr) createjson(jsonstr,i++, "Submit status is changed for the sample","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,61,"Pass") } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,61,"Fail") throw "Status of the sample is not changed to Submit" } } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,58,"Fail") throw "Failed to change the status to Submit" } Log.PopLogFolder() //Change Role to Lab Manager to approve the sample Log.AppendFolder("Change Role to Lab Manager") if(ChangeRole(strLabManager)==true) { Log.Message("Role is successfully changed to HRF_Lab Manager","Change Role",300,Passattr) createjson(jsonstr,i++,"Role is successfully changed to HRF_Lab Manager","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,62,"Pass") WaitCheck("Opcenter Research, Development and Laboratory","Panel") if(ClickMainButton("OPEN SAMPLE")==true) { ProgressBar() Delay(1000,"Waiting to select Current Task") CreateSampleWizardFilterCriteriaMapping() DropdownValueSelection(dd_SC_CurrentTask,"Open Measurement Order") btn_SC_Apply.Click() WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,63,"Pass") ProgressBar() Log.Message("Navigated to Open Sample Wizard screen","Passed",300,Passattr) if(RowSelectionSingleClick("ShortDescription",strSampleSCValue_mod)==true) { Log.Message("Sample is selected","Passed",300,Passattr) createjson(jsonstr,i++, "Navigated to Open Sample screen and Sample is selected","Pass",pathJSON,"Pass",testSteps) } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,63,"Fail") throw "Failed to select sample" } } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,62,"Fail") throw "Failed to navigate to Open Sample screen" } } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,62,"Fail") throw "Failed to change the role to Lab Manager" } Log.PopLogFolder() //To change the status to "Approved" Status Log.AppendFolder("Status Change - 2") if(ClickActionBarButton("Status Change")==true) { Log.Message("Clicked on Status Change button","Passed",300,Passattr) createjson(jsonstr,i++,"Status change button is clicked","Pass",pathJSON,"Pass",testSteps) ChangeStatusMapping() //To select the required Status if(DropdownValueSelection(dd_CS_Status,strSubmitStatus)==true) { Log.Message("Available dropdown value is selected","Passed",300,Passattr) createjson(jsonstr,i++,"Available dropdown value is selected","Pass",pathJSON,"Pass",testSteps) } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,64,"Fail") throw "Unable to select Available dropdown value" } //To select the Status Reason if(DropdownValueSelection(dd_CS_PredefinedReason,strStatusChangeReasonSubmit)==true) { Log.Message("Reason dropdown value is selected","Passed",300,Passattr) createjson(jsonstr,i++,"Reason dropdown value is selected","Pass",pathJSON,"Pass",testSteps) } else { Log.Error("Unable to select Reason dropdown value","Failed",300,FailAttr) createjson(jsonstr,i++,"Unable to select Reason dropdown value..Please investigate","Fail",pathJSON,"Fail") } btn_CS_Ok.Click() ProgressBar() Delay(2000, "Waiting for fetching sample status") //To verify if the sample status is Approved if (GetStatusDescriptionOfSample("Approved")==true) { Log.Message("Status of the sample is Approved","Passed",300,Passattr) createjson(jsonstr,i++, "Approved status is changed for the sample","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,64,"Pass") } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,64,"Fail") Log.Error("Status of the sample is not Approved...Please investigate","Failed",300,FailAttr) createjson(jsonstr,i++, "Sample status is not changed to Approved..Please investigate","Fail",pathJSON,"Fail") } } else { WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,64,"Pass") throw "Status change button is not clicked" } Log.PopLogFolder() if(strVideo == "Yes") StopVideo_Merge_Srt() //Compaing the values in XML file with that of database Log.AppendFolder("Compare Database values and XML file") var strXMLFile = "GERVMP.GERM0C.PC.V."+strSampleSCValue; Log.Message(strXMLFile) if((strXMPFileNamePath = GetXMLFileName(strXMLFile,url))!=false) { strXMPFileNamePath = GetXMLFileName(strXMLFile,url) if (strXMPFileNamePath != "") { Log.Error("Xml file is generated for sample = "+strSampleSCValue_mod) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,65,"Fail") IndicatorDemo("Waiting for XML and Database Parameter and InfoCard values comparison",5000) var arrParameter = [] arrParameter = GetDataFromXMLFile(strXMPFileNamePath,"Parameter",url); var arrDBParameter = [] sQryParameter = "SELECT table2.VALUE, table2.PA_SHORT_DESC, table2.VALUE_S from (SELECT SCPAAU.VALUE, SCPA.PA_SHORT_DESC, SCPA.VALUE_S " + " FROM [DB_UniLab01D_SQL].[RndSuite].[RndtScPaAu] SCPAAU " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtScPa] SCPA on SCPA.PA=SCPAAU.PA " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtSc] SC on SC.SC = SCPA.SC " + " Where SC.SC_VALUE='"+ strSampleSCValue_mod +"' and SCPAAU.AU in (9,13) " + " and SCPA.SC=SCPAAU.SC and SCPAAU.VALUE is not null and SCPAAU.VALUE='Yes') as table1 " + " inner join " + " ( "+ " SELECT SCPAAU.VALUE, SCPA.PA_SHORT_DESC, SCPA.VALUE_S "+ " FROM [DB_UniLab01D_SQL].[RndSuite].[RndtScPaAu] SCPAAU "+ " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtScPa] SCPA on SCPA.PA=SCPAAU.PA "+ " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtSc] SC on SC.SC = SCPA.SC "+ " Where SC.SC_VALUE='"+ strSampleSCValue_mod + "' and SCPAAU.AU in (13) "+ " and SCPA.SC=SCPAAU.SC and SCPAAU.VALUE is not null "+ " ) as table2 on table1.PA_SHORT_DESC=table2.PA_SHORT_DESC ;"; arrDBParameter = GetDataFromDatabase_Parameters(url,sQryParameter,"Parameter") //Compare the Parameters in DB and XML if(CompareTwoArrays(arrParameter,arrDBParameter)==true) { Log.Message("Parameters are compared correctly","Passed",100,Passattr) createjson(jsonstr,i++, "Parameters are compared correctly from xml and database","Pass",pathJSON,"Pass",testSteps) } else { Log.Error("Parameters are not compared correctly","Failed",100,FailAttr) createjson(jsonstr,i++, "Parameters are not compared correctly from xml and database..Please investigate","Fail",pathJSON,"Fail") // return } var arrInfoCards = [] arrInfoCards = GetDataFromXMLFile(strXMPFileNamePath,"InfoCards",url) var arrDBInfoCards = [] sQryInfoCards = " SELECT DISTINCT Table2.II_SHORT_DESC,Table2.VALUE,Table2.IIVALUE from ( select SCIi.II_SHORT_DESC, IeAU.VALUE,SCIi.IIVALUE,IeAU.AUSEQ " + " from [DB_UniLab01D_SQL].[RndSuite].[RndtScIc] SCIC " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtSc] SC ON SC.SC=SCIC.SC " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtScIi] SCIi on SCIi.IC=SCIC.IC " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtIeAu] IeAU on SCIi.II=IeAU.IE " + " where SC.SC_VALUE= '"+ strSampleSCValue +"' and SCIi.SC=SC.SC and SCIi.IE_VERSION=IeAU.VERSION " + " and IeAU.VALUE='Yes' " + " group by II_SHORT_DESC,IeAU.VALUE,SCIi.IIVALUE,IeAU.AUSEQ) as Table1 " + " inner join (select SCIi.II_SHORT_DESC, IeAU.VALUE,SCIi.IIVALUE " + " from [DB_UniLab01D_SQL].[RndSuite].[RndtScIc] SCIC " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtSc] SC ON SC.SC=SCIC.SC " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtScIi] SCIi on SCIi.IC=SCIC.IC " + " inner join [DB_UniLab01D_SQL].[RndSuite].[RndtIeAu] IeAU on SCIi.II=IeAU.IE " + " where SC.SC_VALUE= '"+ strSampleSCValue +"' and SCIi.SC=SC.SC and SCIi.IE_VERSION=IeAU.VERSION " + " and IeAU.AU in (13) ) as Table2 on Table1.II_SHORT_DESC=Table2.II_SHORT_DESC "; //To compare the Info cards of the Database and XML arrDBInfoCards = GetDataFromDatabase_Infocards(url,sQryInfoCards,"InfoCards") //CompareTwoArrays(arrInfoCards,arrDBInfoCards) if(CompareTwoArrays(arrInfoCards,arrDBInfoCards)==true) { Log.Message("Infocards are compared correctly","Passed",100,Passattr) createjson(jsonstr,i++,"Infocards are compared correctly from xml and database","Pass",pathJSON,"Pass",testSteps) } else { Log.Error("Info Cards are not compared correctly","Failed",100,FailAttr) createjson(jsonstr,i++,"Infocards are not compared correctly from xml and database..Please investigate","Fail",pathJSON,"Fail") import_JSONXRayResults(strTestExecutionUrl,pathJSON) return } } else { Log.Message("XML file is not generated","Failed",300,FailAttr) createjson(jsonstr,i++,"Pass|XML file is not generated for sample = "+strSampleSCValue_mod,"Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,65,"Pass") } } else { Log.Error("To CMD folder path is not found","Failed",300,FailAttr) createjson(jsonstr,i++,"Fail|To CMD folder path is not found","Fail",pathJSON,"Fail") } Log.PopLogFolder() Log.AppendFolder("Test report EN-62552-2020 - Report") strURL = Geturl() if(ClickDropdownIconInActionBarBasedOnName("Report4","Report EN-62552-2020")==true) { Log.Message("<Report EN-62552-2020> is clicked","Passed",300,Passattr) createjson(jsonstr,i++, "Pass|<Report EN-62552-2020> is clicked","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,66,"Pass") //36 Sys.Browser("chrome").Page(strURL).Click() } else { Log.Error("<Report EN-62552-2020> is not clicked...Please investigate","Failed",300,FailAttr) createjson(jsonstr,i++, "Fail|<Report EN-62552-2020> is not clicked..Please investigate","Fail",pathJSON,"Fail") WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,66,"Fail") //Since this is not a blocker, script execution can be continued //67 } Log.PopLogFolder() //Navigating to Home Page if(HomeClick()==true) { Log.Message("Pass|Navigated to home page","Passed",300,Passattr) createjson(jsonstr,i++, "Homepage is navigated","Pass",pathJSON,"Pass",testSteps) WriteToExcel(getExcelPath(strResultFileName),strSampleShortDescr,strScenario,68,"Pass") } else { Log.Error("Not able to click the Home button","Failed",300,FailAttr) createjson(jsonstr,i++, "Failed to navigate to Homepage..Please investigate","Fail",pathJSON,"Fail") if(strVideo == "Yes") StopVideo_Merge_Srt() import_JSONXRayResults(strTestExecutionUrl,pathJSON) return } if(strVideo=="Yes") StopVideo_Merge_Srt() Log.PopLogFolder() import_JSONXRayResults(strTestExecutionUrl,pathJSON) } catch(err) { Log.Error(err,"Failed",300,FailAttr) createjson(jsonstr,i,err,"Fail",pathJSON,"Fail",testSteps) import_JSONXRayResults(strTestExecutionUrl,pathJSON) return } } function HRF_RF_EU19_mod(url,strSampleShortDescr,testkey,testexecutionkey) { var Excel; var strFromExcel; var strExcelParameter; var strExcelParamValue; Excel = Sys.OleObject("Excel.Application"); Excel.Visible = false; a = Excel.Workbooks.Open(getExcelPath("HRF_RF_EU19\\HRF_RF_EU19_mod_DDT_All.xlsx")) var sheet = Excel.Sheets.Item("Sheet1") sheet.activate(); let RowCount = sheet.UsedRange.Rows.Count for(l=2;l<=RowCount;l++) { Log.AppendFolder(VarToString(sheet.Cells.Item(l, 1))) SC_CreateSample_HRF_RF_EU19_mod(url,strSampleShortDescr,testkey,testexecutionkey, VarToString(sheet.Cells.Item(l, 1))) Log.PopLogFolder() Log.PopLogFolder() } } //------------------------------------------------------------------------------ function main(){ SC_CreateSample_HRF_CDA("http://si0vmunilab02d.bsh.corp.bshg.com/RnDSuite/","CDA_LCW_P","VMP-2017","VMP-2113") }