for (int i = 0; i < stepsA.length(); i++) {
JSONObject stepO = stepsA.getJSONObject(i);
Script.Step step = new Script.Step(getStepTypeOfName(stepO.getString("type")));
step.negated = stepO.optBoolean("negated", false);
script.steps.add(step);
JSONArray keysA = stepO.names();
for (int j = 0; j < keysA.length(); j++) {
String key = keysA.getString(j);
if (key.equals("type") || key.equals("negated")) { continue; }
if (stepO.optJSONObject(key) != null) {
step.locatorParams.put(key, new Locator(