Forum Discussion

Adagio's avatar
Adagio
Frequent Contributor
6 years ago

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

  • Could you try:

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

    • Adagio's avatar
      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's avatar
        IStaroverov
        SmartBear Alumni (Retired)

        Could you try:

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