cancel
Showing results for 
Search instead for 
Did you mean: 

How to get dialog in Edge

sumire
Level 9
Here is sample HTML;
<head>
<meta charset="utf-8"/>
<title>sample01</title>
</head>

<body>
<button onclick="getNow()">show dialog</button>

<script type="text/javascript">
function getNow() {
	var now = new Date();
	var year = now.getFullYear();
	var mon = now.getMonth()+1;
	var day = now.getDate();
	var hour = now.getHours();
	var min = now.getMinutes();
	var sec = now.getSeconds();

	var s = year + "/" + mon + "/" + day + " - " + hour + ":" + min + ":" + sec; 
	alert(s);
}
</script>

</body>
</html>​

If I view this in IE;
22099.pngThis dialog can be detected by the window handle "#32770", so I can retrieve the dialog message and press the OK button.

If I view this in Edge;
22100.pngHow can I detect and manipulate this dialog other than surface automation?



------------------------------
Mitsuko
Asia/Tokyo
------------------------------

------------------------------
Mitsuko
Asia/Tokyo
------------------------------
8 REPLIES 8

EVIPUTI
MVP
@sumire 
It might be best to create a second object to handle the pop-up. In App Modeller choose the 'windows application' and 'attach' options, Just give window title & child index to attach to the popup OR Put it to foreground Send a specific key combination to click it away.


------------------------------
------------------------------
Vipul Tiwari
Senior Process Simplification and Optimization Designer(Solutions Architect)
Fidelity International
------------------------------
------------------------------
------------------------------ Vipul Tiwari Senior Process Simplification Developer Amazon ------------------------------

I believe alerts are passed through to the browser to render and that when Chrome / Edge / Firefox render alerts they do so in a way that is typically only accessible from Win32 or UIA as the alert modals themselves are not html based. If you don't have the launch argument specified to allow UIA rendering on the browser's part you may not be able to spy using UIA mode. (something like --force-renderer-accessibility)

------------------------------
Erin Connerley
Automation Consultant
Agilify Automation
America/Indiana/Indianapolis
------------------------------

@Vipul Tiwari
I can spy alert using UIA, but cannot spy the message in the alert or press the OK button.
When manipulating alert in IE, I create a separate object to operate, but in case of Edge, that don't seems to be a solution.​

------------------------------
Mitsuko
Asia/Tokyo
------------------------------
------------------------------
Mitsuko
Asia/Tokyo
------------------------------

You are right @sumire you can not spy as you spy in IE. So you can just spy the window and use close window in Navigate button sometimes it work​s other wise just activate send Enter. I handled it on the same way in Chrome browser.

------------------------------
Amlan Sahoo
RPA Consultant
Equinix
------------------------------
Regards,
Amlan Sahoo

@sumire Can you try getting the text in clipboard from alert using send keys ?​

------------------------------
------------------------------
Vipul Tiwari
Senior Process Simplification and Optimization Designer(Solutions Architect)
Fidelity International
------------------------------
------------------------------
------------------------------ Vipul Tiwari Senior Process Simplification Developer Amazon ------------------------------

Have you tried to use the UI Automation Navigator to find it and spy it, sometimes that will see way more of the UIA tree than simply spying can access. Opening the navigator

------------------------------
Erin Connerley
Automation Consultant
Agilify Automation
America/Indiana/Indianapolis
------------------------------

@_Amlansahoo

I was able to close dialog. Thanks for the good advice.
How do you handle dialog that have 2 buttons to select?​ (OK/Cancel or Yes/No)

22092.png



------------------------------
Mitsuko
Asia/Tokyo
------------------------------
------------------------------
Mitsuko
Asia/Tokyo
------------------------------

Hi @sumire I am happy it helps you.
Coming to your 2nd question it will be always tricky as it's difficult to spy okay and cancel button. So I guess by default always if you activate that window then the focus may be in okay Button so may be you can pass enter and for cancel TAB + ENTER. I am just thinking the same there may be better way.

------------------------------
Amlan Sahoo
RPA Consultant
Equinix
------------------------------
Regards,
Amlan Sahoo