Ask a Question

Unable access iframe objects using findchildbyxpath

SOLVED
sasiarun1127
New Contributor

Unable access iframe objects using findchildbyxpath

I'm find the page objects using findchildbyxpath but iframe objects are returning null even path is fine in UI

8 REPLIES 8
Marsha_R
Community Hero

What happens when you use Object Spy on one of those objects?  Please give us a screenshot of the results.


Marsha_R
[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

Sorry for the delay response Object spy cant access the particular object because that object belongs to map. 

please find the screen shot attachment for your referance 

mapFrame = gapPage.FindChildByXPath("//iframe[contains(@src,'flows')]")

above code returning the object 

isMapLoaded = gapPage.FindChildByXPath("//div[contains(@id,'map-loader')]")

the above one returning none type even the xpath is accessing the UI level

Try the Object Spy within TestComplete please.


Marsha_R
[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
sonya_m
SmartBear Alumni (Retired)

Thanks Marsha_R for being helpful! 

 

Hi @sasiarun1127 , it looks like what you are experiencing could be Chrome-specific. Are you using this browser? Chrome can be stopping TestComplete from looking at the iFrame objects. Here’s a quote from a support case with an issue similar to yours: 

 

>>

Please try using the following command line arguments to run chrome: chrome.exe --disable-web-security --user-data-dir=c:\users\user\tempChromeProfile\ --disable-site-isolation-trials If you don't have this folder (c:\users\user\tempChromeProfile\), it will be created automatically. Please note that you will need to enable our extension (SmartBear Test Extension) for the new profile. Information on these arguments can be found in the link below:

https://support.smartbear.com/testcomplete/docs/app-testing/web/general/preparing-browsers/chrome.ht...

<<

 

Please also read the following article for more information: 

https://support.smartbear.com/testcomplete/docs/app-testing/web/general/considerations.html 

 

Let me know if this approach helps. Thank you. 


Sonya Mihaljova
Community and Education Specialist

Hi,

 

You should (even must) avoid using .FindChildByXPath() in favor of native .FindXXX() methods provided by TestComplete.

.FindChildByXPath() is the last resort way when nothing else works.

 

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
================================

Thanks for the response i will check it and let you. 

sonya_m
SmartBear Alumni (Retired)

Hi @sasiarun1127 , were you able to figure out a solution? Did any of the suggestions help? 


Sonya Mihaljova
Community and Education Specialist

Hi
thank you so much for your support
I checked with different iframe element using findchildbyxpath everything is working fine i am able to locate the element using find child or fildchildbyxpath actual problem is unable to access google map elements only.
we found the solution
took the iframe src and open it separate window now i am able to access the object elements using object spy and findchild
thanks

cancel
Showing results for 
Search instead for 
Did you mean: