SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 19
  1. #1
    Junior Member
    Join Date
    May 2009
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    DevXpress XtraNavBar with QTP 10

    All:

    This is my first posting here and were are using QTP10 with .NET Addin to automate a .NET Windows Forms enterprise application. We have a sidebar on the left which is a subclassed control from DevExpress.Sidebar. It looks and feels like Outlook in many ways and we have individual bars inside the main control and under each individual bar, there are several links which are of type DevExpress.SideBar.Objects.Links.

    I need to click the individual bars and after they expand, I should click on the individual links. I have been breaking my head to click these. Here is what I have tried and achieved so far:

    1. I was successful in clicking those individual bars using the following code:

    Dim obj, toolsObj, rect
    Set obj = SwfWindow("text1").SwfObject("maincontrol")

    Set toolsObj = obj.Object.Groups.Item(0) 'Tools bar
    Set rect = toolsObj.get_Rect()
    'I found get_Rect() method the hard way by using Test
    'Complete's Object Browser. Very useful application I
    'should say.

    obj.Click rect.X, rect.Y 'This clicks the bar

    2. Next task is to click on those individual links inside Tools bar.

    No matter what I do, I couldn't succeeed. Couple of things:

    The get_rect() for those individual links has X and Y equal to 0, which means I couldn't use this function to click on them.

    There is no selectedLinkItem property which is a big issue. Using Test Complete Object Browser, I was able to see all the methods that the sidebar supports and I tried some but to no avail. For example, based on the posting on DevExpress forum, I did the following:

    Public Sub ClickLink(ByVal devXpressXtraNavBar, ByVal devXpressNavBarLink)

    Dim methodFactory2
    Set methodFactory2 = devXpressXtraNavBar.Object.GetType().GetMethod("ad d_LinkClicked")
    methodFactory2.Invoke devXpressXtraNavBar.Object.GetType(), devXpressNavBarLink
    Wait(2)
    End Sub

    The devXpressNavBarLink is set to the following before calling the sub:

    Dim linkObj
    Set linkObj = toolsObj.Links.Item(2).Item ' Click on the
    'third link in the Tools bar.

    I call the sub like this:

    Call ClickLink(obj, linkObj)

    I also changed the method from "add_LinkClicked" to "RaiseLinkClicked" as suggested in DevExpress forum:

    http://www.devexpress.com/Support/Center/p/B4660.aspx

    The moment I do this, the GetMethod() returns Empty in QTP. God knows why.!!

    I also tried GetTextLocation hoping to get the coordinates but it returns 0 and 0 for Left and Top for some of the links.

    As a last resort, I can do the .NET Extensibility but I don't want to go thru that route.

    Please help me. I just need to programatically click on any individual links thru VBScript in QTP. That is all.

    Thanks.

    qtp_tc

  2. #2
    Senior Member
    Join Date
    Dec 2006
    Posts
    225
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: DevXpress XtraNavBar with QTP 10

    I guess using .Net extensibility would be better.

    The properties can be assigned to the controls in different ways. You might have to check with the developers to get a clear understanding of how it is used in the application.
    Regards,
    Kalesh

  3. #3
    Junior Member
    Join Date
    May 2009
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: DevXpress XtraNavBar with QTP 10

    Is that the only approach? I wanted to push it to the max before I give up. If using .NET extensibility, there is no need to hardcode the coordinates?

    -qtp_tc

  4. #4
    Senior Member
    Join Date
    Dec 2006
    Posts
    225
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: DevXpress XtraNavBar with QTP 10

    As far as I know its the only approach.
    if we use .net extensibility we don't have to hard code the coordinates. We can access the individual items in the control and work on that.

    Attached is a code for the dll which I created for datanavigator control. Hope this will help you.
    Attached Files Attached Files
    Regards,
    Kalesh

  5. #5
    Junior Member
    Join Date
    May 2009
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: DevXpress XtraNavBar with QTP 10

    Thanks for the attachment.

    Do I have to have the DevExpress XtraNavbar runtime on the target machine for my QTP C# server DLL to work? In your code, I'm seeing you are using DevExpress.Utils namespace. Just curious.

  6. #6
    Senior Member
    Join Date
    Dec 2006
    Posts
    225
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: DevXpress XtraNavBar with QTP 10

    In your QTP machine you only need to place the dll which is created.(Rest of the supporting files would be as part of the appln.)
    To build the code and create the dll you will have to install devexpress in the machine in which Visual Studio is installed.
    Regards,
    Kalesh

  7. #7
    Junior Member
    Join Date
    May 2009
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: DevXpress XtraNavBar with QTP 10

    Thanks again.

    I wanted to avoid using Object Repository. Having said that, do I still need to code the IRecord interface or I can bypass IRecord interface but code IReplay interface.

    Please advice.

    qtp_tc

  8. #8
    Senior Member
    Join Date
    Dec 2006
    Posts
    225
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: DevXpress XtraNavBar with QTP 10

    it should be possible.
    It would be good to implement the record logic as everyone will be able to understand the step easily through recording.
    Regards,
    Kalesh

  9. #9
    Junior Member
    Join Date
    May 2009
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: DevXpress XtraNavBar with QTP 10

    I read the doc and it seems to be really confusing. Can you walk me thru real quick on what do I need to get this up and running. I wanted to go with either a XML file or a DLL file.

    -qtp_tc

  10. #10
    Junior Member
    Join Date
    May 2009
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: DevXpress XtraNavBar with QTP 10

    Here is what I'm trying to achieve:

    I pass the name of the group from QTP VBScript to the Custom Server DLL. The custom Server DLL clicks or expands the group.

    I again pass the name of the link from QTP VBScript to the Custom Server DLL. The custom Server DLL clicks on the link.

    Any code examples would be helpful.

    Thx.

    qtp_gc

 

 
Page 1 of 2 12 LastLast

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 11.11%
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 06:32 AM.

Copyright BetaSoft Inc.