Forum Discussion

reydimaano's avatar
reydimaano
Contributor
12 years ago

How to use script function in KewordTests statement if..then

I want to use the script getTabCount() that return an integer and compare it to another value in the KeywordTests statement if..then.



Just like:

If..Then as KeywordTest statement and the value is something like

"getTabCount() greater than 4"
  • The simplest way to do this:



    1. Insert Run Script Routine statement selecting your function getTabCount();

    2. Insert If statement with expression as LastResult Greater than 4.



    If you don't like this approach for some reason, there is another soultion exists which requires implementation of script extensions (in this case you may refer to Code Expression in If statement and call your function directly).



  • The simplest way to do this:



    1. Insert Run Script Routine statement selecting your function getTabCount();

    2. Insert If statement with expression as LastResult Greater than 4.



    If you don't like this approach for some reason, there is another soultion exists which requires implementation of script extensions (in this case you may refer to Code Expression in If statement and call your function directly).



  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Rey,


     


    If Andrey's reply has helped you, you can "Accept the answer". This is a good way to say "thanks" as some additional points will be added to his reputation :)