tvklovesu
3 years agoFrequent Contributor
FindChildbyXpath is not able to identify few objects.
Hi,
I am trying to get the object and click on it by using the findchildbyxpath method. The page has more than 10 records and when I used this method It identified few of them and others didn't and the TestComplete throws the following error
JavaScript runtime error.
TypeError: Cannot read property 'click' of null
TypeError: Cannot read property 'click' of null
NameMapping.Sys.browser.pageRavenCore.searchResults_row_Btn = //div[@data-testid="searchResults"]
When I search for record that has 'Recipient' then it identified and able to execute the below line
NameMapping.Sys.browser.pageRavenCore.searchResults_row_Btn.FindChildByXPath('/*[contains(text(),"Recipient")]').click()
When I search for record that has 'name' it is not identified and getting the above error when tried to click on it. But the same xpath identified the object when I tried in chrome console.
NameMapping.Sys.browser.pageRavenCore.searchResults_row_Btn.FindChildByXPath('/*[contains(text(),"name")]').click()
I am not sure if I am missing anything in the xpath
TIA