How do you double click an item from a table based upon variable selected?

I am at another in pass. When I was using selenium I would query the db for a user and a customer that user had. These values where stored as variables and then used when logging into the system and when searching for the customer. On the customer page a user can search and is presented with results in a table. So with Katalon Studio I created a variable that selects a user and their customers into a single query result. I then choose user login and customer as a variable based upon row and column. Since the query generates them in a random order I am ensured my automation will always have a different user and customer.

 

The problem I am having is when I login, select customers, query the customer I can’t select the customer from the result. The error is telling me the object is not defined. I am needing to pass the customer name which is defined as the variable query into the double click step. I do not know how to do this.

this is how it looks if I use record

WebUI.switchToWindowTitle(‘Customers’)

WebUI.setText(findTestObject(‘Customers/Page_Customers/input_monoFilter’), Customer USA)

WebUI.doubleClick(findTestObject(‘Page_Customers/td_Customer USA’))

 

 

this works now I try to replace with dynamic

WebUI.switchToWindowTitle(‘Customers’)

WebUI.setText(findTestObject(‘Customers/Page_Customers/input_monoFilter’), customerName)

WebUI.doubleClick(findTestObject(‘Page_Customers/td_’ + customerName))

 

 

 

07-18-2017 07:58:09 AM - [WARNING] - Test object with id ‘Object Repository/Page_Customers/td_GENAN INC’ does not exist
07-18-2017 07:58:09 AM - [START] - Start action : doubleClick
07-18-2017 07:58:09 AM - [INFO] - Finding Test Object with id ‘Object Repository/Page_Customers/td_GENN GENA INC’
07-18-2017 07:58:09 AM - [INFO] - Finding Test Object with id ‘Object Repository/’
07-18-2017 07:58:09 AM - [WARNING] - Test object with id ‘Object Repository/’ does not exist
07-18-2017 07:58:09 AM - [INFO] - Checking object
07-18-2017 07:58:09 AM - [FAILED] - Unable to double click on object (Root cause: java.lang.IllegalArgumentException: Object is null)
07-18-2017 07:58:09 AM - [END] - End action : doubleClick
07-18-2017 07:58:09 AM - [FAILED] - Test Cases/03_Customers/Customer_Add_Commission_Test FAILED because (of) Unable to double click on object (Root cause: java.lang.IllegalArgumentException: Object is null)
07-18-2017 07:58:09 AM - [END] - End Test Case : Test Cases/03_Customers/Customer_Add_Commission_Test

How would I use this parameterize? The object when spied comes up like this
“Object Repository/Page_Customers/td_GENAN INC”

Properties from repository are:
name Match Condition Value
tag equals td
xpath equals id(“11515”)/td[1]
text equals GENAN INC

The problem I am having is that the object is different based upon what query you run, each customer has a unique id and name. I get the name dynamically using my data file with a DB query. I’m not sure how to select from list based upon this.
in javascript I did it this way:

NOTE: customer is my variable, stored from query to the db and used in my search step

client.assert.containsText(’#customer-select-table > tbody > tr’, customer)

//verification that customer is present added
client.DoubleClick(’#customer-select-table > tbody > tr’)

// First Search Result

Hi B L,

This line might be your problem

“WebUI.doubleClick(findTestObject(‘Page_Customers/td_’ + customerName))”

This indicates that in run-time, Katalon Studio will look for an object with a dynamic name.

So unless you have an object with a name as the same with that dynamic name, such as “Object Repository/Page_Customers/td_GENAN INC” for this case, your test will fail.

Note: for parameterize your object, try this feature.

Ok but even with that, its still clicking the wrong row. it’s checking the rows sees it exists then clicks another row in the same table.

yes but it’s not working is what I’m saying
WebUI.doubleClick(findTestObject(‘Page_Customers/td_"+customerName+"’))

I have it set up to be dynamic, it finds the row with the info that is being passed. It’s just not clicking it. It’s clicking a different row in the webtable.

When I debug and step through it’s showing the correct dynamic value
WebUI.doubleClick(findTestObject(‘Page_Customers/td_"+customerName+"’))

it’s just not clicking the right one. I tried again with another column which is a number and pass the number value and it’s seeing the number and not clicking it.

In this case I pass the text value from the field
String loadPO = WebUI.getText(findTestObject(‘02 Dashboards/01 Loadboard/04 Future Loads/Table values/01_label_FirstPONumber’))

to store as the variable ‘double click first row po number’
WebUI.doubleClick(findTestObject(‘02 Dashboards/01 Loadboard/04 Future Loads/Table values/00_row_FirstLoadRow’))I try to click in next step

however it’s opening a different row in the webtable. It’s not clicking the correct spot