Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in RPA by (5.3k points)

I am facing issue with onbeforeunload window event popup in chrome. I have installed chrome extension.

Steps:

  1. Create Open Browser activity with url:
    https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onbeforeunload"\

  2. Create Click Event with selector:
    <webctrl aaname='Click here to go to w3schools.com' tag='A' />

  3. Create Click Event with selector:
    <ctrl name='Leave site?' role='dialog' /><ctrl name='Leave' role='push button' />

My problem is the second click is not working.

Main.xaml:

<Activity mc:Ignorable="sap sap2010 sads" x:Class="Main" mva:VisualBasic.Settings="{x:Null}" sap2010:WorkflowViewState.IdRef="Main_1" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:sco="clr-namespace:System.Collections.ObjectModel;assembly=mscorlib" xmlns:ui="http://schemas.uipath.com/workflow/activities" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <TextExpression.NamespacesForImplementation> <sco:Collection x:TypeArguments="x:String"> <x:String>System.Activities</x:String> <x:String>System.Activities.Statements</x:String> <x:String>System.Activities.Expressions</x:String> <x:String>System.Activities.Validation</x:String> <x:String>System.Activities.XamlIntegration</x:String> <x:String>Microsoft.VisualBasic</x:String> <x:String>Microsoft.VisualBasic.Activities</x:String> <x:String>System</x:String> <x:String>System.Collections</x:String> <x:String>System.Collections.Generic</x:String> <x:String>System.Data</x:String> <x:String>System.Diagnostics</x:String> <x:String>System.Drawing</x:String> <x:String>System.IO</x:String> <x:String>System.Linq</x:String> <x:String>System.Net.Mail</x:String> <x:String>System.Xml</x:String> <x:String>System.Xml.Linq</x:String> <x:String>UiPath.Core</x:String> <x:String>UiPath.Core.Activities</x:String> <x:String>System.Windows.Markup</x:String> </sco:Collection> </TextExpression.NamespacesForImplementation> <TextExpression.ReferencesForImplementation> <sco:Collection x:TypeArguments="AssemblyReference"> <AssemblyReference>System.Activities</AssemblyReference> <AssemblyReference>Microsoft.VisualBasic</AssemblyReference> <AssemblyReference>mscorlib</AssemblyReference> <AssemblyReference>System.Data</AssemblyReference> <AssemblyReference>System</AssemblyReference> <AssemblyReference>System.Drawing</AssemblyReference> <AssemblyReference>System.Core</AssemblyReference> <AssemblyReference>System.Xml</AssemblyReference> <AssemblyReference>System.Xml.Linq</AssemblyReference> <AssemblyReference>UiPath.Core</AssemblyReference> <AssemblyReference>UiPath.Core.Activities</AssemblyReference> <AssemblyReference>PresentationFramework</AssemblyReference> <AssemblyReference>WindowsBase</AssemblyReference> <AssemblyReference>PresentationCore</AssemblyReference> <AssemblyReference>System.Xaml</AssemblyReference> <AssemblyReference>System.ComponentModel.Composition</AssemblyReference> <AssemblyReference>System.ServiceModel</AssemblyReference> </sco:Collection> </TextExpression.ReferencesForImplementation> <ui:OpenBrowser UiBrowser="{x:Null}" BrowserType="Chrome" DisplayName="Open browser" Hidden="False" sap2010:WorkflowViewState.IdRef="OpenBrowser_3" NewSession="True" Private="False" Url="https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onbeforeunload"> <ui:OpenBrowser.Body> <ActivityAction x:TypeArguments="x:Object"> <ActivityAction.Argument> <DelegateInArgument x:TypeArguments="x:Object" Name="ContextTarget" /> </ActivityAction.Argument> <Sequence DisplayName="Do" sap2010:WorkflowViewState.IdRef="Sequence_25"> <ui:Click DelayBefore="{x:Null}" DelayMS="{x:Null}" ClickType="CLICK_SINGLE" DisplayName="Click 'A https://www.w3school...'" sap2010:WorkflowViewState.IdRef="Click_6" KeyModifiers="None" MouseButton="BTN_LEFT" SendWindowMessages="False" SimulateClick="False"> <ui:Click.CursorPosition> <ui:CursorPosition Position="Center"> <ui:CursorPosition.OffsetX> <InArgument x:TypeArguments="x:Int32" /> </ui:CursorPosition.OffsetX> <ui:CursorPosition.OffsetY> <InArgument x:TypeArguments="x:Int32" /> </ui:CursorPosition.OffsetY> </ui:CursorPosition> </ui:Click.CursorPosition> <ui:Click.Target> <ui:Target ClippingRegion="{x:Null}" Element="{x:Null}" TimeoutMS="{x:Null}" InformativeScreenshot="ad281f65b6ab6cc6ce588fb1cf53160a" Selector="&lt;webctrl aaname='Click here to go to w3schools.com' tag='A' /&gt;" WaitForReady="INTERACTIVE" /> </ui:Click.Target> </ui:Click> <ui:Click DelayBefore="{x:Null}" DelayMS="{x:Null}" ClickType="CLICK_SINGLE" DisplayName="Click 'push button Leave'" sap2010:WorkflowViewState.IdRef="Click_5" KeyModifiers="None" MouseButton="BTN_LEFT" SendWindowMessages="False" SimulateClick="False"> <ui:Click.CursorPosition> <ui:CursorPosition Position="Center"> <ui:CursorPosition.OffsetX> <InArgument x:TypeArguments="x:Int32" /> </ui:CursorPosition.OffsetX> <ui:CursorPosition.OffsetY> <InArgument x:TypeArguments="x:Int32" /> </ui:CursorPosition.OffsetY> </ui:CursorPosition> </ui:Click.CursorPosition> <ui:Click.Target> <ui:Target ClippingRegion="{x:Null}" Element="{x:Null}" TimeoutMS="{x:Null}" InformativeScreenshot="a52efda054f51d9ac88fd53b22f4663a" Selector="&lt;ctrl name='Leave site?' role='dialog' /&gt;&lt;ctrl name='Leave' role='push button' /&gt;" WaitForReady="INTERACTIVE" /> </ui:Click.Target> </ui:Click> </Sequence> </ActivityAction> </ui:OpenBrowser.Body> <sads:DebugSymbol.Symbol>dyhFOlxVaVBhdGhXb3Jrc3BhY2VcV2hhdHNhcHBNc2dcTWFpbi54YW1sBzoDYxQCAQE6vQE6iQICAQdACV8UAgECQQtPFgIBBVALXhYCAQNNngFN5AECAQZcngFc/QECAQQ=</sads:DebugSymbol.Symbol> </ui:OpenBrowser> <sap2010:WorkflowViewState.ViewStateManager> <sap2010:ViewStateManager> <sap2010:ViewStateData Id="Click_6" sap:VirtualizedContainerService.HintSize="314,106" /> <sap2010:ViewStateData Id="Click_5" sap:VirtualizedContainerService.HintSize="314,106" /> <sap2010:ViewStateData Id="Sequence_25" sap:VirtualizedContainerService.HintSize="336,376"> <sap:WorkflowViewStateService.ViewState> <scg:Dictionary x:TypeArguments="x:String, x:Object"> <x:Boolean x:Key="IsExpanded">True</x:Boolean> </scg:Dictionary> </sap:WorkflowViewStateService.ViewState> </sap2010:ViewStateData> <sap2010:ViewStateData Id="OpenBrowser_3" sap:VirtualizedContainerService.HintSize="414,475" /> <sap2010:ViewStateData Id="Main_1" sap:VirtualizedContainerService.HintSize="454,635" /> </sap2010:ViewStateManager> </sap2010:WorkflowViewState.ViewStateManager> </Activity>

1 Answer

0 votes
by (9.5k points)

Which not working with script alerts

Please find the solved workflow here.

Related questions

0 votes
1 answer
0 votes
1 answer
asked Jul 13, 2019 in RPA by Abhishek_31 (12.7k points)
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...