Hi expert,
We are currently facing an issue about how to identify UI elements in iframe tag. When running test case, ranorex can not find the UI elements. Our product is on desktop, technically iframe is already supported by Ranorex.
Operating system: win10
Ranorex version: 6.2.1
Browser: chrome Version 56.0.2924.87
The snapshot file is attached.
Also the screenshot of ranorex spy.
Thanks for your answers.
How to identify UI elements in iframe tag
How to identify UI elements in iframe tag
You do not have the required permissions to view the files attached to this post.
Last edited by skieur on Wed Mar 08, 2017 7:32 am, edited 1 time in total.
Re: How to identify UI elements in iframe tag
Hi,
At first, Is it just Chrome specific issue? Have you tried it with other browsers?
At next, please check these posts regarding Chrome and iframes:
http://www.ranorex.com/forum/cross-doma ... t9163.html
http://www.ranorex.com/forum/all-of-a-s ... tml#p35556
Some more Chrome and iframe related posts can be found here:
http://www.ranorex.com/search.html?q=chrome%20iframe
At first, Is it just Chrome specific issue? Have you tried it with other browsers?
At next, please check these posts regarding Chrome and iframes:
http://www.ranorex.com/forum/cross-doma ... t9163.html
http://www.ranorex.com/forum/all-of-a-s ... tml#p35556
Some more Chrome and iframe related posts can be found here:
http://www.ranorex.com/search.html?q=chrome%20iframe
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: How to identify UI elements in iframe tag
Hi,
thank you for your quick response.
Yes, it's Chrome specific issue. In firefox, the input box in iFrame can be identified...This all happens after we use iframe for our login page...
And we added the web security flag, still the same...we are wondering whether it's because the path is not correctly written? Perhaps you could give a shot?
thanks a lot

thank you for your quick response.
Yes, it's Chrome specific issue. In firefox, the input box in iFrame can be identified...This all happens after we use iframe for our login page...
And we added the web security flag, still the same...we are wondering whether it's because the path is not correctly written? Perhaps you could give a shot?
thanks a lot



Last edited by skieur on Wed Mar 08, 2017 7:33 am, edited 1 time in total.
Re: How to identify UI elements in iframe tag
Hi,
If you start Chrome with parameters suggested in >this post<, it should work for you (worked for me). Here are the xpaths I was able to obtain in Chrome:
The user data dir path should look like this:
C:\Users\username\AppData\Local\Google\Chrome\User Data\Default
BTW, Chrome always keeps some libs/exes open even after you close the main Chrome window. So if you want to make above trick working, you must first make sure there is no "Google Chrome" instance open in Win Task Manager.
If you start Chrome with parameters suggested in >this post<, it should work for you (worked for me). Here are the xpaths I was able to obtain in Chrome:
Code: Select all
/dom[@domain='hybris-cecenter-agenthome-ui-test-v1.us-east.modules.yaas.io']//iframe[#'signInTarget']//input[#'username']
/dom[@domain='hybris-cecenter-agenthome-ui-test-v1.us-east.modules.yaas.io']//iframe[#'signInTarget']//input[#'password']
C:\Users\username\AppData\Local\Google\Chrome\User Data\Default
BTW, Chrome always keeps some libs/exes open even after you close the main Chrome window. So if you want to make above trick working, you must first make sure there is no "Google Chrome" instance open in Win Task Manager.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: How to identify UI elements in iframe tag
Hi odklizec,
Still not working, the error log is:
Failed to find item 'CECenterAgentRepository.test.Self'.
No element found for path '/dom[@domain='hybris-cecenter-agenthome-ui-test-v1.us-east.modules.yaas.io']//iframe[#'signInTarget']//input[#'username']' within 30s.
I put the screenshot for the chrome settings here, in case I set it wrong...
The code snippet:
Somewhere is wrong?
thanks:)
Still not working, the error log is:
Failed to find item 'CECenterAgentRepository.test.Self'.
No element found for path '/dom[@domain='hybris-cecenter-agenthome-ui-test-v1.us-east.modules.yaas.io']//iframe[#'signInTarget']//input[#'username']' within 30s.
I put the screenshot for the chrome settings here, in case I set it wrong...
The code snippet:
Code: Select all
Report.Log(ReportLevel.Info, "Website", "Opening web site URL in variable $AgentHomeURL with browser 'Chrome' in maximized mode (with arguments --disable-web-security --user-data-dir=\"C:\\Users\\I330955\\AppData\\Local\\Google\\Chrome\\User Data\\Default\").", new RecordItemIndex(0));
Host.Local.OpenBrowser(AgentHomeURL, "Chrome", "--disable-web-security --user-data-dir=\"C:\\Users\\I330955\\AppData\\Local\\Google\\Chrome\\User Data\\Default\"", false, true, false, false, false);
Delay.Milliseconds(0);
thanks:)
You do not have the required permissions to view the files attached to this post.
Re: How to identify UI elements in iframe tag
I would suggest to start Chrome manually (with mentioned parameters) and check the login iframe with Ranorex Spy...just to be sure it's working if Chrome is started manually. If it does not work, then I guess there is some previous instance of Chrome still running in background. Check the Task Manager if there is no Google Chrome open.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: How to identify UI elements in iframe tag
I followed your suggestion..no can not identify the element..
1.Set the settings in Target, as figure below:
2. The settings is: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir="C:\Users\I330955\AppData\Local\Google\Chrome\User Data\Default"
3.When open the chrome manually, it looks like:
4.Use track to capture the element, still can not identify the input box...There is a warning message on the right, says: Please make sure you have the Ranorex Extension.
We actually installed the extension for sure, but when adding extra web security flag to open chrome, it seems Ranorex Extension can not be activated...
So weird...I have no idea why it does not work

1.Set the settings in Target, as figure below:
2. The settings is: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir="C:\Users\I330955\AppData\Local\Google\Chrome\User Data\Default"
3.When open the chrome manually, it looks like:
4.Use track to capture the element, still can not identify the input box...There is a warning message on the right, says: Please make sure you have the Ranorex Extension.
We actually installed the extension for sure, but when adding extra web security flag to open chrome, it seems Ranorex Extension can not be activated...
So weird...I have no idea why it does not work



You do not have the required permissions to view the files attached to this post.
Re: How to identify UI elements in iframe tag
1 and 2 Looks OK. You can ignore message in step 3. As for Ranorex extension, yes, it's disabled after first Chrome start with mentioned parameters, but it should be possible to re-enable it? At least it worked for me. Then after Chrome restart, Spy should work as expected. I just tried it on a completely different machine and it worked here as well.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: How to identify UI elements in iframe tag
Thanks man, it works!
Thank you so much for your help
Thank you so much for your help



odklizec wrote:1 and 2 Looks OK. You can ignore message in step 3. As for Ranorex extension, yes, it's disabled after first Chrome start with mentioned parameters, but it should be possible to re-enable it? At least it worked for me. Then after Chrome restart, Spy should work as expected. I just tried it on a completely different machine and it worked here as well.
Re: How to identify UI elements in iframe tag
Great! I'm glad I could help 

Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration