Pass the Repository Item as an Object to a Function
Posted: Fri Oct 14, 2016 10:12 pm
Hi Team
My scenario i am writing common function in a class to retrieve the RowCount/colCounf of an SAP Table Object
As this function is common for all the table object, i just pass this repository reference table object to that function so that
Below is the code i tried
var GridRepo=HCM.Framework.HCM.ObjectRepositories.SAP_GUI.WorkFlow.TCodeRepo.Instance;
var GridObj=GridRepo.SAP_GUI.S_PH0_48000510_InfoSetQuery.Grd_QueryInputs;
i need to pass the GridObj as an object to a fucntion
i tried like
DatabaseIO.SAP_GridRowCount(GridObj);
public static void SAP_GridRowCount(Ranorex.Core.Repository.RepositoryItem Grid)
{
}
Got the error messages as
Argument 1: cannot convert from 'Ranorex.Table' to 'Ranorex.Core.Repository.RepositoryItem' (CS1503) - \\NASPRD01094P04\PRD_ISQA_Automation_Users\srinivasulareddy\ranorex\HCM\HCM.TestSuite\OM\Create_Position.cs:56,32
The best overloaded method match for 'HCM.Framework.HCM.Modules.Common.TestData.DatabaseIO.SAP_GridRowCount(Ranorex.Core.Repository.RepositoryItem)' has some invalid arguments (CS1502) - \\NASPRD01094P04\PRD_ISQA_Automation_Users\srinivasulareddy\ranorex\HCM\HCM.TestSuite\OM\Create_Position.cs:56,4
My scenario i am writing common function in a class to retrieve the RowCount/colCounf of an SAP Table Object
As this function is common for all the table object, i just pass this repository reference table object to that function so that
Below is the code i tried
var GridRepo=HCM.Framework.HCM.ObjectRepositories.SAP_GUI.WorkFlow.TCodeRepo.Instance;
var GridObj=GridRepo.SAP_GUI.S_PH0_48000510_InfoSetQuery.Grd_QueryInputs;
i need to pass the GridObj as an object to a fucntion
i tried like
DatabaseIO.SAP_GridRowCount(GridObj);
public static void SAP_GridRowCount(Ranorex.Core.Repository.RepositoryItem Grid)
{
}
Got the error messages as
Argument 1: cannot convert from 'Ranorex.Table' to 'Ranorex.Core.Repository.RepositoryItem' (CS1503) - \\NASPRD01094P04\PRD_ISQA_Automation_Users\srinivasulareddy\ranorex\HCM\HCM.TestSuite\OM\Create_Position.cs:56,32
The best overloaded method match for 'HCM.Framework.HCM.Modules.Common.TestData.DatabaseIO.SAP_GridRowCount(Ranorex.Core.Repository.RepositoryItem)' has some invalid arguments (CS1502) - \\NASPRD01094P04\PRD_ISQA_Automation_Users\srinivasulareddy\ranorex\HCM\HCM.TestSuite\OM\Create_Position.cs:56,4