The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:




Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> IBM/Rational Functional Tester - RobotJ

Pages: 1
Nirav Shah
Junior Member


Reged: 04/24/06
Posts: 5
Loc: Atlanta
How to close tabbed browser RFT .Net
      #718333 - 10/18/12 10:04 AM

Hi,

We are using RFT .Net for our scripting.

I used following code that closes the IE browsers successfully if only one tab is open in the IE browser -

Public Sub closeAllWin()
Try
Dim objBrows As BrowserTestObject
objBrows = getBrowserObjNoWait()
While Not objBrows Is Nothing
objBrows.Close()
objBrows = getBrowserObjNoWait()
End While

Catch rte As RationalTestException
LogWarning("Rational Exception: " + rte.ToString() + " closeAllWin() Function")
Catch ex As Exception
LogWarning("Exception: " + ex.ToString() + " closeAllWin() Function")
End Try
End Sub


Public Function getBrowserObjNoWait() As BrowserTestObject
Dim objects As TestObject()
Dim root As RootTestObject
Try
root = GetRootTestObject()
If Not root Is Nothing Then
objects = root.Find(AtChild(".class", "Html.HtmlBrowser"))
'objects = root.Find(AtChild(".class", "IEFrame"))
If (objects.Length <> 0) Then
Return New BrowserTestObject(objects(0))
End If
End If
Catch rte As RationalTestException
LogWarning("Rational Exception: " + rte.ToString() + " - getBrowserObj() Function")
Catch ex As Exception
LogWarning("Exception: " + ex.ToString() + " - getBrowserObj() Function")
End Try
Return Nothing
End Function


When I have multiple tabs opened, this code is not closing the browsers. Appreciating your suggestion.

--------------------
Thanks,
Nirav Shah


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 8 anonymous users are browsing this forum.

Moderator:  AJ, AllenGay 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 2216

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5