Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hepl required to dyanamically identified username and create the object in object rep
#11
Hi Ankesh,

Added the customer search results in OR still getting same error

The "Customer Record Search Results" object was not found in the Object Repository.
Check the Object Repository to confirm that the object exists or to find the correct name for the object.

Line (73):
Code:
"strResultMsg= Browser("Browser").Page("Page").Frame("workarea").WebElement("Customer Record Search Results").GetROProperty("innertext")".
Tip: If the objects in your application have changed, the Maintenance Run Mode can
help you identify and update your steps and/or the objects in your repository.

Attached screen shot too.


Attached Files
.doc   Doc1.doc (Size: 286 KB / Downloads: 143)
Reply
#12
Hi Ankesh,

Now am not getting the error i added OR in workarea_2 and updated code as like below.

Code:
strResultMsg= Browser("Browser").Page("Page").Frame("workarea_2").WebElement("Customer Record Search").GetROProperty("innertext")

Now the problem is ... in the page it showing 0 records am not getting mssgbox prompts seems loops is not working...

Am running on debug mode

Code:
strResultMsg= Browser("Browser").Page("Page").Frame("workarea_2").WebElement("Customer Record Search").GetROProperty("innertext") .... F11 cursor moving to If strResultMsg ="0 records returned" Then F11 cursor moving to Elseif strResultMsg="1 records returned" Then F11 cursor moving to End If Loop Until strResultMsg="0 records returned" F11 cursor moving to strResultMsg ="0 records returned" Then loops not working please help me Am pasting the code once again Do Browser("Browser").Page("Page").Frame("toolbar").Link("Customer Search").Click Browser("Browser").Page("Page").Frame("workarea").WebEdit("v_value").Set GEOVoIPnumber Browser("Browser").Page("Page").Frame("workarea").WebButton("Search").Click strResultMsg= Browser("Browser").Page("Page").Frame("workarea_2").WebElement("Customer Record Search").GetROProperty("innertext") 'chk for the message If strResultMsg ="0 records returned" Then msgbox"Please procced to build" Exit Do ' Exit the loop Elseif strResultMsg="1 records returned" Then msgbox"Number Already exists in " Browser("Browser").Page("Page").Frame("toolbar").Link("Customer Search").Click Browser("Browser").Page("Page").Frame("workarea").WebEdit("v_value").Set GEOVoIPnumber Browser("Browser").Page("Page").Frame("workarea").WebButton("Search").Click strResultMsg= Browser("Browser").Page("Page").Frame("workarea_2").WebElement("Customer Record Search").GetROProperty("innertext") End If Loop Until strResultMsg="0 records returned"





And my innertext contains so much data just we need 1 OR record can i use regular expression in inner html .

Please have look and show the way for issue solution

Thanks,
Saisu
Reply
#13
Can u plz Spy the object and check that "0 records returned" msg is reflecting under which property of the object?

The reason that u r not getting the msgbox prompt may be that the innertext property holds some other value.

Plz paste the scpy window screenshot for the object.

Regards,
Ankesh
Reply
#14
in your repository WebElement("Customer Record Search Results") is a child of workarea_2 and in script you have mentioned workarea. So use below line:

Code:
strResultMsg= Browser("Browser").Page("Page").Frame("workarea_2").WebElement("Customer Record Search Results").GetROProperty("innertext")"
Reply
#15
Hi Ankesh,

Yes the inner textis having the "customer search " it should have 0 or 1 record search .... how can i change the value will come as part of running the test ... my doubt is if i changed to 0 record search and what will happen if it is having 1 record search .

Attached spy screen shot

Thanks,
Saisu


Attached Files
.doc   Doc1.doc (Size: 178.5 KB / Downloads: 138)
.doc   Doc1.doc (Size: 312.5 KB / Downloads: 133)
Reply
#16
Hi Saisu,


Got the problem. You object has large text with the expected msg in it. something like [xyzvjhjgjhhjh "O Records Found" hsgfjhskh]

I have modified the code accordingly.

Can you please tell me from where are you picking the value for GEOVoIPnumber. Does it change everytime?

if not.. use the below code......

