Micro Focus QTP (UFT) Forums
qtp object is not getting correct value - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: qtp object is not getting correct value (/Thread-qtp-object-is-not-getting-correct-value)



qtp object is not getting correct value - satheshkumar - 12-05-2009

hi,
i am new in QTp, i have small doubts, here i mentioned my play back script
Code:
Browser("Project Management - Mindlogic").Page("Project Management - Mindlogic_7").WebList("member").Select "111510BLR - Prathab(0)"
my problem is, same script is running in qtp, it's throwing error is " Cannot identify the specified item of the member object. Confirm that the specified item is included in the object's item collection."

condition is : That the Prathab(0) value is not getting because every time we submit the value in database automatically Prathab(x) value is incremented. how we use the script? please reply me.

i need step by step instruction please


RE: qtp object is not getting correct value - Saket - 12-07-2009

try using the index of items in the weblist
Code:
Browser("Project Management - Mindlogic").Page("Project Management - Mindlogic_7").WebList("member").Select #1



RE: qtp object is not getting correct value - satheshkumar - 12-07-2009

it's throwing syntax error


RE: qtp object is not getting correct value - sreekanth chilam - 12-07-2009

Hi Sathesh,

Try with the below way & implement accordingly.


Code:
Expected_Member_Input="111510BLR - Prathab"
  
  Items_count=Browser("Project Management - Mindlogic").Page("Project Management - Mindlogic_7").WebList("member").GetROProperty("Items count")
For i=1 to Items_count
   Act_Member=trim(Browser("Project Management - Mindlogic").Page("Project Management - Mindlogic_7").WebList("member").GetItem(i))
   if (instr(1,Act_Member,Expected_Member_Input)>0) then
       Browser("Project Management - Mindlogic").Page("Project Management - Mindlogic_7").WebList("member").Select Act_Member
       Exit for  
   End if  
Next