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
#1
Not Solved
Am trying to autoamte the web application and in the same in one of the steps haveto click on the Username link and the username is unique for each customer,

Username mailAddress ID Name Phone Number
Smith smith@gmail.com 123789 smithg -

Based on the Id search we were on the above page so here have to automate to click the username(Contains href) and have to proceed to another page
Every time user changes and QTP failing by object is not found in repositry - yes true every time objects changes based on ID search and here is my code.

Code:
Browser("Browser").Page("Page").WebButton("Yes I Am!").Click

Browser("Browser").Page("Page").Frame("toolbar").Link("Customer Search").Click

Browser("Browser").Page("Page").Frame("workarea").WebEdit("v_value").Set "03478921683"
wait 2
Browser("Browser").Page("Page").Frame("workarea").WebButton("Search").Click
Browser("Browser").Page("Page").Frame("workarea_2").Link("Smith").Click---------------------------------> object name Smith
Browser("Browser").Page("Page").Frame("workarea_3").WebButton("View Services").Click

So please help our here.

Thanks,
Saisu
Reply
#2
Not Solved
Hi,
In the object repository , use .* for the property(inner text) holding the customer name.

If this doesn't help please post the object spy snapshot of teh link.

Regards,
Ravi
Reply
#3
Not Solved
Hi Ravi,

Many thanks for your quick response
I skipped that from my requirement didn't try that

I stucked here please help me
When i searched with ID if it returns 0 records it has give amssg box and it's not giving properly ie on the page it showing 0 records however it is going to else loop -my logic should be if 0 records it has to exist loop and procced for the next steps if search returns 1 record take me to prevoius step ie customer search page ...

And each and every time it has to check the records count 0 or 1

and my code is here

Code:
Browser("Browser").Page("Page").Frame("workarea").WebEdit("v_value").Set "0125672348"

Browser("Browser").Page("Page").Frame("workarea").WebButton("Search").Click

after clicked on the page got the page and the page contains text like 0 records returned

so i write code like

Code:
if result="0 records returned" Then
msgbox"Please procced to build"
Else
result="1 records returned"
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 "03245678912"
End If

And my logic should be each and every time after click on search it has to check every time for records whether 0 or 1 and based on that it has exit the loop and has procced .....

Any clue help me

Thanks,
Saisu
Reply
#4
Not Solved
can u try the below code...

Do

Code:
Browser("Browser").Page("Page").Frame("workarea").WebEdit("v_value").Set "XYZ"
      Browser("Browser").Page("Page").Frame("workarea").WebButton("Search").Click
    
      'get the msg from the webpage
     '‘this will be the msg which u get after hitting search
      'plz update webelement(“”).GetROProperty(“innertext”) accordingly. Spy and see which  
      'object it is and update the code

    strResultMsg= Browser("Browser").Page("Page").Frame("workarea").webelement("ObjectName>").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 "XYZ"
          Browser("Browser").Page("Page").Frame("workarea").WebButton("Search").Click
          strResultMsg= Browser("Browser").Page("Page").Frame("workarea").webelement("").GetROProperty(“innertext”)
      End If
Loop Until strResultMsg="0 records returned"

Do let me know if it works.

Regards,
Ankesh
Reply
#5
Not Solved
Hi Ankesh,

I tried however am getting error .And am attaching the screen shot for my spy .

Please show me a path to get progress on this

Advance thanks.

Thanks,
Saisu


Attached Files
.doc   Doc1.doc (Size: 144.5 KB / Downloads: 64)
Reply
#6
Not Solved
I saw the screenshot..

u r using
Code:
strResultMsg= Browser("Browser").Page("Page").Frame("workarea").webelement("ObjectName>").GetROProperty("0 records returned")

which is wrong.

Plz use the innertext property. Plz replace the code at line 74 and line 85 with the below code...

Code:
strResultMsg= Browser("Browser").Page("Page").Frame("workarea").webelement("Search").GetROProperty("innertext")


Regards,
Ankesh
Reply
#7
Not Solved
Hi Ankesh,

Tried and i got the below error
The "Search" 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 (72):
Code:
"strResultMsg= Browser("Browser").Page("Page").Frame("workarea").webelement("Search").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.

Thanks,
Saisu
Reply
#8
Not Solved
Saisu,

That error means you have not added the object into the Object Repository. Please add the object to OR. I got that name from the attchment you have provided. So i have given you the code. Please add the object and re execute.

Regards,
Ankesh
Reply
#9
Not Solved
Hi Ankesh,

It's already there in OR please find the screenshot for the same .

If my understanding is wrong coreect me

Thanks,
Saisu.


Attached Files
.doc   Doc1.doc (Size: 135.5 KB / Downloads: 65)
Reply
#10
Not Solved
Saw the screenshot. The one you have highlighted is a WebButton.

Where as in the below code which we are using is WebElement. This the object which u get when you hit Search.

I mean this object will hold the value "0 records returned" or "1 records returned".

Plz add the object which dispalys the above msg to OR and use the Same name, as in OR, in the below code in place of ResultMsgObjectName.

Code:
strResultMsg= Browser("Browser").Page("Page").Frame("workarea").webelement("<ResultMsgObjectName>").GetROProperty("innertext")".


Regards,
Ankesh
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  ActiveX component can't create object: 'JavaWindow' JayeshK 0 1,467 01-07-2021, 01:12 PM
Last Post: JayeshK
  Create Terminal as object dapeamel 0 2,956 02-16-2018, 07:09 PM
Last Post: dapeamel
  object spy not recognizing object.. pleaseeeee help Sonia Sadeque 3 3,166 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 3,468 10-28-2015, 12:34 PM
Last Post: vinod123
  Object identified despite having no information mjt 1 1,898 09-14-2015, 08:25 PM
Last Post: mjt

Forum Jump:


Users browsing this thread: 1 Guest(s)