'-------------------------------CODE--------------------------------
Code:
intFlag = 0 Do Browser("Browser").Page("Page").Frame("toolbar").Link("Customer Search").Click Browser("Browser").Page("Page").Frame("workarea").WebEdit("v_value").Set GEOVoIPnumber Browser("Browser").Page("Page").Frame("workarea").WebButton("Search").Click strResultMsg= Browser("Browser").Page("Page").Object.innertext 'chk for the message If Instr(strResultMsg,"0 records returned")>0 Then msgbox"Please procced to build" Exit Do ' Exit the loop intFlag =1 End If Loop Until intFlag =1

'-------------------------------END------------------------------------

If you need to change the value of GEOVoIPnumber every time the above code will work with slight modification.

Code:
intFlag = 0 Do Browser("Browser").Page("Page").Frame("toolbar").Link("Customer Search").Click ‘-------- Put your code here to fetch the next value of GEOVoIPnumber----------- ‘ Code to fetch the value of GEOVoIPnumber ‘------------------------------------------------------------------------------- Browser("Browser").Page("Page").Frame("workarea").WebEdit("v_value").Set GEOVoIPnumber Browser("Browser").Page("Page").Frame("workarea").WebButton("Search").Click strResultMsg= Browser("Browser").Page("Page").Object.innertext 'chk for the message If Instr(strResultMsg,"0 records returned")>0 Then msgbox"Please procced to build" Exit Do ' Exit the loop intFlag =1 End If Loop Until intFlag =1


I hope this will work for you this time.

Regards,
Ankesh
Reply
#17
Hi Ankesh,

Am taking these Geonumbers from excel and each and every time it varies ......

If it returns 0 have to do one task and if it returns 1 have to do one task .
After completing the tasks and will get the another Geo from excel and again it has to search and based on the result it has to proceed and then thrid geo from excel.
Code for to get the required data is =====

GEOVoIPnumber=mysheet.cells(i,8).value ====

Tried the above code and got the below error

Object doesn't support this property or method: 'Browser(...).Page(...).Object.innertext'

Line (76): "strResultMsg= Browser("Browser").Page("Page").Object.innertext".


Thanks,
Saisu
Reply
#18
Hi Ankesh,

Now am not getting the error however loops are not working now also

i updated the code to
Code:
strResultMsg= Browser("Browser").Page("Page").Object.body.innertext

Loops are not working .
Code:
intFlag = 0 Do Browser("Browser").Page("Page").Frame("toolbar").Link("Customer Search").Click GEOVoIPnumber=mysheet.cells(i,8).value Browser("Browser").Page("Page").Frame("workarea").WebEdit("v_value").Set GEOVoIPnumber Browser("Browser").Page("Page").Frame("workarea").WebButton("Search").Click strResultMsg= Browser("Browser").Page("Page").Object.body.innertext 'chk for the message If Instr(strResultMsg,"0 records returned")>0 Then msgbox"Please procced to build" Exit Do ' Exit the loop intFlag =1 End If Loop Until intFlag =1---------- Not working.

Thanks,
Saisu.
Reply
#19
GEOVoIPnumber=mysheet.cells(i,8).value is wrong as there is no such variable 'i' we are using. So there wont be any value in variable i. So the above statement wont work. I would suggest that if you are not clear with the concept of loops, plz refer to QTP help.

Plz let me know where you have kept the data which you would be incrementing and using as search value.

Regards,
Ankesh

Reply
#20
Hi Ankesh,

The Geo number is taking from the excel sheet every time and no proble m with that ....And i used your above with out changing of number however no luck the cursor is not at all touching the loops seems the problem with the grepping the innertext i guess.

Thanks,
Saisu
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  ActiveX component can't create object: 'JavaWindow' JayeshK 0 2,303 01-07-2021, 01:12 PM
Last Post: JayeshK
  Create Terminal as object dapeamel 0 3,680 02-16-2018, 07:09 PM
Last Post: dapeamel
  object spy not recognizing object.. pleaseeeee help Sonia Sadeque 3 4,207 12-22-2016, 02:42 PM
Last Post: ishan.mahajan@adp.com
  When trying to recognize the object in QTP, each object is recognized as “WinObject:S geetasarvadnya 2 4,398 10-28-2015, 12:34 PM
Last Post: vinod123
  Object identified despite having no information mjt 1 2,585 09-14-2015, 08:25 PM
Last Post: mjt

Forum Jump:


Users browsing this thread: 1 Guest(s)