SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Jan 2008
    Posts
    63
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Working with DOM

    Hi everyone,

    I have been working on Automation of a web application using DOM objects. It is working very fine if we keep on navigating on a single window.

    I didn't understand how can work in a situation where we click on Submit button or clicked on a link, which opens a new window, how can we set the focus to that new window.

    Thanks in advance,

    Neha.

  2. #2
    Moderator ifraser's Avatar
    Join Date
    Jul 2004
    Location
    Brisbane, Australia
    Posts
    2,090
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Working with DOM

    Why bother with DOM at all?

    QTP has all the functionality required for working with Web objects.
    You can buy my Art from: "Post Cards now available"
    Ian Fraser Landscape Photography
    World Wide Shipping.

    http://mowogman.wordpress.com/

  3. #3
    Junior Member
    Join Date
    Feb 2009
    Location
    Rhone Alpes. Limitrophe Rhone / Ain
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Working with DOM

    Hi
    Start FireFox, load ans install the plugin "FireBug".
    Start your Web App with Firefox and Start FireBug.
    All DOM will appear.
    I understood like That.
    SISKO01
    _______
    J'aime quand ša marche !!!

  4. #4
    Member
    Join Date
    Jan 2008
    Posts
    63
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Working with DOM

    Hey,

    Thanks for reply. I felt like DOM will work more perfectly.

    And I can't use Firefox here.

    Can anyone help with how to set focus on another IE window while working with DOM.

    Thanks
    Neha

  5. #5
    Member
    Join Date
    Aug 2005
    Posts
    119
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Working with DOM

    To focus on the 2nd Internet explorer browser use creation time as 1:
    Browser("micclass:=Browser", "creationtime:=1")

    You can access the DOM elements in this browser document by using the following line:
    Browser("micclass:=Browser", "creationtime:=1").object.document


    To focus on 3rd browser's DOM element use the following line:
    You can access the DOM elements in this browser document by using the following line:
    Browser("micclass:=Browser", "creationtime:=2").object.document

  6. #6
    Senior Member
    Join Date
    Apr 2007
    Posts
    124
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Working with DOM

    you can get switch or set a new reference to different browser by using this function and specifying unique part of the new page url.

    Set newBrowser = getBrowserWindow(ProcessUrl)

    newBrowser.document is your DOM

    '================================================= ====

    Function getBrowserWindow(ProcessUrl)
    On error resume next
    Dim objShell, objShellWindows, blnFound, objIE, strURL
    Set objShell = CreateObject("Shell.Application")
    Set objShellWindows = objShell.Windows
    For i = 0 to objShellWindows.Count - 1
    Set objIE = objShellWindows.Item(i)
    strURL = objIE.LocationURL
    If InStr(strURL, ProcessUrl)Then
    blnFound = True:Exit for
    End If
    Next
    If blnFound Then
    set getBrowserWindow=objIE
    Else
    set getBrowserWindow=nothing
    Reporter.reportevent micWarning,"Get Browser Window", "Unable to capture an opened broweser by part of url :" & ProcessUrl
    Exit Function
    End If
    Set objIE=nothing
    Set objShellWindows = nothing
    Set objShell = nothing
    err.clear
    End Function
    QA automation

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 9.38%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 11:53 PM.

Copyright BetaSoft Inc.