【发布时间】:2022-01-27 17:58:55
【问题描述】:
我有以下方法:
protected String getCertID() {
String certIDKey = "certID";
TestAction action = new TestAction(ActionType.SET_ELEMENT_TEXT,springContext);
action.setIdentifierType("xpath");
action.setIdentifierValue("//h1[contains(@data-id,'header_title')]");
action.setValue(certIDKey);
action.perform(driverFactory,testContext);
log.info("CertID: " + testContext.getVariable(certIDKey));
return testContext.getVariable(certIDKey);
}
此方法的输出:21/2/467092- 已保存
我要求该方法仅返回:21/2/467092 并忽略 - 返回的元素的已保存部分
【问题讨论】: