SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Aug 2006
    Location
    london
    Posts
    26
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Parameterise the Cell data for a SWFTable Object

    Hi

    I am in need of help for parameterising the cell coordinates. Instead of the coordinated I would like to read by name in the cell.

    In breif the actions on my application are 1. double click on a particular security(cell data) to open that security properties window.

    I am looking to pass the name of the security from the external data file say excel sheet.

    When I double click on the pointed security , it opens the below screen”Security properties”. Below is the code to open the “Security properties window”.

    SwfWindow(”InvestmentManager – Automation”).SwfWindow(”Targeter – CDO Fund”).SwfTable(”preTradesGrid”).SelectCell 17,1

    But during replay QTP is doing nothing other than just highlighting the cell without opening the security properties window.

    But If I replaced the “SelectCell” with “Activatecell” method QTP is opening the Security properties window which is fine. But I want to open the “Security properties window” based on the names which will be read from external data file(say excel) in cells rather than the coordinates.

    Ex: SwfWindow(”InvestmentManager – Automation”).SwfWindow(”Targeter – CDO Fund”).SwfTable(”preTradesGrid”).ActivateCell “Liability 20071215” where in the
    “Liability 20071215” needs to read from the external data file.

  2. #2
    Member
    Join Date
    May 2007
    Posts
    75
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Parameterise the Cell data for a SWFTable Object

    Hi Maruthi,

    Please try this

    Rows = SwfWindow(”InvestmentManager – Automation”).SwfWindow(”Targeter – CDO Fund”).SwfTable(”preTradesGrid”).RowCount

    For i= 1 to Rows

    RowVal = SwfWindow(”InvestmentManager – Automation”).SwfWindow(”Targeter – CDO Fund”).SwfTable(”preTradesGrid”).GetCellData(i,1)
    If RowVal = RequiredText Then

    SwfWindow(”InvestmentManager – Automation”).SwfWindow(”Targeter – CDO Fund”).SwfTable(”preTradesGrid”).ActivateCell(i,1)

    End If

    'RequiredText this the value you enter from excelfile

  3. #3
    Junior Member
    Join Date
    Aug 2006
    Location
    london
    Posts
    26
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Parameterise the Cell data for a SWFTable Object

    Hi Ujwal

    Thank you for the supplied code. I tried your code but no luck which is a different issue. With regard to your query if we make the column constant in this case"1" , is it going to help me else I need to parametarise the column as well.

    Also I am trying to use "datatable.value("name", "runsheet")" in place of "RequiredText" where "name" is the column name and "runsheet" is the name of the external data file.


    Please leave your thoughts with the above two issue, that would be much appreciated.

    As i am having difficulty with attachment please advise your mail id if thats ok with you for the RO and TO properties and methods.

    Thanks again
    maruti

  4. #4
    Junior Member
    Join Date
    Aug 2006
    Location
    london
    Posts
    26
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Parameterise the Cell data for a SWFTable Object

    Hi Ujwal
    Finally I managed to get the solution.

    Below is the code and I also I acknowledge that your code is the origin for the solution.

    Thanks a lot.
    Public Function GetCellIndexByText (obj, Text)

    Redim Indexes(1)

    RowCount = obj.Object.Rows

    ColumnCount = obj.Object.Cols

    For i = 0 to RowCount -1

    For j = 0 to ColumnCount-1

    Data=obj.GetCellData(i,j)

    If Data = Text Then

    Indexes(0) = i

    Indexes(1) = j

    GetCellIndexByText = Indexes

    Exit Function

    End if

    Next

    Next

    Indexes(0) = -1

    Indexes(1) = -1

    GetCellIndexByText = Indexes

    End Function



    ' Register the function for use with the SwfTable object

    RegisterUserFunc "SwfTable", "GetCellIndexByText", "GetCellIndexByText"



    cell = SwfWindow("InvestmentManager - Automation").SwfWindow("Targeter - CDO Fund").SwfTable("preTradesGrid").GetCellIndexByTex t("Liability 20071215")



    If cell(0) <> -1 Then

    SwfWindow("InvestmentManager - Automation").SwfWindow("Targeter - CDO Fund").SwfTable("preTradesGrid").ActivateCell cell(0),cell(1)

    Else

    msgbox "Cell not found"

    End If

 

 

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.54%
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 01:43 PM.

Copyright BetaSoft Inc.