[Solve] Confirm dialog not detect

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
ducarpit
Posts: 19
Joined: Thu Apr 23, 2020 1:48 pm

[Solve] Confirm dialog not detect

Post by ducarpit » Thu Apr 23, 2020 1:54 pm

Hi,
i am testing a web application but i have a problem with the dialog confirm of the browser.
I have to click on the OK button (see the attachment) but Ranorex Studio can't detect this form.
I tryed with Spy but unfortunatly when i run the test it fails.
How can i solve this?
I use Google Chrome as browser.
Thank you so much in advance

Christian
Attachments
confirm.JPG
confirm.JPG (17.69 KiB) Viewed 208 times
Last edited by ducarpit on Tue Apr 28, 2020 8:08 am, edited 1 time in total.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6036
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Confirm dialog not detect

Post by odklizec » Fri Apr 24, 2020 11:34 am

Hi,

Add this parameter to "Open Browser" argument...
--force-renderer-accessibility
For manual xpath/repository editing, simply start chrome with this argument (chrome.exe --force-renderer-accessibility).

Eventually, if you are testing multiple browsers, you will have to start browser from user code and add the above argument only to Chrome/Chromium-based Edge. This is what I'm using in one of my projects:

Code: Select all

       	public void StartBrowser_Open_Browser(string urlString, string browserNameString)
		{
       		if (browserNameString=="chrome" | browserNameString=="msedge")
			{
				Report.Log(ReportLevel.Info, "Website", "Opening web site URL in variable $url with browser specified by variable $browserName (" + browserNameString + ") in maximized mode (with arguments --args --force-renderer-accessibility --disable-infobars  --noerrdialogs --disable-session-crashed-bubble --disable-restore-session-state).");
				Host.Current.OpenBrowser(urlString, browserNameString, "--ignore-certificate-errors --args --force-renderer-accessibility --disable-infobars --noerrdialogs --disable-session-crashed-bubble --disable-restore-session-state", false, true, false, false, false, false);
			}
			else if (browserNameString=="firefox")
			{
				Report.Log(ReportLevel.Info, "Website", "Opening web site URL in variable $url with browser specified by variable $browserName (" + browserNameString + ") in maximized mode.");
				Host.Current.OpenBrowser(urlString, browserNameString, "", false, true, false, false, false, false);
			}
			else 
			{
				Report.Log(ReportLevel.Info, "Website", "Opening web site URL in variable $url with browser specified by variable $browserName (" + browserNameString + ") in maximized mode.");
				Host.Current.OpenBrowser(urlString, browserNameString, "", true, true, false, false, false, false);
			}
		}
Pavel Kudrys
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

ducarpit
Posts: 19
Joined: Thu Apr 23, 2020 1:48 pm

Re: Confirm dialog not detect

Post by ducarpit » Mon Apr 27, 2020 3:14 pm

odklizec wrote:
Fri Apr 24, 2020 11:34 am
Hi,

Add this parameter to "Open Browser" argument...
--force-renderer-accessibility
For manual xpath/repository editing, simply start chrome with this argument (chrome.exe --force-renderer-accessibility).

Eventually, if you are testing multiple browsers, you will have to start browser from user code and add the above argument only to Chrome/Chromium-based Edge. This is what I'm using in one of my projects:

Code: Select all

       	public void StartBrowser_Open_Browser(string urlString, string browserNameString)
		{
       		if (browserNameString=="chrome" | browserNameString=="msedge")
			{
				Report.Log(ReportLevel.Info, "Website", "Opening web site URL in variable $url with browser specified by variable $browserName (" + browserNameString + ") in maximized mode (with arguments --args --force-renderer-accessibility --disable-infobars  --noerrdialogs --disable-session-crashed-bubble --disable-restore-session-state).");
				Host.Current.OpenBrowser(urlString, browserNameString, "--ignore-certificate-errors --args --force-renderer-accessibility --disable-infobars --noerrdialogs --disable-session-crashed-bubble --disable-restore-session-state", false, true, false, false, false, false);
			}
			else if (browserNameString=="firefox")
			{
				Report.Log(ReportLevel.Info, "Website", "Opening web site URL in variable $url with browser specified by variable $browserName (" + browserNameString + ") in maximized mode.");
				Host.Current.OpenBrowser(urlString, browserNameString, "", false, true, false, false, false, false);
			}
			else 
			{
				Report.Log(ReportLevel.Info, "Website", "Opening web site URL in variable $url with browser specified by variable $browserName (" + browserNameString + ") in maximized mode.");
				Host.Current.OpenBrowser(urlString, browserNameString, "", true, true, false, false, false, false);
			}
		}

Hi,
thanks a lot...
So i have to insert the parameter in this panel (see the attachments) under "arguments" as a new variable?
Attachments
Cattura.JPG
Cattura.JPG (32.34 KiB) Viewed 186 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6036
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Confirm dialog not detect

Post by odklizec » Tue Apr 28, 2020 7:57 am

Hi,

Yes, that's the correct place and yes, you may (or may not) use variable here. However, as I've mentioned, if you are using multiple browsers for your tests, you will have to use code I suggested (or similar), because other browsers will not understand Chrome arguments ;)
Pavel Kudrys
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

ducarpit
Posts: 19
Joined: Thu Apr 23, 2020 1:48 pm

Re: Confirm dialog not detect

Post by ducarpit » Tue Apr 28, 2020 8:08 am

