SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 8 of 8
  1. #1
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Testing Java table using Team test 2001..

    User Priyadarsi Rath (rpriya@wilco-int.com.nospam) posted:

    Priyadarsi
    This message is confidential and may also be legally privileged. If you are not the intended recipient, please notify us immediately. You should not copy it or use it for any purpose, not disclose its contents to any other person. The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of Wilco International

    ---

  2. #2
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Testing Java table using Team test 2001..

    User Priyadarsi Rath (rpriya@wilco-int.com.nospam) posted:

    any body has any idea about the capturing of the java table values. i am not
    able to capture the right value in the recognition string.

    Priya


    This message is confidential and may also be legally privileged. If you are not the intended recipient, please notify us immediately. You should not copy it or use it for any purpose, not disclose its contents to any other person. The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of Wilco International

    ---

  3. #3
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Testing Java table using Team test 2001..

    User Schoen, Torsten 3865 PPE-QA1 (Torsten.Schoen@de.heidelberg.com.nospam) posted:

    Hi,

    are you sure you have your computer switched on?

    I have many ideas, but you'll need to be more specific in your question to
    get a good answer. Also you can search the archives at http://www.dundee.net/sqa/ for that topic. THere have been several occasions
    that this has been covered in depth.
    Show us what you have done so far, and we might be able to point you into
    the right direction. But don't expect us to put more effort into your
    problem than you do yourself!

    Regards,

    Torsten Schoen
    PPE-QA1
    Heidelberger Druckmaschinen AG

    **Don't take this personal, it's just that there have been a whole lot of
    mails like yours in the past. So ask qualified question to get qualified
    answers!**

    ---

  4. #4
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Testing Java table using Team test 2001..

    User Priyadarsi Rath (rpriya@wilco-int.com.nospam) posted:

    Hi,

    This is the actual problem i am currently facing.

    I am trying to test a java GUI using rational team test 2001.
    In the java table that I am trying to test, there are 4 columns and 3 rows
    and I want to retrieve the value in column4 and row1.
    On recording this value, i get the string:

    JavaTable Click, "JavaCaption=UPM - Workbench;\;Type=JavaTable;Index=1",
    "StartColTitle=E;Row=1;Coords=21,6"

    but in rational help it has been mentioned that the recording of these type
    of cases should be like this:

    JavaTable Click, "Type=JavaTable;Index=1", "StartColTitle=Last
    Name;ColTitle=Favorite Number;Value=2;Coords=36,10".

    But the tool doesn't retrieve the table recognition as specified in SQA Help
    above.

    The main purpose of testing this is to verify the values in the java table.
    if i record the object properity of that particular cell then robot records
    all the valid properities like width/height but is not able to capture the
    displayed value.
    so how can i capture that value and play back.

    Any help in this matter will be highly appreciated.

    Thanks

    Priya


  5. #5
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Testing Java table using Team test 2001..

    User Schoen, Torsten 3865 PPE-QA1 (Torsten.Schoen@de.heidelberg.com.nospam) posted:

    Hi Priya,

    here is some advice that I have to offer, others might be able to provide
    even more. It has been a while since I last had to deal with Java tables, so
    you will still have to try it out.

    First some information regarding the name recognition of java components. We
    have made the experience (with JDK1.3 and swing components) that the object
    names would only be recognized if they started with a dot. So if you have a
    "Favorite Number" table your name property should read ".Favorite Number".
    This is something your developers have to do for you. This greatly increses
    the readibility and reliability of the code, especially early on in the
    development process.

    In regard to the data from the table we had no success at all to retrieve
    the data directly, so we had to program a workaround for that. The data from
    the table can be retrieved with the object data VP, but this does not give
    you direct access to the individual cells. So this is what we did to work
    around this:

    Turn logging off
    Do a object data VP that will fail
    Turn logging on
    Read the failed VP data into an array
    access the individual data cells via the array indices

    How to get to the failing VP data differs a little with the different
    versions of Teamtest. Below is some code that a co worker has done for that,
    but which isn't used anymore (we don't have any java tables that are
    accessible with that anymore). this is the line that gives you the directory
    of the failed VP:
    DataDir = Dirname(SQAVpGetActualFilename(VP, "grd"))

    Hope this helps,

    Torsten Schoen
    PPE-QA1
    Heidelberger Druckmaschinen AG

    ################################################## ###

    Function ReadTableVals(Recognition, Vals() as String) as Integer
    ' ReadTableVals takes the recognition string of a java table as the first
    ' parameter. Second parameter is an array of strings in which the rows of
    ' the java table are returned. The return value is either True or False.
    dim result as Integer
    dim DataFilename as String
    dim Baseline as Integer
    dim textline as string
    dim DataDir as String
    dim found as integer
    dim count as Integer
    dim i%
    dim InFile as Integer
    const VP as String = "JavaTable"

    ' first, try to select the application window
    ' if not possible, return False

    if not SelDelta then
    SQAConsoleWrite "fatal error: application window not present."
    ReadTableVals = False
    Exit Function
    end if

    ' here, the javatable is compared against an empty table stored in the
    verification
    ' point JavaTable. The verification point is expected to fail. A baseline
    file will
    ' be created.
    Result = JavaTableVP (CompareData, "JavaCaption=" + ProductStr +
    ";\;Type=JavaTable;Index=1", "VP=" & VP & ";Wait=0,1;ExpectedResult=FAIL")
    Window ResetTestContext, "", ""

    SelDelta
    found = 0
    ' try to read property "rowCount" to get the number of rows in the table
    ' including the header line
    Result = SQAGetPropertyAsString(Recognition, "rowCount", count)

    if Result <> 0 then
    ' property could not be read -> exit
    ReadTableVals = False
    exit Function
    end if

    if count=0 then
    ' no lines in table
    ' reset rows and set return value to true
    redim JavaRows(0)
    ReadTableVals = True
    exit function
    end if

    ' now it's sure that the table contains some rows
    ' resize array Vals to be able to include all rows but the header line
    redim Vals(count-1)

    ' Find the directory where the baseline files are saved
    DataDir = Dirname(SQAVpGetActualFilename(VP, "grd"))

    ' Delete all old files (should be safe because the filenames contain
    ' the name of the script)
    DataFilename = dir(Datadir + "\" + Skriptname + "." + VP + ".act*.grd")
    while DataFilename <> ""
    kill(DataDir + "\" + DataFilename)
    DataFilename = dir()
    wend

    ' Because the verification point below is expected to fail LogOutput is
    ' suspended to prevent the verification point from beeing shown should not
    be shown as ' failed in the log. the verification point has to fail and
    then the contents of
    ' the table are saved in a beseline file.
    SQASuspendLogOutput
    Window SetTestContext, "Caption=" + ProductStr, ""
    Result = JavaTableVP (CompareData, Recognition, "VP=" + VP +
    ";Wait=0,0;ExpectedResult=Pass")
    Window ResetTestContext, "", ""
    SQAResumeLogOutput

    ' now the contents of the table are saved in a baseline file
    ' all old files have been deleted, so it should be the only one now
    DataFilename = dir(Datadir + "\" + Skriptname + "." + VP + ".act*.grd")
    if DataFilename <> "" then
    ' file has been found
    if dir() = "" then
    'next dir() gives an empty string means this is the only baseline file
    InFile = FreeFile
    open Datadir + "\" + Datafilename for input as #InFile
    ' discard header line
    line input #InFile, textline
    ' store all other lines in Vals()
    for i = 0 to count-1
    line input #InFile, textline
    ' lines are trimmed, maybe this should not be done in the future
    Vals(i) = trim$(right$(textline,len(textline)-1))
    next i
    close #Infile
    else
    ' next dir() returns another file -> more than one baseline file
    ' this is a fatal error
    msgbox "Error: Found at least two d"
    ReadTableVals = 0
    exit function
    end if
    end if
    ' everything ok, rows are stored in Vals()
    ' return True
    ReadTableVals = True
    End Function

    '************************************************* **************************
    **

    Function ReadTable(Array() as String,optional Index as Variant) as Integer
    ' this function reads the rows of a java table in the application.
    ' the second (optional) parameter taken is the index of the table
    (default=1).
    ' it has been written to get easy access to the table of the application.
    ' For our purposes, there is no need to specify the identification string.
    ' The first parameter is an array of strings in which the rows of the table
    are
    ' returned.
    Dim IndexStr as String
    ' determine index, it's either users defined or default(1).
    if isMissing(Index) then
    IndexStr = "1"
    else
    IndexStr = trim$(str$(index))
    end if
    ' call ReadTableVals with an identification string constructed from the
    ProductStr
    if not ReadTableVals("JavaCaption=" + ProductStr +
    ";\;Type=JavaTable;Index=" + IndexStr, Array) then
    ReadTable = False
    else
    ReadTable = True
    end if
    end Function

    ---

  6. #6
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Testing Java table using Team test 2001..

    User =?iso-8859-1?Q?Robert_L=F6scher?= (loro00@gmx.net.nospam) posted:

    Hi,
    I had the same problem one year ago and I made a workaround. It's quite a
    bit complicated but it worked!
    First you have to prove if you can copy a selected value from a table cell
    into the clipboard with e.q. Ctrl-C (I told my java-programers to do so).

    Then the folowing Sub works:

    Sub SelectRowAsString(test as String)
    Dim row As Integer
    Dim value As Variant
    Dim inhalt, testname as String
    Dim Result As Integer
    Dim notfound As Integer

    Result = SQAGetPropertyAsString(JAVATITLE & ";\;Type=JavaTable;Index=1",
    "rowCount", value)
    'msgbox(Result)
    notfound = 1
    'msgbox(value)
    for row=1 to value
    DelayFor(20)
    if row = 1 then
    JavaTable Click, JAVATITLE & ";\;Type=JavaTable;Index=1",
    "StartCol=1;Row=" & row
    else
    InputKeys "{DOWN}"
    end if
    DelayFor(20)
    InputKeys "^c"
    DelayFor(20)
    inhalt = Clipboard.GetText()
    'msgbox(inhalt)
    testname=GetField(inhalt,1,";")
    if (testname=test) Then
    notfound = 0
    exit for
    end if
    next row
    if (notfound = 1) then
    SQALogMessage sqaNone, test & " NOT FOUND!!", "Check values!"
    msgBox(test & "NOT FOUND!")
    end if
    End Sub

    Maybe the delays are too long - and it's a very clumsy way of programming -
    if anybody knows a higher perfomant way please tell me!

    Regards
    Ing. Robert Löscher
    Mail: loro00@gmx.net


  7. #7
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Testing Java table using Team test 2001..

    User (PAnantharam@erac.com.nospam) posted:

    Hi Torsten,
    I did some searching in Robot help as well as in the archives but haven't
    found a function called Dirname. Can you please let me know where I can
    find it? I'll continue to see if there's another way I can obtain this in
    2001A.

    Thank you very much.
    Parasu

    ---

  8. #8
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Testing Java table using Team test 2001..

    User ("Schoen,Torsten3865S-PP-RD-QA1".nospam) posted:

    The function you really need is SQAVpGetActualFilename. It is built into
    robot and generates a full path to a new VP data file. Dirname just strips
    the filename of the returned string and returns only the pathname which is
    where you will find your VP data.

    Here is the code for Dirname:

    Function Dirname(Filename as String) as String
    dim i as integer
    dim strlen as integer
    strlen = len(Filename)
    i = strlen
    while (i > 0) and (mid$(Filename,i,1) <> "\")
    i = i -1
    wend
    Dirname = left$(Filename,i-1)
    end function

    Hope that helps

    Torsten Schoen
    S-PP-RD-QA1
    Heidelberger Druckmaschinen AG
    torsten.schoen@de.heidelberg.com

    ---

 

 

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 13.64%
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 02:16 AM.

Copyright BetaSoft Inc.