navyaG
6 years agoRegular Visitor
Cannot enter data to a textarea control(desktop swing application)
Hi,
We have identified an element on our swing application which is actually a text field for entering username. The element identification is shown as below
Control nameAnduserTextField = process.find(TestProcess.class, new ProcessPattern(){{
ProcessName = "jp2launcher";
Index = 2;
}}).find(TopLevelWindow.class, new AWTPattern(){{
JavaFullClassName = "com.techrx.security.dialog.SplashLogin";
AWTComponentAccessibleName = "login page";
AWTComponentIndex = -1;
}}).find(Control.class, new AWTPattern(){{
JavaFullClassName = "javax.swing.JRootPane";
AWTComponentAccessibleName = "";
AWTComponentIndex = 0;
}}).find(Control.class, new AWTPattern(){{
AWTComponentName = "null.layeredPane";
}}).find(Control.class, new AWTPattern(){{
AWTComponentName = "null.contentPane";
}}).find(Control.class, new AWTPattern(){{
AWTComponentName = "Username";
}});
It says element is identified as control and I have type casted is as shown below with a text field.
TextEdit nameAnduserTextField =(TextEdit) process.find(TestProcess.class, new ProcessPattern(){{
ProcessName = "*";
}}).find(TextEdit.class, new AWTPattern(){{
AWTComponentName = "Username";
}});
nameAndRdacTextField.setwText("1234567");
However, we get the error as the element is not identified with an invalid pattern. Can someone let us know what has to be done for this?