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

    Using variables to identify a button

    Hi there,

    I have to test an existing application with SILKtest and I encountered some difficulties.

    There ist a Pop-Up-window with a lot of buttons. This windows is for selecting a date. So, there are 28 to 31 buttons for the days in a month. I've declared this window and wrote a "little helper" to get the number of the day in a month (e.g. Feb 7th, 2008 returns "7"). So I want to click the 7th button.

    How do I have to write the command for clicking that button?

    SelectDate.Btn(VARIABLE).Click()

    This syntax is incorrect, I know...

    I have a script that returns the value I want.

    Is ist possible to have a command using a variable or even a function?

    Thanks a lot for help.

    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
    Senior Member
    Join Date
    Apr 2008
    Location
    Hyderabad
    Posts
    339
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Using variables to identify a button

    Hi Peter,
    if u can post the declaration of the popup I can try to find a solution.

    Is it a web application? or a stand alone?

    u can try with index...........
    Regards,
    Krishna Chaitanya

    =====================
    Try and fail, but don't fail to try
    =====================

  3. #3
    Member
    Join Date
    Sep 2006
    Posts
    57
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Using variables to identify a button

    Is this what you are trying to do?

    <font class="small">Code:</font><hr /><pre>SelectDate.@(VARIABLE).Click()</pre><hr />

  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: Using variables to identify a button

    Hi,

    it is a J2EE-standalone-application.

    I'll post the declaration tomorrow, because I called it a day two hours ago... ;-)
    -----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
    Aug 2008
    Location
    Germany, Langenzenn-Heinersdorf
    Posts
    73
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Using variables to identify a button

    Good morning from Germany,

    here's the code you were asking for:

    <font class="small">Code:</font><hr /><pre>
    [-] window JavaDialogBox Terminauswahl
    [ ] tag "~ActiveApp/Bitte wählen Sie ein Datum aus"
    [+] JavaJFCPushButton BtnMonatZurück
    [+] multitag "&lt;"
    [ ] "$javax.swing.JButton[1]"
    [+] JavaJFCStaticText STMonat
    [+] multitag "August"
    [ ] "$javax.swing.JLabel[1]"
    [+] JavaJFCPushButton BtnMonatVor
    [+] multitag "&gt;"
    [ ] "$javax.swing.JButton[2]"
    [+] JavaJFCPushButton BtnJahrZurück
    [+] multitag "&lt;&lt;"
    [ ] "$javax.swing.JButton[3]"
    [+] JavaJFCStaticText STJahr
    [+] multitag "2008"
    [ ] "$javax.swing.JLabel[2]"
    [+] JavaJFCPushButton BtnJahrVor
    [+] multitag "&gt;&gt;"
    [ ] "$javax.swing.JButton[4]"
    [+] JavaJFCStaticText STMontag
    [+] multitag "Mo[1]"
    [ ] "$javax.swing.JLabel[3]"
    [+] JavaJFCStaticText STDienstag
    [+] multitag "Di[1]"
    [ ] "$javax.swing.JLabel[4]"
    [+] JavaJFCStaticText STMittwoch
    [+] multitag "Mi[1]"
    [ ] "$javax.swing.JLabel[5]"
    [+] JavaJFCStaticText STDonnerstag
    [+] multitag "Do[1]"
    [ ] "$javax.swing.JLabel[6]"
    [+] JavaJFCStaticText STFreitag
    [+] multitag "Fr"
    [ ] "$javax.swing.JLabel[7]"
    [+] JavaJFCStaticText STSamstag
    [+] multitag "Sa"
    [ ] "$javax.swing.JLabel[8]"
    [+] JavaJFCStaticText STSonntag
    [+] multitag "So"
    [ ] "$javax.swing.JLabel[9]"
    [+] JavaJFCStaticText JavaxSwingJLabel3
    [+] multitag "$javax.swing.JLabel[3]"
    [ ] "Mo[1]"
    [ ] "#3"
    [+] JavaJFCStaticText JavaxSwingJLabel4
    [+] multitag "$javax.swing.JLabel[4]"
    [ ] "Di"
    [ ] "#4"
    [+] JavaJFCStaticText JavaxSwingJLabel5
    [+] multitag "$javax.swing.JLabel[5]"
    [ ] "Mi"
    [ ] "#5"
    [+] JavaJFCStaticText JavaxSwingJLabel6
    [+] multitag "$javax.swing.JLabel[6]"
    [ ] "Do"
    [ ] "#6"
    [+] JavaJFCStaticText JavaxSwingJLabel7
    [+] multitag "$javax.swing.JLabel[7]"
    [ ] "Fr[1]"
    [ ] "#7"
    [+] JavaJFCStaticText JavaxSwingJLabel8
    [+] multitag "$javax.swing.JLabel[8]"
    [ ] "Sa"
    [ ] "#8"
    [+] JavaJFCStaticText JavaxSwingJLabel9
    [+] multitag "$javax.swing.JLabel[9]"
    [ ] "So"
    [ ] "#9"
    [+] JavaJFCStaticText JavaxSwingJLabel10
    [+] multitag "$javax.swing.JLabel[10]"
    [ ] "Mo[2]"
    [ ] "#10"
    [+] JavaJFCPushButton BtnTag1
    [+] multitag "1"
    [ ] "$javax.swing.JButton[5]"
    [+] JavaJFCPushButton BtnTag2
    [+] multitag "2"
    [ ] "$javax.swing.JButton[6]"
    [+] JavaJFCPushButton BtnTag3
    [+] multitag "3"
    [ ] "$javax.swing.JButton[7]"
    [+] JavaJFCPushButton BtnTag4
    [+] multitag "4"
    [ ] "$javax.swing.JButton[8]"
    [+] JavaJFCPushButton BtnTag5
    [+] multitag "5"
    [ ] "$javax.swing.JButton[9]"
    [+] JavaJFCPushButton BtnTag6
    [+] multitag "6"
    [ ] "$javax.swing.JButton[10]"
    [+] JavaJFCPushButton BtnTag7
    [+] multitag "7"
    [ ] "$javax.swing.JButton[11]"
    [+] JavaJFCPushButton BtnTag8
    [+] multitag "8"
    [ ] "$javax.swing.JButton[12]"
    [+] JavaJFCPushButton BtnTag9
    [+] multitag "9"
    [ ] "$javax.swing.JButton[13]"
    [+] JavaJFCPushButton BtnTag10
    [+] multitag "10"
    [ ] "$javax.swing.JButton[14]"
    [+] JavaJFCPushButton BtnTag11
    [+] multitag "11"
    [ ] "$javax.swing.JButton[15]"
    [+] JavaJFCPushButton BtnTag12
    [+] multitag "12"
    [ ] "$javax.swing.JButton[16]"
    [+] JavaJFCPushButton BtnTag13
    [+] multitag "13"
    [ ] "$javax.swing.JButton[17]"
    [+] JavaJFCPushButton BtnTag14
    [+] multitag "14"
    [ ] "$javax.swing.JButton[18]"
    [+] JavaJFCPushButton BtnTag15
    [+] multitag "15"
    [ ] "$javax.swing.JButton[19]"
    [+] JavaJFCPushButton BtnTag16
    [+] multitag "16"
    [ ] "$javax.swing.JButton[20]"
    [+] JavaJFCPushButton BtnTag17
    [+] multitag "17"
    [ ] "$javax.swing.JButton[21]"
    [+] JavaJFCPushButton BtnTag18
    [+] multitag "18"
    [ ] "$javax.swing.JButton[24]"
    [+] JavaJFCPushButton BtnTag19
    [+] multitag "19"
    [ ] "$javax.swing.JButton[25]"
    [+] JavaJFCPushButton BtnTag20
    [+] multitag "20"
    [ ] "$javax.swing.JButton[26]"
    [+] JavaJFCPushButton BtnTag21
    [+] multitag "21"
    [ ] "$javax.swing.JButton[27]"
    [+] JavaJFCPushButton BtnTag22
    [+] multitag "22"
    [ ] "$javax.swing.JButton[28]"
    [+] JavaJFCPushButton BtnTag23
    [+] multitag "23"
    [ ] "$javax.swing.JButton[22]"
    [+] JavaJFCPushButton BtnTag24
    [+] multitag "24"
    [ ] "$javax.swing.JButton[23]"
    [+] JavaJFCPushButton BtnTag25
    [+] multitag "25"
    [ ] "$javax.swing.JButton[29]"
    [+] JavaJFCPushButton BtnTag26
    [+] multitag "26"
    [ ] "$javax.swing.JButton[30]"
    [+] JavaJFCPushButton BtnTag27
    [+] multitag "27"
    [ ] "$javax.swing.JButton[31]"
    [+] JavaJFCPushButton BtnTag28
    [+] multitag "28"
    [ ] "$javax.swing.JButton[32]"
    [+] JavaJFCPushButton BtnTag29
    [+] multitag "29"
    [ ] "$javax.swing.JButton[33]"
    [+] JavaJFCPushButton BtnTag30
    [+] multitag "30"
    [ ] "$javax.swing.JButton[34]"
    [+] JavaJFCPushButton BtnTag31
    [+] multitag "31"
    [ ] "$javax.swing.JButton[35]"
    [+] JavaJFCStaticText JavaxSwingJLabel11
    [+] multitag "$javax.swing.JLabel[11]"
    [ ] "Fr[2]"
    [ ] "#11"
    [+] JavaJFCStaticText JavaxSwingJLabel12
    [+] multitag "$javax.swing.JLabel[12]"
    [ ] "#12"
    [+] JavaJFCStaticText JavaxSwingJLabel13
    [+] multitag "$javax.swing.JLabel[13]"
    [ ] "#13"
    [+] JavaJFCStaticText JavaxSwingJLabel14
    [+] multitag "$javax.swing.JLabel[14]"
    [ ] "#14"
    [+] JavaJFCStaticText JavaxSwingJLabel15
    [+] multitag "$javax.swing.JLabel[15]"
    [ ] "#15"
    [+] JavaJFCStaticText JavaxSwingJLabel16
    [+] multitag "$javax.swing.JLabel[16]"
    [ ] "#16"
    [+] JavaJFCStaticText JavaxSwingJLabel17
    [+] multitag "$javax.swing.JLabel[17]"
    [ ] "#17"
    [+] JavaJFCStaticText JavaxSwingJLabel18
    [+] multitag "$javax.swing.JLabel[18]"
    [ ] "#18"
    [+] JavaJFCStaticText JavaxSwingJLabel19
    [+] multitag "$javax.swing.JLabel[19]"
    [ ] "#19"
    [+] JavaJFCStaticText JavaxSwingJLabel20
    [+] multitag "$javax.swing.JLabel[20]"
    [ ] "#20"

    </pre><hr />

    Well, I added a picture, so you can see, what I mean.
    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------

  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: Using variables to identify a button

    OH MY GOD!

    I found my mistake! I'm professsionally blinkered, I think...

    The suggestion of pstewart is working fine. But I set a wrong value vor the variable... *shame on me!*

    sBtnVar = "Btn"+sAktDate won't work if you need the string "BtnTag15" and sAktDate is "15"... But even 4 co-workers didn't find this mistake...

    It is like the ";" in a 2000-lines-C-script... head --&gt; desk

    But nevertheless, THANK YOU FOR HELP!
    -----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
    Senior Member
    Join Date
    Apr 2008
    Location
    Hyderabad
    Posts
    339
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Using variables to identify a button

    Hello Peter,
    you can try this.
    <font class="small">Code:</font><hr /><pre>
    [+] SelectDate(INTEGER iBtnIndex)
    [ ] Terminauswahl.JavaJFCPushButton("{iBtnIndex}").Cli ck()
    [ ] //or
    [ ] //Terminauswahl.JavaJFCPushButton("$javax.swing.JBut ton[{iBtnIndex+4}]").Click()
    <font class="small">Code:</font><hr /><pre>

    Here 'iBtnIndex' is the argument you need to pass to this function.

    Have a nice day
    Regards,
    Krishna Chaitanya

    =====================
    Try and fail, but don't fail to try
    =====================

 

 

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 10.34%
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 09:43 AM.

Copyright BetaSoft Inc.