0

Following is my page code:

<label class='dblclick'>
<input  type='radio'  name='opt16647' value='a' class='d_TableCell toggleclick'>

I need to extract name='opt16647' from the above CSS using type='radio' and class='d_TableCell toggleclick' without selecting value. How do I achieve the same using CSS Selector Extractor and not JQuery extractor?

JakeParis
  • 11,056
  • 3
  • 42
  • 65
Radhika
  • 109
  • 5
  • 17

2 Answers2

1

You can do it in 3 ways

  1. Use "input[type=radio]" as CSS Selector Expression and Attribute as "name"
  2. Use ".d_TableCell" as CSS Selector Expression and Attribute as "name"
  3. Use ".toggleclick" as CSS Selector Expression and Attribute as "name"

Tested all 3 ways and they are working

Sample Request: Sample Request

CSS Extractor using "input[type=radio]" Using input[type=radio]

CSS Extractor using ".d_TableCell" Using .d_TableCell

CSS Extractor using ".toggleclick" Using .toggleclick

Results Debug Sampler Results

  • Hi in case there are multiple radio buttons on the page, how do we use type='radio' and class='d_TableCell toggleclick' properties together? – Radhika Jun 07 '20 at 12:30
  • In case there are multiple radio buttons on the page, use any of the above methods with Match number as 0. This will randomize your extraction. Also what is the specific need to use type='radio' and class='d_TableCell toggleclick' properties together? – M Navneet Krishna Jun 07 '20 at 13:03
  • i am looking for specific extraction and not randomized, that's the reason why i want to use two properties together. Is there a way to use two properties together? – Radhika Jun 07 '20 at 15:31
  • The above answer gives for a specific extraction. In case the above solutions don't work for multiple radio buttons, please post the example in which it is not working by editing your original question or raise a new question for the same. Essentially what you might need is something like this - "input[type=radio],d_TableCell,.toggleclick" in CSS Selector Expression. However, this approach is very vague and doesn't offer any room for flexibility since you are concatenating too many elements to get the desired result while the same can be achieved using just 1 selector. – M Navneet Krishna Jun 07 '20 at 16:13
  • okay thankyou for your response. Can you look into the following query? https://stackoverflow.com/questions/62192803/how-to-pass-dynamic-form-data-in-jmeter-on-re-direction/62195484?noredirect=1#comment110031389_62195484 – Radhika Jun 07 '20 at 16:41
1

The relevant selector expression would be:

input[type=radio][class=d_TableCell toggleclick]

Demo:

enter image description here

More information:

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Thanks alot @Dmitri T. Also, can you please look into the query and help me out further: https://stackoverflow.com/questions/62192803/how-to-pass-dynamic-form-data-in-jmeter-on-re-direction/62195484?noredirect=1#comment110031389_62195484 – Radhika Jun 09 '20 at 04:46