cancel
Showing results for 
Search instead for 
Did you mean: 

FindChildByXpath throws error in testcomplete

Gunacelan
Occasional Contributor

FindChildByXpath throws error in testcomplete

 
 
throws me unidentified javascript runtime error at FindChildByXPath
 
 
Note:Use Xpath and Css selectors checkbox is also selected
 
 
What seems to be the issue here?
10 REPLIES 10
AlexKaras
Community Hero

Re: FindChildByXpath throws error in testcomplete

Hi,

 

Use Xpath and Css selectors checkbox is also selected

If you are talking about 'Use XPath and CSS selectors for web objects' project properties option, then .FindElement() method must be used instead of .FindChildByXPath().

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Gunacelan
Occasional Contributor

Re: FindChildByXpath throws error in testcomplete

FindElement also doesn't work. Not sure what is the reason

Gunacelan
Occasional Contributor

Re: FindChildByXpath throws error in testcomplete

And what if I uncheck the 'Use Xpath and css selectors' property , will FindChildByXpath work?

AlexKaras
Community Hero

Re: FindChildByXpath throws error in testcomplete

Hi,

 

FindElement also doesn't work. Not sure what is the reason

Can you post a screenshot of the code and log?

 

if I uncheck the 'Use Xpath and css selectors' property , will FindChildByXpath work?

Yes, it should, but this will disable cross-platform mode and switch back to default local one. (So you will not be able to execute your tests in CrossBrowserTesting and other cloud environments.)

 

> Sys.Browser("chrome").Page(...).FindChildByXPath(...);

Another possible reason is that page was not navigated to.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Gunacelan
Occasional Contributor

Re: FindChildByXpath throws error in testcomplete

1) I tried this without the checkbox "Use Xpath and css selectors" checked
 
Sys.Browser("chrome").Page("*").FindChildByXPath("//button[normalize-space(text())= 'Advanced']");
 
Gunacelan_0-1618894520223.png

 

2) I tried FindElement selecting the checkbox and Using the below code
or
Sys.Browser("chrome").Page("*").FindElement("//button");
 
Gunacelan_1-1618894659859.png

 

Gunacelan
Occasional Contributor

Re: FindChildByXpath throws error in testcomplete

I believe I understood the issue here,

the same methods FindElement and FindChildByXPath works for other web pages in the same URL.

 

I doesn't work only in the initial page I think which might be due to security issue.

 

Can someone help me with this?

 

Gunacelan_0-1618895271369.png

 

AlexKaras
Community Hero

Re: FindChildByXpath throws error in testcomplete

Hi,

 

Yes, correct, this is security issue with Chrome (https://community.smartbear.com/t5/TestComplete-Functional-Web/Testcomplete-Firefox/m-p/215982/highl...) and I think that you will need to add your tested site to the allowed exceptions list.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Gunacelan
Occasional Contributor

Re: FindChildByXpath throws error in testcomplete

How to access buttons and links in this below page through testcomplete?

 

Gunacelan_0-1618912618328.png

 

Gunacelan
Occasional Contributor

Re: FindChildByXpath throws error in testcomplete

I have tried this 

 

chrome.exe --disable-web-security --disable-site-isolation-trials --allow-file-access-from-files https://intenzi-testing-2.centralus.cloudapp.azure.com/
 
 
Still it doesn't work 😞

 

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors