Forum Discussion

dhundley's avatar
dhundley
Regular Contributor
3 years ago
Solved

if then statement conditions

I am in the middle of a free trial period and have a question about the IF THEN statement for keyword scripts. I would like my code expression to essentially say this:

If ProjectSuite.Path "contains" the string "xyz" THEN

<do something>

 

but when i click on the conditions ellipses in the IF THEN specify conditions box all I see available are 

equals

does not equal

greater than

greater than or equal to

less than

less than or equal to

 

is there no way to have the expression use the string function "contains" or the contains operator "~". My base scripting language is javascript. this is my first posted question. let me know if I need to provide any additional information to expedite this. thanks

7 Replies

  • Hi dhundley 

     

    An equivalent would be using "equals" with wildcard asterisks, for your example, "*xyz*".

    • dhundley's avatar
      dhundley
      Regular Contributor

      that did not work. i tried using the equals condition and tried both just *xyz* and "*xyz*" as the value2 entry and neither one worked. i did a log.message for the projectsuite.path and copied and pasted the entire string into the value2 entry and that does seem to work. not sure why the wildcards don't. 

       

      now, if i'm having another issue right after this IF THEN statement with a dropdown box selection not functioning in the playback as it was recorded should I ask a totally separate question or just append it to this current question?

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        Please ask a separate question.  This makes it easier for other Community members to search/find your question.