com.github.siwenyan.si.CustomExecutorPromptAnswer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of side Show documentation
Show all versions of side Show documentation
Java runner of Selenium IDE project
package com.github.siwenyan.si;
import java.util.HashMap;
import java.util.Map;
public class CustomExecutorPromptAnswer extends SiCommandExecutor {
private final static String PROMPT_ID = "cus_prompt";
private final static String ANSWER_ID = "cus_answer";
protected String prompt;
private Map customCalculators = new HashMap();
public void putCalculator(String s, ICustomCalculator ICustomCalculator) {
this.customCalculators.put(s, ICustomCalculator);
}
@Override
public void execute(SiCommand command, SiContext siContext) throws SiVerifyException {
String prompt = siContext.getVarValue(PROMPT_ID);
String answer = this.customCalculators.get(this.prompt).calculate(prompt, command, siContext);
siContext.addVar(ANSWER_ID, answer);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy