]3
i want values if i put ${testqa 1}and${ testsampleqa1 } and so on how to do that can u pls help me forthis issue
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It only takes a minute to sign up.
Sign up to join this community]3
i want values if i put ${testqa 1}and${ testsampleqa1 } and so on how to do that can u pls help me forthis issue
In the regular expression field use this data:
a href = "test.(.*?).com/(.*?)/(.*?)"
In Template field, add $2$$3$
Leave the default value field blank.
To pass the extracted testqa1, use ${TestValues_g2}, to extract testsampleqa1, use ${TestValues_g3} where you want to pass them. If you want to combine the extracted value and pass it, then use ${TestValues1_g2}${TestValues1_g3} together, without space.
To capture all the values, use three regular expression extractor. In each one, use a different variable for storing the value eg. TestValues1, TestValues2, TestValues3. So, for extracting value from test.gmail.com, enter 1 in match no. column in 1st regular expression. For extracting value from test.bing.com, enter 2 in match no. column in 2nd regular expression and so on.
IF you want to extract all the values after the slash use the following regular expression
"test.(.+?).com\/(.+?)"
in the template field use $1$2$
as we have 2 matching groups one for each matching group
If you want to extract all values you can use -1
Match no as shown below.
and Name your regular expression extractor as TestValues
as shown below
Above expression will extract all 3 values and stores the values in
TestValue_1_g1 TestValue_1_g2
TestValue_2_g1 TestValue_2_g2
TestValue_3_g1 TestValue_3_g2
Group 1 stores the domain name and Group 2 stores the value after slash
as shown below
use variables
${TestValue_1_g1} ${TestValue_1_g2}
${TestValue_2_g1} ${TestValue_2_g2}
${TestValue_3_g1} ${TestValue_3_g2}
where you want to replace the values eg : to pass extracted variables
test.${TestValue_1_g1}.com/${TestValue_1_g2}
IF you want to extract a random value from 3 values you can use 0
instaead of -1
match number in regular expression extractor
and use ${TestValue_g1} ${TestValue_g2}
to replace, so you can use the following
test.${TestValue_g1}.com/${TestValue_g2}
Use this website for testing your regular expression For more information on regular expression extractors read this article
Please let me know if it helps..