This is a migrated thread and some comments may be shown as answers.

How to do a 'While TextContent NotEquals'

3 Answers 75 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
dan
Top achievements
Rank 1
dan asked on 22 Sep 2016, 11:43 AM

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

 

    

3 Answers, 1 is accepted

Sort by
0
Nikolay Petrov
Telerik team
answered on 27 Sep 2016, 08:15 AM
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
 
0
dan
Top achievements
Rank 1
answered on 27 Sep 2016, 04:00 PM

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

0
Nikolay Petrov
Telerik team
answered on 30 Sep 2016, 11:58 AM
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
 
Tags
General Discussions
Asked by
dan
Top achievements
Rank 1
Answers by
Nikolay Petrov
Telerik team
dan
Top achievements
Rank 1
Share this question
or