Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to handle the dynamic links based on search results…?
#1
Not Solved
I have the following steps in my application…

a) go to login page ,give user id and pwd ‘successfully able to login
b) 2nd page is search page … enter the search item and click on submit then
based on the search item the display Link in the same page varies
now if I click on this link will take to corresponding page.

If my search word is housing it will display as ..
Code:
Browser("XYZ: Login").Page("abcPage").Link("Housing and construction").Click
If my search key is real estate then it will display as
Code:
Browser("XYZ: Login").Page("abcPage").Link("Real Estate").Click
How to parameterize the the link name eg:- Housing and construction/Real Estate in the above statement

I tried using below…
Code:
Str = “Housing and construction”
Browser("XYZ: Login").Page("abcPage").Link(""&Str).Click
Did gave me an error when I change Str=”Real Estate” saying not able to recognize the object


Please can anyone have some solutions how to handle this problem
need it very urgent

Thanks
Navya
Reply
#2
Not Solved
You can use descriptive programming.
Ankur has as excellent post in this site. Check it out.
Reply
#3
Not Solved
Hello niranjan,

I went thru that stuff before posting the query
bit confusing to me and i tried various scenarios from what i understood and couldn't get along .

scenarios which i tried are...( some thing i am missing in the below ones)
scenario 1:-
-----------
Code:
str = Inputbox "enter string for search"
Set lnkSearch = Description.Create. btnSearch(”name“).Value = ""&str
Set brwlink = Description.Create : brwGoogle(”title“).value = "XYZ: Login"
Set pglink = Description.Create : pgGoogle(”title“).value = "abcPage"
Browser(brwlink ).Page(pglink).Link(lnkSearch).Click

scenario2:-
-----------
Code:
str = Inputbox "enter string for search"

Dim obj_desc
Set obj_desc = description.Create
obj_desc("html tag").value= “INPUT”
obj_desc(“name”).value= ""&str


i would be thankful if you can explain me considering my scenario..
the scenario

Thanks
Navya
Reply
#4
Not Solved
Hi Navya,
Can you try with this? :

Code:
str = “Housing and construction”
Browser("XYZ: Login").Page("abcPage").Link("name:="&str).Click

Note: if the QTP still doesn't recognize the link, you can use the "Object Spy" in QTP to get more unique properties to identify the link.

Hope it work Smile
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Can QTP handle slick grid table in a web page qtplearner88 2 4,507 10-01-2019, 10:44 AM
Last Post: shilpi952
  how to select value from google search box dropdown +QTP prajyot 0 2,902 06-28-2017, 06:30 PM
Last Post: prajyot
  I want to click on all the links in the webtable. These links are nothing but some co abhideshpande001 0 2,658 07-22-2015, 09:36 AM
Last Post: abhideshpande001
  How to Handle Modal Dialogs In QTP Jyobtech 0 2,475 07-22-2015, 01:22 AM
Last Post: Jyobtech
  Search and import data from excel under some rules. nwpulele 2 2,919 02-19-2015, 04:10 AM
Last Post: supputuri

Forum Jump:


Users browsing this thread: 1 Guest(s)