odklizec wrote:
Tue Apr 28, 2020 7:57 am
Hi,

Yes, that's the correct place and yes, you may (or may not) use variable here. However, as I've mentioned, if you are using multiple browsers for your tests, you will have to use code I suggested (or similar), because other browsers will not understand Chrome arguments ;)
Thanks a lot, congratulation for your work and your support!
Christian

ducarpit
Posts: 19
Joined: Thu Apr 23, 2020 1:48 pm

Re: [Solve] Confirm dialog not detect

Post by ducarpit » Tue Apr 28, 2020 1:48 pm

Hi,
i inserted the variable in this way:
Cattura.JPG
Cattura.JPG (18.92 KiB) Viewed 159 times
But it seems not work...

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6036
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: [Solve] Confirm dialog not detect

Post by odklizec » Tue Apr 28, 2020 1:54 pm

Hi,

Please try it first with the standalone Spy and manually started Chrome (with this parameter). Just modify Chrome shortcut and add the parameter right after Chrome.exe. Then start Chrome, simulate opening the dialog and try to track it with Ranorex Spy.
Pavel Kudrys
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

ducarpit
Posts: 19
Joined: Thu Apr 23, 2020 1:48 pm

Re: [Solve] Confirm dialog not detect

Post by ducarpit » Tue Apr 28, 2020 2:11 pm

odklizec wrote:
Tue Apr 28, 2020 1:54 pm
Hi,

Please try it first with the standalone Spy and manually started Chrome (with this parameter). Just modify Chrome shortcut and add the parameter right after Chrome.exe. Then start Chrome, simulate opening the dialog and try to track it with Ranorex Spy.
Hi,
i inserted the parameter:
Cattura.JPG
Cattura.JPG (16.92 KiB) Viewed 156 times
But unfortunatly it doesn't work.
Ranorex Spy can't detect the form, when i click on "Track" and then with the mouse i go over the "OK" button, the outline border in red doesn't appear.
Christian

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6036
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: [Solve] Confirm dialog not detect

Post by odklizec » Tue Apr 28, 2020 2:16 pm

Hi,

And have you tried to locate the element manually in the element tree? Even if tracking is not working, it should still be possible to find the element manually. Just expand the tree and try to locate the dialog.
Pavel Kudrys
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

ducarpit
Posts: 19
Joined: Thu Apr 23, 2020 1:48 pm

Re: [Solve] Confirm dialog not detect

Post by ducarpit » Tue Apr 28, 2020 4:09 pm

odklizec wrote:
Tue Apr 28, 2020 2:16 pm
Hi,

And have you tried to locate the element manually in the element tree? Even if tracking is not working, it should still be possible to find the element manually. Just expand the tree and try to locate the dialog.
Exactly, i tryed...with Firefox this works fine, but with Chrome no....

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6036
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: [Solve] Confirm dialog not detect

Post by odklizec » Tue Apr 28, 2020 8:30 pm

Hi,

Well, Firefox is a completely different story. If does not require to be running in a special debug mode. I’m afraid, I’m out of ideas. From my personal experience, this force-renderer-accessibility parameter usually works with native Chrome dialogs. So I would suggest to enable it on another PC and try it there. Also, are you sure Ranorex plugin is correctly installed in Chrome? Are you able to track web-page elements?
Pavel Kudrys
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

ducarpit
Posts: 19
Joined: Thu Apr 23, 2020 1:48 pm

Re: [Solve] Confirm dialog not detect

Post by ducarpit » Wed Apr 29, 2020 12:43 pm

odklizec wrote:
Tue Apr 28, 2020 8:30 pm
Hi,

Well, Firefox is a completely different story. If does not require to be running in a special debug mode. I’m afraid, I’m out of ideas. From my personal experience, this force-renderer-accessibility parameter usually works with native Chrome dialogs. So I would suggest to enable it on another PC and try it there. Also, are you sure Ranorex plugin is correctly installed in Chrome? Are you able to track web-page elements?
Hi,
yes i am able to track web-page elements but when the Chrome Dialog is open i can't, the outline border in red doesn't appear over the component when the dialog is open....

Christian

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6036
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: [Solve] Confirm dialog not detect

Post by odklizec » Wed Apr 29, 2020 1:42 pm

Hi,

Yes, I understand that the live tracking is not available. However, you should still be able to find the element inside Chrome's form element tree. Here is a small example:
Chrome.png
Chrome.png (93.42 KiB) Viewed 130 times
Pavel Kudrys
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

ducarpit
Posts: 19
Joined: Thu Apr 23, 2020 1:48 pm

Re: [Solve] Confirm dialog not detect

Post by ducarpit » Wed Apr 29, 2020 4:08 pm

odklizec wrote:
Wed Apr 29, 2020 1:42 pm
Hi,

Yes, I understand that the live tracking is not available. However, you should still be able to find the element inside Chrome's form element tree. Here is a small example:
Chrome.png
Hi,
yes, i think i found it:
Capture.PNG
Capture.PNG (41.77 KiB) Viewed 124 times
But unfortunatly it doesn't work, i did this test some times and...same problem!
Tomorrow morning i will try again...

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 6036
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: [Solve] Confirm dialog not detect

Post by odklizec » Thu Apr 30, 2020 8:31 am

Hi,

What exactly does not work? The xpath you manually created in repo does not work in test itself?
Pavel Kudrys
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