Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not working if not hard coded (web link).click
#1
Not Solved Sad 
I'm new to QTP and I'm just trying to click a link in a web page and the "Click" only works if is hard coded. If I try to run [variable].click I receive the following error:
Object required: 'Browser("Main").Page'

Function file: Z:\KDF2\Function Library\FunctionLibrary.vbs
Line [170];"
control_object.click".


Code:
            Select Case sAction

            Case "Click_Link"
                 '   control_object = Browser("Main").Page("Main").Link("Members")    '<<--<<-- CONTROL_OBJECT VALUE
                    'Browser("Main").Page("Main").Link("Members").click '<<--<<-- HARD CODED RAN WITHOUT PROBLEM.
                control_object.click
Reply
#2
Not Solved
Try to use similar as given below:
Code:
control_object=trim(control_object)
Execute(trim(control_object & ".Click"))
Reply
#3
Not Solved
Please use the "Set" keyword when creating object references.The code below should work.
Code:
Set  control_object = Browser("Main").Page("Main").Link("Members")
control_object.click
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Child Object Not able to identified in Web Menu Link noor 0 1,621 01-21-2018, 04:44 PM
Last Post: noor
  how to randomly Select any category link and randomly click on one of its options ? sharavan 0 2,815 11-18-2014, 12:24 AM
Last Post: sharavan
  How to click on a dynamic link on a website Geekgirl 3 4,212 11-28-2013, 11:53 AM
Last Post: Jay
  How to find which value is having link and which are all not having in Web table. Sivakumar2186@gmail.com 2 3,165 10-17-2013, 09:36 PM
Last Post: Parke
  Unable to Click on Mutiple Links in Web Table branjitk 6 4,507 06-12-2012, 05:49 PM
Last Post: sshukla12

Forum Jump:


Users browsing this thread: 1 Guest(s)