Originally posted by nastester on February 13, 2025
I am using variables in name mapping objects to pull data from an Excel sheet and then verify with Property Checkpoints.
It is working fine for the first 3 rows in my sheet. But on the fourth row I am getting an error for the address. The previous 3 addresses worked fine. The local variable was updated and checkpoint passed. Also the first four checkpoints for this fourth row of data worked fine, it just fails on the address.
I cannot figure out why this fourth one is failing. Any ideas? Lots of info/screenshots below that will hopefully help.
Originally posted by nastester on February 13, 2025
What is that 0 even for?
I see what you’re talking about:
Aliases.browser.pageIcoms.panelStAdd, “contentText”, 0, Project.Variables.StreetAddr_KW, true
But I also see that for all the other checkpoints when I click into the row.
I think you’re right that something is not right with the object mapping but not sure how to troubleshoot further. Especially since it works fine for my first three rows and it “looks” correct compared to all my other mapped objects
Originally posted by scot1967 on February 13, 2025
I think you’re right that something is not right with the object mapping but not sure how to troubleshoot further. Especially it works fine for my first three rows and it “looks” correct compared to all my other mapped objects
I sometimes use this trick. You may not be into scripting but you can start a script recording click on your target object and then stop the recording and TestComplete will show you a script with a complete path to the object. It may also add an alias to your namemap depending on how your project is setup.
Originally posted by scot1967 on February 13, 2025
I too have seen Excel formatting issues like this. This usually results in a checkpoint failure not a namemap error.
It looks like button51c is clicked prior to looping through the app objects to compare them to each Excel row cell. There is also a ‘Click’ and SetText for each row within the loop.
Originally posted by Hassan_Ballan on February 13, 2025
Your first three values are identical, the forth is different.
You are using a parametrized NameMapping and the value changed; therefore, it does not find the target object as the log message states.
Each time you set value to the NameMapping variable you need to refresh the mapping info for it to take effect. Otherwise, the cache value takes over.
Originally posted by scot1967 on February 13, 2025
This image indicates an issue with the namemap accessing panelStAdd. In your loop there is a click and a text entry action that seems to indicate adding text to a filter in the page.
Originally posted by nastester on February 13, 2025
All, thank you for your responses. I finally uncovered the issue. The issue was some of the data the mock API is returning had spaces in the address field (which was truncated by table so not noticeable when looking at the UI). The data from the UI was copied into the spreadsheet so it didn’t have the space. I still don’t know why TC didn’t log the ER/AR and show that they didn’t match but when I updated the mock data to not have spaces, everything worked.
Originally posted by nastester on February 14, 2025
Expected result/actual result.
And no, the test is verifying that the data table on the UI is displaying the expected data from the API in the right location. It isn’t inputting any data.
Originally posted by scot1967 on February 14, 2025
It seems you are using the actual street address (which is dynamic) as matching data in your name map based on a keyword test parameter or project variable. “//div[.=‘%StreetAddr_KW%’]” This could make your test brittle as it is based on the format of the address. A better alternative would be to map the web control using another static property and compare the value of that control if possible. This should prevent name mapping errors unless the web page itself is altered by dev.
Originally posted by scot1967 on February 14, 2025
The use of dynamic data in a name map also makes is necessary to refresh the namemap and object instance (effectively remapping the object) prior to each call to the mapped object to make the comparison. This will slow your test down considerably.