How to do a 'While TextContent NotEquals'

4 posts, 0 answers
  1. dan
    dan avatar
    27 posts
    Member since:
    Jun 2016

    Posted 22 Sep Link to this post

    Hi,

    I need a While loop that will execute its loop until an element's text content equals 'Active Accounts'. Like so...

     

    while(Verify 'TextContext' 'NotEquals' 'Active Accounts' on QuerySelector)

          click selector

     

     

    Note, using 'Not Contains' in the condition won't work because a possible text content value is 'My Active Accounts', which I must be able to differentiate from 'Active Accounts'.

     

    I tried the Regex negative look ahead expression   /^(?!.*Active Accounts)/g, but that didn't work.

     

    So, how can I implement an effective 'NotEquals' in a while loop?

     

    Thanks,

    dan

     

        
  2. Nikolay Petrov
    Admin
    Nikolay Petrov avatar
    81 posts

    Posted 27 Sep Link to this post

    Hello Dan,

    Generating a while loop using the UI of the product does not support the exact "Not Equal" option. If you want to implement this you have to use the framework of the product. The easiest way to do it is to implement the while loop in a coded step and add all steps to be executed inside the loop. It you don't want to convert the steps in code to add it in the loop you can put them in test as step and execute it inside the coded loop step.

    I hope these directions are helpful.

    Regards,
    Nikolay Petrov
    Telerik by Progress
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  3. dan
    dan avatar
    27 posts
    Member since:
    Jun 2016

    Posted 27 Sep in reply to Nikolay Petrov Link to this post

    Thanks Nikolay,

    Doing it in code is an option, but I'm trying to avoid coding where possible. Is there a technical reason why  'NotExists' is not an option? If not, I'll submit a request for feature.

    With regard to using comparisons based on Regex, are negative lookahead  expressions supported?

     

    Thx,

    dan

  4. Nikolay Petrov
    Admin
    Nikolay Petrov avatar
    81 posts

    Posted 30 Sep Link to this post

    Hello Dan,

    There is no technical reason for this. You may log a feature request on our feedback portal for this and any other feature you think will be in use of the users. It will be reviewed by our management and other users could vote for them.

    Unfortunately, the UI of the product can not cover all of the customers specific scenarios. When the UI options are not sufficient the user can use coded steps and Telerik Testing Framework to complete their goals.

    Thank you for your feedback.

    Regards,
    Nikolay Petrov
    Telerik by Progress
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
Back to Top