ContentTableRow row = resultsTable.getFirstRowContainingText("Command Line Arguments");
assertNotNull("'Command Line Arguments' row not found.", row);
HtmlCheckBoxInput unsetCheckbox = row./*getCellByColumnName("Unset").*/ getElement().getFirstByXPath(".//input[@type='checkbox']");
unsetCheckbox.setChecked(false);
HtmlTextArea argsTA = row./*getCellByColumnName("Value").*/ getElement().getFirstByXPath(".//textarea"); // [@ondblclick='commandLineArguments']
argsTA.setText("-c");
DebugUtils.writeFile("target/scriptsWithParam-settingParams.html", client.getPageAsText());
ejtt.sleep(2000);
// Run.
((HtmlSubmitInput) client.getElement("parametersForm:okButton")).click();
}
// Wait for the operation to succesfuly finish.
ejtt.operations.waitActivelyForOperationToFinish(EXECUTE_OP_NAME, 5000, 5);
assertTrue(EXECUTE_OP_NAME+" operation wasn't successful.", ejtt.tabMenu.getTabContentBox().getOperationsHistoryTable().wasLastOperationSuccesful() );
ejtt.sleep(2000);
// Get the results table.
//client.getElement("historyDetailsPanel_body");
HtmlDivision resultsDiv = (HtmlDivision) client.getElement("operationResults");
if( null == resultsDiv )
throw new HtmlElementNotFoundException("#operationResults - a div around a results table.");
HtmlTable resultsTableElm = resultsDiv.getFirstByXPath(".//table[@class='properties-table']");
if( null == resultsTableElm )
throw new HtmlElementNotFoundException(".//table[@class='properties-table'] - a results table.");
ContentTable resultsTable = ejtt.getTabMenu().getTabContentBox().getTable(resultsTableElm);
// Process the results table.
// Exit Code
HtmlTextInput exitCodeInput = resultsTable.getFirstRowContainingText("Exit Code").getCellByColumnName("Value").getFirstByXPath(".//input");
assertEquals("Exit Code should be 0", "0", exitCodeInput.getValueAttribute().trim() );
String expectedOutputPart = "/client";
HtmlTextArea outputTA = resultsTable.getFirstRowContainingText("Output").getCellByColumnName("Value").getFirstByXPath(".//textarea");
String taText = outputTA.getText().trim();
DebugUtils.writeFile("target/scriptsWithParam-output.html", client.getPageAsText());
assertTrue("`classpath.sh -c` run output should contain '"+expectedOutputPart+"'; is:\n"+taText, taText.toLowerCase().contains(expectedOutputPart));
}
finally {