SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Aug 2008
    Location
    Germany, Langenzenn-Heinersdorf
    Posts
    73
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Declaring a JPanel as a CustomWin

    Hi there,

    different day, same problem. I didn't find any solution for my "JPanel in Tablecell-problem", so I tried some ways to handle that problem. Unsuccessfully, I confess. :-(

    Well, my approach is, that I declare the JPanel in the table. But I don't get the trick to manage this.

    Now I will explain, how the window is constructed:

    At first, there is a Java-window. In that window is a split pane. There are up to three tables. In the tablecells there are a JPanel each. So I want to access the JPanel like this:

    Window.SplitPane.Table.JPanel.GetText()

    But the problem is, that SILK doesn't know the cell of the table to look for the JPanel.

    How do I have to declare the JPanel, that SILK-Test can find and access the JPanel?

    Best regards,

    Peter
    -----BEGIN GEEK CODE BLOCK-----
    Version: 3.1
    GIT d- s-:- a-- C++ U++ P+ L++
    E--- W+++ N w O- PS+ PE- PGP+
    t-- R tv+ b+++ DI++++ D+ G++ e*
    h--- r+++
    ------END GEEK CODE BLOCK------

  2. #2
    Member
    Join Date
    Aug 2008
    Location
    Germany, Langenzenn-Heinersdorf
    Posts
    73
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Declaring a JPanel as a CustomWin

    Now with picture!

    You can see the table. Table is dynamically generated and if there will be another entry it will be shown in a tablecell under an existing tablecell.

    The blue entry ist what I want to read...

    There is alway an empty row as the last tablerow.
    Attached Images Attached Images
    -----BEGIN GEEK CODE BLOCK-----
    Version: 3.1
    GIT d- s-:- a-- C++ U++ P+ L++
    E--- W+++ N w O- PS+ PE- PGP+
    t-- R tv+ b+++ DI++++ D+ G++ e*
    h--- r+++
    ------END GEEK CODE BLOCK------

  3. #3
    Member
    Join Date
    Nov 2003
    Location
    Germany, Frankfurt a.M.
    Posts
    54
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Declaring a JPanel as a CustomWin

    Hi HaPe,

    Java Tables are sometimes tricky. To me it looks like you’ve got one of these here.
    With pure Silktest I have to say, I can’t give an answer.
    But fortunately Silktest has the ability to access the public methods and properties of java-classes (At least for Swing – I don’t know for shure, if it works for SWT too).
    Thus I would recommend to utilize this for your problem.
    There are two ways I can think of:
    1. Check to use the method “invokeMethodes” of the table (If it is a JavaJFCTable). See Silktest help.
    2. Use “record class” to record the TableClass, inherit a new class and have a look at the public methods silk “sees”. Have a look at “record class in Silk help.

    If you have problems, may be I should extend this by e-mail.

    Greetings from Frankfurt

    T.

  4. #4
    Member
    Join Date
    Aug 2008
    Location
    Germany, Langenzenn-Heinersdorf
    Posts
    73
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Declaring a JPanel as a CustomWin

    Hi!

    Yes, it is a JavaJFCTable. The InvokeMethod - Method will work there?

    Well that would be great, but I have some problems to understand the way I have to handle this method. Is it right, that I need a method to access the JPanel in the sourcecode of the AUT? So our software-engineers have to write it?

    Let us assume, there is a method implemented in the code, the 4test-Code I have to write is?

    I don't know in which JPanel the text is I'm looking for. So I have to write a for-statement to check every existing JPanel?

    Sorry for my bad English and my maybe "Newbie-"questions...

    Greetings from Franconia,

    Peter
    -----BEGIN GEEK CODE BLOCK-----
    Version: 3.1
    GIT d- s-:- a-- C++ U++ P+ L++
    E--- W+++ N w O- PS+ PE- PGP+
    t-- R tv+ b+++ DI++++ D+ G++ e*
    h--- r+++
    ------END GEEK CODE BLOCK------

  5. #5
    Member
    Join Date
    Nov 2003
    Location
    Germany, Frankfurt a.M.
    Posts
    54
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Declaring a JPanel as a CustomWin

    Hi!

    invokeMethods will work with any JavaJFC object.

    [ QUOTE ]

    Is it right, that I need a method to access the JPanel in the sourcecode of the AUT? So our software-engineers have to write it?


    [/ QUOTE ]

    Yes and not! InvokeMethodes accesses the public java methods of the object. This could be the native methods supplied by java itself or those implemented by your engineers. If you are unlucky you need something implemented specially for your tests. But to my experience this rarely happens. In most cases you can use what is there already.
    [ QUOTE ]


    Let us assume, there is a method implemented in the code, the 4test-Code I have to write is?


    [/ QUOTE ]

    <font class="small">Code:</font><hr /><pre>
    String dummy =yourTable.InvokeMethods ({"getValueAt", "toString"}, {{Cell.Row - 1, Cell.Col - 1}, {}})
    Print (dummy)
    (the "-1" to Cell.Row and Cell.Col is because java starts counting at zero)
    </pre><hr />

    This uses the native java method getValueAt to ask a JTable of the value in the specified cell.
    I use toString, because getValueAt could return anything.
    You see I ingnore the JPanel at the first step and hope the table „knows“, what it is displaying.

    If you get the string representation of the panel, try:

    <font class="small">Code:</font><hr /><pre>
    String dummy =yourTable.InvokeMethods ({"getValueAt", "getComponent", "getText"}, {{Cell.Row - 1, Cell.Col - 1}, {i}, {}})
    Print (dummy)

    (replace "i" by the number of the component e.g. the statictext to get)
    </pre><hr />

    May be you have to experiment a little with the value of “i”.

    I hope this helps.

    Greetings

    T

  6. #6
    Member
    Join Date
    Aug 2008
    Location
    Germany, Langenzenn-Heinersdorf
    Posts
    73
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Declaring a JPanel as a CustomWin

    Hi!

    Okay, this code
    <font class="small">Code:</font><hr /><pre>
    [ ] sTerminbez = DELTANT.ViewFenster.TblKalender.InvokeMethods ({"getValueAt", "toString"}, {{0, 4}, {}})
    [ ] PRINT (sTerminbez)
    </pre><hr />

    returns following string
    <font class="small">Code:</font><hr /><pre>
    [ ] de.XXXXXXXXXX.delta.client.application.kalender.ta blecell.MultiComponentPanel[,0,0,0x0,invalid,layout=java.awt.BorderLayout,alig nmentX=0.0,alignmentY=0.0,border=javax.swing.borde r.EmptyBorder@80e605,flags=9,maximumSize=,minimumS ize=,preferredSize=]
    </pre><hr />

    The other line of code throws an error if the value of "i" is not equal "0" (zero). But then it says that the method GetText is unavailable und not defined... [img]/images/graemlins/confused.gif[/img]

    But thanks a lot, because now I start to understand the invokeMethods-method... [img]/images/graemlins/grin.gif[/img]

    Greetings,

    Peter
    -----BEGIN GEEK CODE BLOCK-----
    Version: 3.1
    GIT d- s-:- a-- C++ U++ P+ L++
    E--- W+++ N w O- PS+ PE- PGP+
    t-- R tv+ b+++ DI++++ D+ G++ e*
    h--- r+++
    ------END GEEK CODE BLOCK------

  7. #7
    Member
    Join Date
    Nov 2003
    Location
    Germany, Frankfurt a.M.
    Posts
    54
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Declaring a JPanel as a CustomWin

    Hm,

    i think you need to experiment a bit more.
    And talking to developers could be helpfull.

    <font class="small">Code:</font><hr /><pre>
    String dummy =yourTable.InvokeMethods ({"getValueAt", "getComponent", "toString"}, {{Cell.Row - 1, Cell.Col - 1}, {i}, {}})
    </pre><hr />

    could be an alternative.

    and try to record the table class by "record class" somewhere in the silk menu.
    you will see the avaible metods.

    If you have futher questions:
    teckle@web.de

    But I wont be able to answer befor tomorow evening!

    Greetings

    T.

 

 

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 04:16 PM.

Copyright BetaSoft Inc.