Hot answers tagged

3

When IDs are dynamic (frequently database IDs) you can use the following strategies (listed in preferred order) to locate the element: Add data attributes to existing elements in the source, e.g. data-product='first' Add additional elements and/or attributes (e.g. name=) as fixed identifiers to the source Use text content to identify the element Use the ...


1

Whenever Id's are dynamic then CSS selector is the best way to locate an element, but if you want to use Xpath then you can use Dynamic Xpath methods like:- Using single attribute (//tagname[@attribute-name = 'value']). Using multiple attribute (//tagname[@attribute-name1 = 'value1'][@attribute-name2='value2']). Using contains method (//tagname[...


1

If your question is about how to send a HTTP POST request with JSON body from JSR223 Sampler, kindly find example code below: import org.apache.http.client.methods.HttpPost import org.apache.http.entity.ContentType import org.apache.http.entity.StringEntity import org.apache.http.impl.client.HttpClientBuilder import org.apache.http.util.EntityUtils def ...


Only top voted, non community-wiki answers of a minimum length are eligible