Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
object's description matches more than one of the objects
#1
Not Solved
Hi I am new to qtp.Now I am working with Peoplesoft HRMS with QtP.

doing automation hirining employees.For that dynamically sending data.After retreiving data from excel sheet system will generate emplid.

I need to export generated emplid to excel sheet.

to my first phase exporting empld to excel sheet working fine with the following code.
Code:
EMPLID = .PSFrame("Personal Data").WebElement("Add the Relationship").GetROProperty("innertext")
datatable.Value("EMPL_ID",sheetName1) = EMPLID
Datatable.ExportSheet sheetPath,sheetName1

after modifing the code like i need hire mutiple employee types(permananent and temporary etc). emplids generating successfully.But getting following error :
object's description matches more than one of the objects in your application.
Please let me know how to handle this is issue or using with DP.
Reply
#2
Not Solved
Give index property to the object you are trying to access.
Reply
#3
Not Solved
Hi Manish,

Please give more details with code how to give index property if possible. It is very need full to me.

Thanks
M.R.Chowdary.
Reply
#4
Not Solved
Hi Chowdary,
For which object are you getting the error "more than one objects found"?
Reply
#5
Not Solved
Hi manish,

Please find the following code:

I am getting error for add the relationship Object.
EMPLID = .PSFrame("Personal Data").WebElement("Add the Relationship").GetROProperty("innertext"), where as last in the following code.


Code:
'/*Decleration Action Variables

'On Error Resume Next
'Option Explicit
Dim actLogin,actLoginName,HRUrl,sheetName1,sheetPath,userID,passWord,EMPLID

' /*using external environmen t file to save action perameters
actionPerameters="C:\QTP_FrameWork\HR\Environment\actionPerameters.INI"
environment.LoadFromFile actionPerameters

'/*Loads action perameters at run time
HRUrl=environment.Value("HRUrl")
actLogin=environment.Value("actLogin")
actLoginName=environment.Value("actLoginName")
userID=environment.Value("userID")
passWord=environment.Value("passWord")

'msgbox passWord
'/*calling the application URL
systemUtil.Run HRUrl,"",false

'/*Load and runs the exteranal reusable Login action at run time
LoadandRunaction actLogin,actLoginName,oneIteration,userID,passWord

'Import the test data from external XLS sheet to Datasheet
sheetName1="AddPerson"
sheetPath="C:\QTP_FrameWork\HR\TestData\Add_Person.xls"
datatable.AddSheet(sheetName1)
datatable.ImportSheet sheetPath,sheetName1,sheetName1
rowCount=datatable.GetSheet(sheetName1).GetRowCount
'msgbox rowCount
'Script for Login to PeopleSoft PIA
With Browser("Oracle | PeopleSoft Enterprise")
    With .Page("Oracle | PeopleSoft Enterprise")

