Ask a Question

Regular Expressions in the Checkpoint Properties

SOLVED
Adagio
Frequent Contributor

Regular Expressions in the Checkpoint Properties

Hello ,

I'm trying to use RegEx in the checkpoint properties but I think I have syntax problems or my be not using it correctly.

Here is what I'm doing: 

aqObject.CheckProperty(Aliases.browser.page.panelApp.panel.tableCont, "contentText", cmpMatches, "A Quantity\n667\nB Quantity5656\nC Quantity\n65757")

Here's what I'm doing: 

aqObject.CheckProperty(Aliases.browser.page.panelApp.panel.tableCont, "contentText", cmpMatches, "A Quantity\n regexp:\d{3}\nB Quantity regexp:\d{4}\nC Quantity\n regexp:\d{5}")

Is there anything I should correct here. I'm not very sure. Any help would be appreciated!

 

Thank you

Al

4 REPLIES 4
Marsha_R
Community Hero

What happens when you try it?


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
Adagio
Frequent Contributor

Error: 

Actual Value
A Quantity↴667↴B Quantity↴5656↴C Quantity↴65757

Expected Value
A Quantity↴regexp:d{3}↴B Quantity↴ regexp:d{4} ↴ C Quantity↴regexp:d{5}
IStaroverov
SmartBear Alumni (Retired)

Could you try:

aqObject.CheckProperty(...., cmpMatches, "A Quantity\\n\\d+\\nB Quantity\\d+\\nC Quantity\\n\\d+")

Adagio
Frequent Contributor

Thank you @IStaroverov . Regexp was definitely the issue and the formatting as well.

appreciate your help!

 

Thank you

Al

cancel
Showing results for 
Search instead for 
Did you mean: