Compare 2 values #126
-
Hello, I have 2 values saved in response like this:
using this step definition:
Is there any way to check that "grossFloorAreaM2_first" > "grossFloorAreaM2_second"? |
Beta Was this translation helpful? Give feedback.
Answered by
ASaiAnudeep
Mar 23, 2022
Replies: 2 comments 2 replies
-
You can use parse function to get the value of stored variables. const { parse } = require('pactum');
const first = parse('$S{grossFloorAreaM2_first}');
const second = parse('$S{grossFloorAreaM2_second}');
// write your custom assertions to compare the values |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ASaiAnudeep
-
Hmm thanks for your answer, but still I am not sure how to write assertion for that. I am using https://github.com/pactumjs/pactum-cucumber-boilerplate project and there is no step for that |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use parse function to get the value of stored variables.