Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
getting error while trying to check all the links in the webpage ???
#1
Not Solved Sad 
based on search keyword in anysearch site say google ...
trying to retrieve the total number of links present in that webpage and Check all the links in that web page .

i have used the below code for this but getting error saying "expected expression" in line numbers 4,9,10,17,19
Code:
Browser("google").Page("google").WebEdit("what").Set "plumbers"
Browser("google").Page("google").Image("btnG").Click 32,22

   Set oDesc = Description.Create()
[b]  oDesc(”html tag”).Value = "A"[/b]
   Set rc = Browser("google").Page("google").ChildObjects(oDesc)
   lnknum = rc.Count()
For j =0 to lnknum-1
     Set rc = Browser("google").Page("google").ChildObjects(oDesc)
     [b]tag = rc(j).GetROProperty(”innertext”)[/b]
     [b]href = rc(j).GetROProperty(”href”)[/b]
     Browser("google").Page("google").link(""&tag).click
     Browser("google").navigate(href)
      Browser("google").Page(""&tag).Sync
     Browser("google").Back
'check if the navigated page is equivalent to targetted page
  [b]orgPage =Browser("google").GetROProperty(”innertext”)[/b]
  
If tag = orgPage Then
          [b]Reporter.ReportEvent 0, “Navigated To Correct Page”,""&tag 'Reports if correct [/b]
     else
          Reporter.ReportEvent 1,""&tag,""&orgPage
   End If

next



mainly i think line 4 is wrong ...
can anyone pls correct me ...

Thanks
Navya
Reply
#2
Not Solved
mmhhh.. one question: sure of your double quotation marks?
I have tried to copy-paste your code on QTP, and the result for line 4 is:
oDesc( html tag ).Value = "A"
It seems that your italic double quotation marks are not seen correctly...
Reply
#3
Not Solved
thank you very much ...
your clue has cleared all my errors...
Reply
#4
Not Solved
Hello Stevol,

i was able to perform my desired actions by skipping exceptions occured in the below 2 lines of code .
exception occured is:"object not found in the object repository"(not sure how to overcome this)

Code:
Browser("DexKnows Homepage").Page("DexKnows Homepage").link(""&j).click
Browser("DexKnows Homepage").Page(""&tag).Sync


Please help me out in solving this???
i am not sure what should go in
Code:
browser("").Page("").link(???????????).click      ??

Thanks
Navya
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Check the word and get no. of times that word in the webpage Sandeep.san229 0 1,156 10-31-2018, 06:42 PM
Last Post: Sandeep.san229
  Capture All text from webpage and copy it... mpatra 3 4,879 07-25-2018, 05:33 PM
Last Post: vimlesh
  Reading XML Data from a WebPage shaan.mishra87@gmail.com 1 2,019 09-28-2016, 09:16 PM
Last Post: supputuri
  Using static descriptive programming how to count no. of objects on any webpage alpha1 4 6,700 08-11-2015, 08:48 PM
Last Post: kotaramamohana
  I want to click on all the links in the webtable. These links are nothing but some co abhideshpande001 0 2,552 07-22-2015, 09:36 AM
Last Post: abhideshpande001

Forum Jump:


Users browsing this thread: 1 Guest(s)