Forum Discussion

mhienbinhphuoc_'s avatar
Occasional Contributor
11 years ago

QuerySelector result is null although object is existing on webpage

Dear all,

I recorded action: close form on webpage.

Code is generated as below: 


When running it, log is warning and error:

Warning: Searching for the mapped object took a long time.

Error: An error occurred while accessing the "Click" method or property of the "link" object.

The object or one of its parent objects was not found.

I recorded this action by Selenium tool, code is generated:

      driver.FindElement(By.CssSelector(" > a")).Click();

Then I used CssSelector generated by Selenium to QuerySelector in Testcomplete as below:

     var page = Sys["Browser"]()["Page"]("*");      

     var closeBtn = page["QuerySelector"](" > a");

Result closeBtn is null.

Please give me some idea/ suggestion to resolve it.



1 Reply