Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to close the new browser - when clicked on attachment
#2
Solved: 11 Years, 3 Months, 2 Weeks ago
Hi Kishore,

I would suggest you to go with the below way.

Step1: Create a Description object for "Browser" object class and Retrieve the Active browser count after clicking on the image/text files.
Step2: Use the loop > iterate thru the loop and retrieve the Browser property "Name" value using GetROProperty.
Step3: Use Instr function to search for the expected filename content in the entire Browser Name > once it is found > close the current browser > Exit out of the Loop

Code will be something like this as given below :

Code:
Expected_FileName="test Image file Filename"    
   Set br=description.Create
   br("micclass").value="Browser"

   Set br_collection=Desktop.ChildObjects(br)
   br_count=br_collection.count-1
  
    For i=0 to br_count
         Current_brName=br_collection(i).GetROProperty("Name")
            If (instr(1,Current_brName,Expected_ImageFileName)>0) then
                  br_collection(i).close
           Exit for
            End if  
    Next

It would work fine as you expected Smile
Reply


Messages In This Thread
RE: Unable to close the new browser - when clicked on attachment - by sreekanth chilam - 05-19-2010, 01:54 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Unable to Close UFT 14.53 through AOM Object y.srihari 1 2,367 12-26-2019, 08:43 PM
Last Post: y.srihari
  Using UFT 14.0 on Win 10, unable to find 'Register New Browser Control' utility soujanya 2 3,195 04-23-2018, 07:24 PM
Last Post: soujanya
  UFT 12.0 is unable to identify the java Applet on Safari browser(MAC OS) Mahesh Kolla 0 2,745 05-29-2014, 12:49 PM
Last Post: Mahesh Kolla
  Close Tab Recognizes GetROProperty. WHY??? Ayesha 5 4,074 07-24-2013, 10:39 AM
Last Post: vinod123
  How to find the latest modified file in QC11 current test attachment using QTP10 shiv.cse 0 1,874 07-23-2013, 01:25 AM
Last Post: shiv.cse

Forum Jump:


Users browsing this thread: 3 Guest(s)