Forum Discussion
Ilario72
Occasional Contributor
Hi,
with this Groovy script:
import javax.swing.*
def popup = {
JFrame jframe = new JFrame()
String answer = JOptionPane.showInputDialog(jframe, it)
jframe.dispose()
answer
}
def mytext = popup("Enter a text")
log.info "text inserted: " + mytext
I'm able to enter a value in a popup:
TNeuschwanger
4 years agoChampion Level 1
Hello Ilario72
Here is a sample that captures the content entered into a prompt from a groovy script. I am not aware of external tools that run against groovy to press buttons for you however. Like ChrisAdams indicated that is a very odd use case and I am just hoping i am misinterpreting the question.
log.info 'Test Step "' + testRunner.runContext.currentStep.name + '" start...';
log.info "";
def testcaseNameFilePath = 'C:\\Temp\\FHIR MolecularSequence Testcase Files\\';
def titleStr = 'Prompt';
def questionStr = 'Path of input testcase name files? ';
def valueStr = testcaseNameFilePath;
def fileInput = com.eviware.soapui.support.UISupport.prompt(questionStr, titleStr, valueStr).toString();
assert (fileInput), "Path can not be empty";
log.info "fileInput response=$fileInput";
//testRunner.testCase.testSteps["Properties"].setPropertyValue( "testcaseNameFilePath", fileInput);
log.info "";
log.info 'Test Step "' + testRunner.runContext.currentStep.name + '" finish...';
Related Content
- 9 years ago
- 3 years ago
Recent Discussions
- 21 hours ago