Hi!
If I start Chrome and navigate to https://www.ranorex.com/blog/ and then in the Spy tool enter this RxPath: "/dom[@caption~'^(?i:software automation)' and @path~'(?i:/blog)']" Spy finds the DOM 4 times:
When I hightlight in Spy 2 of the references highlights the Chrome browser, but 2 highlights my Slack-application. I have also seen the same behaviour for Visual Studio Code (Spy seems to think the DOM is present there).
What is going in? Why does it find 2 different references to Chrome and references that highligts non relevant applications. This kills performance, if a RxPath containing "//" it can take 40-80 seconds for Spy to find the element. If close Slack/VSC it is faster, but why does Spy "find" the same DOM multiple times? Has anyone seen this?
Using Ranorex 9.0.
Best regards,
Spy tool finds web DOM multiple times?
Spy tool finds web DOM multiple times?
You do not have the required permissions to view the files attached to this post.
Re: Spy tool finds web DOM multiple times?
Hi,
It’s caused by shadow DOMs. Check this post for a solution...
domain-name-problem-t13656.html#p53592
It’s caused by shadow DOMs. Check this post for a solution...
domain-name-problem-t13656.html#p53592
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: Spy tool finds web DOM multiple times?
Hi again,
I had to turn of 'Enable JS-based RanorXpath evaluation' after Ranorex 9.0 installation due to other reasons (it failed to resolve the ChildIndex-property in my code when the option was activated).
I tried checking for visability, but that doesn't help. They are all visible:
The only way I see at the moment is to go by @processname... it seems to do the trick.
Although it will be some work for me to actually implement this in a nice way into my large existing codebase/repo.
Regards,
I had to turn of 'Enable JS-based RanorXpath evaluation' after Ranorex 9.0 installation due to other reasons (it failed to resolve the ChildIndex-property in my code when the option was activated).
I tried checking for visability, but that doesn't help. They are all visible:
The only way I see at the moment is to go by @processname... it seems to do the trick.
Although it will be some work for me to actually implement this in a nice way into my large existing codebase/repo.
Regards,
You do not have the required permissions to view the files attached to this post.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Spy tool finds web DOM multiple times?
Hi Ethan,
I believe you are experiencing a known Chrome/Electron application issue that has been resolved in Ranorex 8.3.3 and will be part of Ranorex 9.0.1 (soon to be released). To confirm if this is the issue you are experiencing, look at each dom element and see if the browser attribute is showing other applications like in the screenshot below.
If you are experiencing this bug, you can use one of the below options:
Regards,
Ned
I believe you are experiencing a known Chrome/Electron application issue that has been resolved in Ranorex 8.3.3 and will be part of Ranorex 9.0.1 (soon to be released). To confirm if this is the issue you are experiencing, look at each dom element and see if the browser attribute is showing other applications like in the screenshot below.
If you are experiencing this bug, you can use one of the below options:
- Use Ranorex 8.3.3
- Wait until Ranorex 9.0.1
- Whitelist Chrome
Regards,
Ned
You do not have the required permissions to view the files attached to this post.
Re: Spy tool finds web DOM multiple times?
Correct, Browser says for example:
The best I can do is to include @Visible='True', that filters out those not from Chrome, but that still gives me 2 DOMs for Chrome?
Best regards,
The best I can do is to include @Visible='True', that filters out those not from Chrome, but that still gives me 2 DOMs for Chrome?
Best regards,
You do not have the required permissions to view the files attached to this post.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Spy tool finds web DOM multiple times?
Hi Ethan,
Whitelisting Chrome should resolve this issue, were you able to try this? Alternatively, you can use Ranorex 8.3.3 or wait for Ranorex 9.0.1 to be released (which contain the bugfix for this issue).
Regards,
Ned
Whitelisting Chrome should resolve this issue, were you able to try this? Alternatively, you can use Ranorex 8.3.3 or wait for Ranorex 9.0.1 to be released (which contain the bugfix for this issue).
Regards,
Ned
Re: Spy tool finds web DOM multiple times?
Yes, thanks for that tip. Note that I use a setup of C#/SpecFlow/NUnit/Ranorex API with a element repo created from Spy (that is, I'm not using Ranorex Studio).
I basically added:
Configuration.Current.Plugins.Win32.WhitelistedProcesses = new string[] { "chrome" };
I have not measured anything yet, but I feel this change increased performance when I run tests on my local machine (Windows 10), where I have alot of windows/applictions opened and the same DOM appeared many times in Spy.
When I deployed the code to a Windows Server 2012 (where the actual testjob run) it failed to find Chrome/DOM when the whitelist was applied, but I haven't had time to investigate this. It is not as crucial there either, since Chrome is the only opend application on that desktop so performance is better there. It's on my local machine everything that can increase performance/reduce element finding times is crucial.
Thanks.
I basically added:
Configuration.Current.Plugins.Win32.WhitelistedProcesses = new string[] { "chrome" };
I have not measured anything yet, but I feel this change increased performance when I run tests on my local machine (Windows 10), where I have alot of windows/applictions opened and the same DOM appeared many times in Spy.
When I deployed the code to a Windows Server 2012 (where the actual testjob run) it failed to find Chrome/DOM when the whitelist was applied, but I haven't had time to investigate this. It is not as crucial there either, since Chrome is the only opend application on that desktop so performance is better there. It's on my local machine everything that can increase performance/reduce element finding times is crucial.
Thanks.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Spy tool finds web DOM multiple times?
Since you are using code only, try the below. This will help determine if the whitelisting feature is working on your machine. From my local testing, before whitelisting, there are three Chrome doms when only one is opened (others are from Slack and Skype). After whitelisting, it is reporting one (the correct one).
Hope this helps!
Cheers,
Ned
Code: Select all
IList<WebDocument> chromeDoms;
//Print total Chrome doms (before whitelisting)
chromeDoms = Host.Local.Find<WebDocument>("/dom[@browsername='Chrome']");
Report.Info("Total Doms (before whitelisting): " + chromeDoms.Count);
//Add to Whitelist
Ranorex.Core.Configuration.Current.Plugins.Win32.WhitelistedProcesses = new string[]{"chrome"};
//Print total Chrome doms (after whitelisting)
chromeDoms = Host.Local.Find<WebDocument>("/dom[@browsername='Chrome']");
Report.Info("Total Doms (after whitelisting): " + chromeDoms.Count);
Cheers,
Ned
Re: Spy tool finds web DOM multiple times?
Yes, works fine and speeds up test exection on my development machine! Thanx....