Share this page

# lrapi.lr2.fieldSetter

Example: fieldGetter and fieldSetter | Java over HTTP Vuser Functions

Reflects an object and sets the value of a field.

    public static Object fieldSetter(Object subject, String path, Object value) throws NoSuchFieldException, IllegalAccessException, ArrayIndexOutOfBoundsException

## Arguments

Argument | Description
--- | ---
subject | The object to reflect.
path | The path to the array or member.
value | The value to set

fieldSetter reflects an object and sets the value of a field.

In specifying the path, members from inherited parent classes must be accessed using the `super` keyword. This is different that the default java behavior, which is access members directly.

If the type of the value argument is java.lang.Object, pass the Object or String itself. If the value is a primitive type, use either, a primitive argument or a string representation of the argument. For example, "true" or "false" for boolean, 321 or "321" for int.

## Parameterization

Parameterization is not applicable to this function.

Tips to improve your search results... VuGen Function Reference Version 25.1-25.3 Function Reference 25.1-25.3 All View Local Help Center View Online Help Center Version: