SPONSORS:






User Tag List

Results 1 to 7 of 7
  1. #1
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Escape character for *

    What is the escape character for the * in SilkTest. I am unable to find a list of these in the manuals.

    I have a cell in a table that I am entering an invalid value of *Table*Name* into. The invalid characters are stripped out, but SilkTest is still seeing them. All other characters behave as expected. My suspicion is that since the asterisk is considered a wildcard by SilkTest, this is causing my problem. Can I escape that character in some way to force it to be seen as a literal asterisk?

    ------------------

  2. #2
    Senior Member
    Join Date
    Jul 2001
    Location
    Elizabeth, CO, USA
    Posts
    653
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Escape character for *

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by DJGray:
    Can I escape that character in some way to force it to be seen as a literal asterisk?

    <HR></BLOCKQUOTE>

    I believe SilkTest only values "*" as a wildcard in the MatchStr function, but whatever.

    You might want to try:

    To find the ASCII value of a character, use the Asc function as in
    - Dave

    ------------------

    Amelior Technology
    dreed@ameliortech.com
    WaltzingRhino.com
    A concerned Borland customer, a fly in the ointment, a wrench in the works.

  3. #3
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Escape character for *

    Using the method suggested by DCreed did not do the trick.

    Here is a more detailed description of what I am working on. I have a JavaJFCTable, and I can modify certain values in that table but not others. One of the values in the table (TableName) shows up in a treeview in another frame. Certain names for this table are valid and others are not. I iterate through all the valid and invalid names verifying that the TableName can or cannot be changed. As this happens I also look at the treeview and verify that the name did or did not change based on the legality of the attempted name change.

    One of the characters that is not allowed is an asterisk. Silk will set the name *Table*Name* in the field and upon hitting Enter, the asterisks are stripped from the name and the name TableName shows up in the table cell as well as the associated treeview. Now, when I go back to verify this, Silk sees *Table*Name* in both the cell and in the treeview. However, watching the script run... the asterisks are NOT there.

    So, I'm assuming that the fact the * is a wildcard to Silk is somehow messing with my verification.

    Any other ideas on how to go about this?

    ------------------

  4. #4
    Senior Member
    Join Date
    Nov 2000
    Location
    Bloomington, IL
    Posts
    142
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Escape character for *

    You can designate the * symbol as <#Times>. See Key Names for more information.

    Mike

    ------------------

  5. #5
    Member
    Join Date
    Dec 2000
    Location
    San Francisco, CA
    Posts
    51
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Escape character for *

    Did I understood you correctly?
    1. Your AUT translates your input of "*Table*Name*" to "TableName" (even manually?)
    2. Your problem is in verifying the contents of the cell.

    My assumptions.
    1. You are using MatchStr("*Table*Name*", "TableName") in your verification.
    2. You just wanted to verify if the contents of the cell if it has an illegal character, in this case "*".

    My solution.
    1. Change your verification just check the existence of the invalid character like StrPos("*", "TableName")
    2. Use the translated string, specified in your AUT's req, as your expected value.
    e.g.
    string sInput = "*Table*Name*"
    string sExpected = fRemoveIllegalChars(sInput)
    string sActual

    fSetCellValue(sInput)

    sActual = fGetCellValue()

    if (sExpected != sActual) {
    LogError("Error")
    }

    Good Luck.

    ------------------


    [This message has been edited by kalabog (edited 07-19-2001).]

  6. #6
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Escape character for *

    Mike and Kalabog,

    Thanks for the responses. Both thoughtful.

    Mike,
    The KeyNames are valid for TypeKeys and PressKeys. I'm using SetCellValue and may need to change that approach so I can use the KeyName approach.

    Bog,
    I'm using SetCellValue and GetCellValue to determing if the cell is writable, and if it is, then does it accept both valid and invalid values.

    Because the cell is very specific and contains a single value, verifying those contents is an easy matter.

    However, I also need to find the value in a treeview and for that I need to use an iPos.FindItem() looking for the entire invalid value. If iPos > 0, we have a problem. If I were to search just for the character it may show up in other areas in that tree where it is a valid value.

    In both cases, validating the contents of the cell, and in verifying the tree, the * is showing up to SilkTest when it is actually not displaying on the screen.




    ------------------

  7. #7
    Senior Member
    Join Date
    Jul 2001
    Location
    Elizabeth, CO, USA
    Posts
    653
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Escape character for *

    ***Ah, I get it now.

    ***Yes, the FindItem method also allows wildcards, which would cause you some problems.

    ***An option: use GetContents on the TreeView object to get all of the contents into a LIST OF STRING. You could then get just the portion of the TreeView contents that you want to examine and then use StrPos (not MatchStr) to make sure that no line contains the string you think shouldn't be there.

    ***- Dave


    ------------------
    Amelior Technology
    dreed@ameliortech.com

    [This message has been edited by dcreed (edited 07-20-2001).]
    WaltzingRhino.com
    A concerned Borland customer, a fly in the ointment, a wrench in the works.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin 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 05:29 AM.

Copyright BetaSoft Inc.