End With

    'Navigating to the destination page

    .Page("Employee-facing registry").Link("Workforce Administration").Click
    .Page("Base Navigation Page").PSFrame("Navigational Links").Link("Personal Information").Click

    'Start Looping from here
    For i=1 to rowCount
    'My_EffDate  = DataTable.GetSheet(sheetName1).GetParameter("Eff_Date").ValueByRow(i)   'comment ed on 03/15

       'Validate the data in the first column of the current row, if its blank, do nothing otherwise process the data.
        'If My_EffDate="" Then 'comment ed on 03/15

        'else  'comment ed on 03/15
        datatable.GetSheet(sheetName1).SetCurrentRow(i)
        .Page("Base Navigation Page_2").PSFrame("Navigational Links").Link("Add a Person").Click
        With .Page("Add a Person")
            .PSFrame("Add Person Front End").Link("Add the Person").Click

            'Adding data
            .PSFrame("Personal Data").WebEdit("NAMES_EFFDT$0").Set datatable.Value("Eff_Date" , sheetName1)
            .PSFrame("Personal Data").Link("Add Name").Click
            .PSFrame("Personal Data").WebEdit("DERIVED_CORE_NM_FIRST_NAME").Set  datatable.Value("First_Name" , sheetName1)
            .PSFrame("Personal Data").WebEdit("DERIVED_CORE_NM_LAST_NAME").Set datatable.Value("Last_name" , sheetName1)
            .PSFrame("Personal Data").WebButton("OK").Click
            .PSFrame("Personal Data").WebEdit("PERSON_BIRTHDATE").Set datatable.Value("Birth_Dt" , sheetName1)
            .PSFrame("Personal Data").WebEdit("PERSON_BIRTHSTATE").Set datatable.Value("State" , sheetName1)
            .PSFrame("Personal Data").WebEdit("PERSON_BIRTHPLACE").Set datatable.Value("Birth_Loc",sheetName1)  'add  script on 16-03-10
            .PSFrame("Personal Data").WebList("PERS_DATA_EFFDT_SEX$0").Select datatable.Value("Sex" , sheetName1)
            If  datatable.Value("Education",sheetName1) <>"" Then
                .PSFrame("Personal Data").WebList("PERS_DATA_EFFDT_HIGHEST_EDUC_LVL$0").Select datatable.Value("Education",sheetName1)  'add  script on 16-03-10
            End If
            If  datatable.Value("Marital_Stat",sheetName1) <>""  Then            
               .PSFrame("Personal Data").WebList("PERS_DATA_EFFDT_MAR_STATUS$0").Select datatable.Value("Marital_Stat",sheetName1)  'add  script on 16-03-10
            End If
            If  datatable.Value("Language",sheetName1)  <>""  Then        
               .PSFrame("Personal Data").WebList("PERS_DATA_EFFDT_LANG_CD$0").Select datatable.Value("Language",sheetName1) ' add  script on 16-03-10
            End If
            .PSFrame("Personal Data").WebEdit("PERS_NID_COUNTRY$0").Set datatable.Value("Country",sheetName1) ' add  script on 16-03-10
            .PSFrame("Personal Data").WebList("PERS_NID_NATIONAL_ID_TYPE$0").Select datatable.Value("NID_Type" , sheetName1 )  'Modified  script  - add  script on 16-03-10
            .PSFrame("Personal Data").WebEdit("DERIVED_HR_NID_SPECIAL_CHAR$0").Set datatable.Value("NID" , sheetName1)
            .PSFrame("Personal Data").Link("Contact Information").Click
            .PSFrame("Personal Data").Link("Add Address Detail").Click
            .PSFrame("Personal Data").Link("Add Address").Click
            .PSFrame("Personal Data").WebEdit("DERIVED_ADDRESS_ADDRESS1").Set datatable.Value("Addrs1" , sheetName1)
            .PSFrame("Personal Data").WebEdit("DERIVED_ADDRESS_CITY").Set datatable.Value("City" , sheetName1)
            .PSFrame("Personal Data").WebEdit("DERIVED_ADDRESS_STATE").Set datatable.Value("Addrs_State" , sheetName1)
            .PSFrame("Personal Data").WebEdit("DERIVED_ADDRESS_POSTAL").Set datatable.Value("ZIP" , sheetName1)
            .PSFrame("Personal Data").WebEdit("DERIVED_ADDRESS_COUNTY").Set datatable.Value("Country" , sheetName1)
            .PSFrame("Personal Data").Image("OK").Click
            .PSFrame("Personal Data").WebButton("OK").Click
            .PSFrame("Personal Data").Link("Organizational Relationships").Click
            '.PSFrame("Personal Data").WebCheckBox("DERIVED_HCR_PER_DERIVED_EMP").Set "ON"  'commented on 16-03-10
            If datatable.Value ("Emp_Type",sheetName1)="EMP" Then                                                                              'add  script on 16-03-10
            .PSFrame("Personal Data").WebCheckBox("DERIVED_HCR_PER_DERIVED_EMP").Set "ON"    
            else if datatable.Value ("Emp_Type",sheetName1)="CWR" Then            
            .PSFrame("Personal Data").WebCheckBox("DERIVED_HCR_PER_DERIVED_CWR").Set "ON"
            else if datatable.Value ("Emp_Type",sheetName1)="POI" Then
            .PSFrame("Personal Data").WebCheckBox("DERIVED_HCR_PER_DERIVED_POI").Set "ON"
            End if
            End if
            End If                                                                                                                                                                                             'add  script on 16-03-10

            '.PSFrame("Personal Data").WebCheckBox(datatable.Value("Emp_Type",sheetName1)).Set "ON"

               .PSFrame("Personal Data").WebButton("Add the Relationship").Click

            If not (.PSFrame("Personal Data").WebList("JOB_ACTION_REASON$0").Exist(1)) Then
                .PSFrame("Personal Data").WebButton("Return").Click
                .PSFrame("Personal Data").WebButton("OK").Click
            End If

         If  datatable.Value("Job_Ind",sheetName1) <> "" Then        
                .PSFrame("Personal Data").WebList("JOB_JOB_INDICATOR$0").Select datatable.Value("Job_Ind",sheetName1) 'add  script on 16-03-10
           End If

            .PSFrame("Personal Data").WebList("JOB_ACTION$0").Select datatable.Value("Action",sheetName1) 'add  script on 16-03-10
               .PSFrame("Personal Data").WebList("JOB_ACTION_REASON$0").Select  datatable.Value("Act_Rsn" , sheetName1)     'Modified  script on 16-03-10
            .PSFrame("Personal Data").WebEdit("JOB_POSITION_NBR$0").Set datatable.Value("Pos_No",sheetName1) 'add  script on 16-03-10
            If  LEN(datatable.Value("Pos_No",sheetName1) )     = 0 Then
                .PSFrame("Personal Data").WebEdit("JOB_DEPTID$0").Set  datatable.Value("Dept_Id" , sheetName1)
                .PSFrame("Personal Data").WebEdit("JOB_LOCATION$0").Set  datatable.Value("Loc" , sheetName1)
                .PSFrame("Personal Data").WebEdit("JOB_ESTABID$0").Set datatable.Value("Est_Id",sheetName1) 'add  script on 16-03-10                        
            End If                             
            .PSFrame("Personal Data").Link("Job Information").Click
            If  datatable.Value("Job_Code" , sheetName1) <>""Then        
               .PSFrame("Personal Data").WebEdit("JOB_JOBCODE$0").Set  datatable.Value("Job_Code" , sheetName1)
            End If
            If   datatable.Value("Reg_Temp",sheetName1) <> "" Then        
               .PSFrame("Personal Data").WebList("JOB_REG_TEMP$0").Select  datatable.Value("Reg_Temp",sheetName1) 'add  script on 16-03-10
            End If
            If datatable.Value("Emp_class",sheetName1) <> "" Then        
               .PSFrame("Personal Data").WebList("JOB_EMPL_CLASS$0").Select datatable.Value("Emp_class",sheetName1) 'add  script on 16-03-10
            End If
            .PSFrame("Personal Data").Link("Payroll").Click
            .PSFrame("Personal Data").WebEdit("JOB_PAYGROUP$0").Set  datatable.Value("PayGroup" , sheetName1)
            .PSFrame("Personal Data").WebEdit("JOB_TAX_LOCATION_CD$0").Set datatable.Value("Tax_LocCd" , sheetName1)
            .PSFrame("Personal Data").Link("Compensation").Click
            .PSFrame("Personal Data").WebEdit("COMPENSATION_COMP_RATECD$0").Set  datatable.Value("Comp_Ratecd" , sheetName1)
            .PSFrame("Personal Data").WebEdit("COMPENSATION_COMPRATE$0").Set  datatable.Value("Comp_Rate" , sheetName1)
            .PSFrame("Personal Data").WebButton("Calculate Compensation").Click
            .PSFrame("Personal Data").WebButton("OK").Click
            .PSFrame("Personal Data").WebButton("OK").Click
            'Script to capture the system generated EMPLID and save it to datatable
            EMPLID = .PSFrame("Personal Data").WebElement("Add the Relationship").GetROProperty("innertext")
            datatable.Value("EMPL_ID",sheetName1) = EMPLID
        End With

   'End If    'comment ed on 03/15

    next
    'Script to signout
    .Page("Add a Person").PSFrame("Tool Bar Header").Link("Sign out").Click
End With
   'Script to export the data to excel sheet
    Datatable.ExportSheet sheetPath,sheetName1
Reply
#6
Not Solved
@Everyone - Please wrap your codes using proper tags to make your post more readable (I have edited the above post, used tags). For more details on tags refer help.

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Collecting Objects And Object State At Runtime zunebuggy 3 1,717 11-22-2017, 02:37 PM
Last Post: supputuri
  How to add all objects manually in object repository rajaselvan.d 2 12,658 10-10-2014, 05:08 PM
Last Post: nivedita
  Taking Property values in Description objet throw Excel Sheet devarapallliramana 3 3,110 03-11-2014, 10:50 PM
Last Post: supputuri
  error with msdn's description of overwrite value of CreateTextFile ?? anu05446 1 2,591 03-10-2014, 02:48 PM
Last Post: basanth27
  User defined Objects(Can't map standard grid object in to table object ) madhavanr 0 2,594 01-14-2014, 03:46 PM
Last Post: madhavanr

Forum Jump:


Users browsing this thread: 1 Guest(s)