Contributions
Re: Finding a row in a Java TreeTable
strata.common.gui.treetable.JTreeTable. I realize this is a custom control and to give you a sense of how it's put together, here's a description: Asimple JTreeTable component which usesJTree as a renderer (and editor) for the cells in a particular column in a JTable. Based on this, would I have the JTree methods at my disposal, the JTable methods (thinking not as the FindRow is not working) or both?846Views0likes0CommentsFinding a row in a Java TreeTable
Does anyone have experience working with a Java TreeTable given the value of a cell? I've tried using the FindRow method and it's not working. I've dug around for a native Java method as well haven't been able to come up with anything. I have fully expanded the table in a previous step. Any suggestions would be greatly appreciated. I am programming in JavaScript.18KViews0likes3CommentsRe: Log object variables
What I'm trying to figure out is what object type has wound up in the textField variable. My application creates a dynamic java table and each value field can be a different object (text field, combo box, password, etc). The object type can be derived from the application database, but there's a bit of convoluted logic to make the determination, and I don't always get it right. I have the switch case statement to set the textField object variable based on the output of the database. In the instance my query is incorrect, I'd like to know which object type was placed into the textField variable (e.g. panelC.TextField, panelC.ComboBox.TextField, etc.). However, if I just log the textField variable, it shows up as nothing more than a blank in the log.970Views0likes0CommentsLog object variables
Is there a way to display the value of an object variable in the log? I have to determine what kind of object I'm trying to test against based input from a properties table. I have a situation where it appears that TC is not finding the object, but I'd like to display what object type it thinks it's looking for. When I do a Log.Message(textField), I get nothing but a blank message line in the log. Below is a snippet of my code. I want to see what's been put in the textField variable once the switch command has executed. Thanks. switch (vfpFPObjType) { case "PropCombo": textField = panelC.PropTypeComboBox.TextField; break; case "TableCombo": textField = panelC.TableComboBox.TextField; break; case "PropText": textField = panelC.PropTypeTextField; break; case "SimpleString": textField = panelC.TextField; break; case "Password": textField = panelC.SwingObject("JPasswordField", "", 0) break; default: Log.Message("Type Not Found"); } Log.Message(textField);20KViews0likes3CommentsJava Dialog Box Identification Issues
I have a situation where a Java Swing JDialog box has a variable caption that will change from run to run. Using the traditional name mapping based on child objects has not worked as TC starts looking for other dialog boxes if the caption is not specified. I have gotten around this by using the full object mapping and specifying the variable part of the dialog by passing the name into the dialog caption. It looks like this: dialog = javaw.SwingObject("JDialog", "Update BNMCUST table on Switch: "+ custSwitch +" ?", -1, 1); TestComplete also seems to think the dialog box is invisible and I got around that by setting the dialog box to visible and then I click on it, just to be sure. dialog.setVisible(true); dialog.Click(178, 3); What I am now hung up on is the fact that it seems like the Yes and No buttons in the dialog box are mapped to the same object, as far as Test Complete is concerned. Both full names map to this: Sys.Process("javaw", 2).SwingObject("JDialog", "Update BNMCUST table on Switch: CABLAB ?", -1, 1).SwingObject("JRootPane", "", 0).SwingObject("null.layeredPane").SwingObject("null.contentPane").SwingObject("JOptionPane", "", 0).SwingObject("OptionPane.buttonArea").SwingObject("OptionPane.button") I want to select the No button, but when I use the above string in my code, the Yes button gets selected. I've tried adding combinations of caption and index toSwingObject("OptionPane.button") (e.g.SwingObject("OptionPane.button","",1) orSwingObject("OptionPane.button", "No",1), etc) but when I do, Test Complete cannot find the object. I am attaching a word doc which contains a screenshot of the dialog box itself, and object mappings of the Yes and No buttons. Any assistance would be greatly appreciated as this has me dead in the water right now. Thanks.22KViews0likes2CommentsRe: Jscript - Object doesn't support this property or method
I figured it out. The object variables cannot be defined within the query, i.e. as strings. I ended up taking the results of my case statement in the query and passing that through a Switch statement to then assign the object type to textField. Worked after that.1.2KViews0likes0CommentsJscript - Object doesn't support this property or method
Been away from TestComplete for a few months and when recently modifying one of my scripts, am now encountering the following error. My application is a Java Swing based app and I'm using Jscript as my TC coding language. Object doesn't support this property or method Error location: Unit: "QA_Data_Fill\QA_Data_Fill\Script\Service_Provider" Line: 159 Column: 10. Here's what I'm doing: 1) Click on a tab in the application which contains a Java table. 2) Execute a MySQL query to get the list of values that need to be set in the table. 3) Execute an Oracle query to determine theobject type of the object and set that to the variable textField. 4) Click on the field based on step 2) 5) Populate that field based on object type determined in 3. I used to run the query in 3), then set the object type variable in a Switch statement. I thought it might be more efficient to just move it up into 3)'s case statement. However, I'm getting the Object doesn't support error. Why would this be? If I record the script, just clicking on the same fields and populating, they look exactly like I'd think the code with the variable should look. I'm stumped. Thanks. serviceProviderPropertySheet.TabbedPane.ClickTab("Properties"); propertyTable = serviceProviderPropertySheet.TabbedPane1.Panel.Panel.ScrollPane.Viewport.PropertyTable; //Get the property data var spPropQry = "SELECT locale, property, propertyvalue " + "FROM serviceprovider_properties " + "where serviceprovider = '" + spNm + "';"; var spProp = DDT.ADODriver(ProjectSuite.Variables.varConStrMySQL, spPropQry); //populate the property data while(!spProp.EOF()) { var spLocale = spProp.Value(0); var spProperty = spProp.Value(1) ; var spPropertyVal = spProp.Value(2) ; RowIndex = propertyTable.FindRow(0, spProperty); if (RowIndex != -1) { //Get the property type from C3C Database var spPropTypeQry = "SELECT dd.abbreviation, dd.pk_locale_code, df.property_type_code, df.property_type_pkg_sid, pp.\"VALUE\", "+ "CASE when df.property_type_code = 'SimpleString' then 'propertyTable.TextField' WHEN pp.\"VALUE\" LIKE '%PropTypeComboBox%' THEN 'propertyTable.PropTypeComboBox.TextField' WHEN pp.\"VALUE\" LIKE '%PropTypeTextField%' THEN 'propertyTable.PropTypeTextField' ELSE 'propertyTable.TextField' END AS PropType "+ "from AD_SPROV_PRP_D dd "+ "LEFT JOIN AD_SPROV_prp_def df ON dd.NAME = df.NAME "+ "LEFT JOIN PROP_TYPE P ON df.property_type_code = p.property_type_code AND df.property_type_pkg_sid = p.property_type_pkg_sid "+ "LEFT JOIN PROP_TYPE_PRM PP ON P.PROPERTY_TYPE_CODE = PP.PROPERTY_TYPE_CODE AND p.PROPERTY_TYPE_PKG_SID = pp.PROPERTY_TYPE_PKG_SID And pp.PARAMETER_CODE = 'editorClassName' "+ "where pk_locale_code = '" + spLocale + "' and abbreviation = '" + spProperty + "'"; //set the control type based on what's pulled from the database. var spPropType = DDT.ADODriver(ProjectSuite.Variables.varConStrOracle, spPropTypeQry); var counter = 0 while(!spPropType.EOF()) { if (counter>1) { Log.Error("ERROR - More than one row returned from properties query " + textField + " " + counter); } textField = spPropType.Value(5); Log.Message("textField = " + textField); counter = counter+1 ; spPropType.Next(); } propertyTable.ClickCell(RowIndex, 1); //set the property value if (spProperty == "Enable Endpoint Pooling") { textField.Keys("^a"+spPropertyVal); Aliases.javaw.dialog04.RootPane.null_layeredPane.null_contentPane.OptionPane.OptionPane_buttonArea.OptionPane_button.ClickButton(); textField.Keys("[Tab]"); } else Log.Message("spPropertyVal = " + spPropertyVal); Log.Message("textField = " + textField); textField.Keys("^a"+spPropertyVal+"[Tab]"); } else Log.Warning("Warning" + spProperty+ "not found in Properties Table"); spProp.Next(); }21KViews0likes2Comments