I am writing the appium automation for android application, It does not have proper xpath, class name or ID.
Even in Image, you can clearly check that when I click on get started. It clicks whole frame. I have attached XML as well.
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
<hierarchy index="0" class="hierarchy" rotation="0" width="1080" height="2040">
<android.widget.FrameLayout index="0" package="com.novo.android.dev" class="android.widget.FrameLayout" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,2040]" displayed="true">
<android.widget.LinearLayout index="0" package="com.novo.android.dev" class="android.widget.LinearLayout" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,0][1080,2040]" displayed="true">
<android.widget.FrameLayout index="0" package="com.novo.android.dev" class="android.widget.FrameLayout" text="" resource-id="android:id/content" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,60][1080,2040]" displayed="true">
<android.widget.FrameLayout index="0" package="com.novo.android.dev" class="android.widget.FrameLayout" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,60][1080,2040]" displayed="true">
<android.webkit.WebView index="0" package="com.novo.android.dev" class="android.webkit.WebView" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,60][1080,2040]" displayed="true">
<android.webkit.WebView index="0" package="com.novo.android.dev" class="android.webkit.WebView" text="Plaid - Securely Connect" checkable="false" checked="false" clickable="false" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,60][1080,2040]" displayed="true">
<android.view.View index="0" package="com.novo.android.dev" class="android.view.View" text="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[0,60][1080,2040]" displayed="true" />
</android.webkit.WebView>
</android.webkit.WebView>
<android.widget.ProgressBar index="1" package="com.novo.android.dev" class="android.widget.ProgressBar" text="" resource-id="com.novo.android.dev:id/root_progress_bar" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[480,990][600,1110]" displayed="true" />
</android.widget.FrameLayout>
</android.widget.FrameLayout>
</android.widget.LinearLayout>
</android.widget.FrameLayout>
</hierarchy>
The button you are about to click is inside android.webkit.WebView. In other words, the app under test is an Android hybrid app.
To identify WebView elements, you should switch into the WebView first.
Java code for automating hybrid apps:
Set<String> contextNames = driver.getContextHandles();
for (String contextName : contextNames) {
System.out.println(contextName); //prints out something like NATIVE_APP, WEBVIEW_1
}
// Switching to webview
driver.context(contextNames.toArray()[1]); // set context to WEBVIEW_1
// do some web testing
String myText = driver.findElement(By.cssSelector(".green_button")).click();
// Switching back to NATIVE_APP
driver.context("NATIVE_APP");
// do more native testing if we want
driver.findElement(By.name("hello")).click();
driver.quit();
For more details, visit offical docs https://appium.io/docs/en/writing-running-appium/web/hybrid/
It looks like a hybrid app .You have to switch to web view context on execution.
For finding elements After launching the app you have to inspect using remote debugging.
https://developers.google.com/web/tools/chrome-devtools/remote-debugging
The xpath is:
'hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.webkit.WebView/android.webkit.WebView/android.view.View'
which could be simplified to 'hierarchy//android.view.View'
but the error message is telling you not to use an xPath
Related
This is the website I am looking at.
In this website there is a list of companies where I can click into them:
Click the name of the company
Click the "Annual Report" button
Click the "Annual Report & CG Report - 2018" link
There are 788 companies in this list and I wish to repeat this process for the whole list.
Is this possible?
Currently I used Data Scraping -> Attach Browser url -> Extract Structured Data. After that I am stuck.
For me that sounds pretty simple:
go to overview
download the list via data scraping
for each on that list and surf to each of those urls
on the url do the things you said, like clicking the Annual Report and then Annual Report & CG Report - 2018
So the usual structure of a UiPath process is this one:
This is the Main.xaml visual overview that works on your example:
And this is the Main.xaml code:
<Activity mc:Ignorable="sap sap2010" x:Class="Main" mva:VisualBasic.Settings="{x:Null}" sap:VirtualizedContainerService.HintSize="530,1075" sap2010:WorkflowViewState.IdRef="ActivityBuilder_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: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:sd="clr-namespace:System.Data;assembly=System.Data" xmlns:ui="http://schemas.uipath.com/workflow/activities" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<TextExpression.NamespacesForImplementation>
<scg:List x:TypeArguments="x:String" Capacity="22">
<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>
<x:String>UiPath.CV</x:String>
</scg:List>
</TextExpression.NamespacesForImplementation>
<TextExpression.ReferencesForImplementation>
<scg:List x:TypeArguments="AssemblyReference" Capacity="18">
<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>PresentationFramework</AssemblyReference>
<AssemblyReference>WindowsBase</AssemblyReference>
<AssemblyReference>PresentationCore</AssemblyReference>
<AssemblyReference>System.Xaml</AssemblyReference>
<AssemblyReference>UiPath.System.Activities</AssemblyReference>
<AssemblyReference>UiPath.UiAutomation.Activities</AssemblyReference>
<AssemblyReference>UiPath.CV</AssemblyReference>
<AssemblyReference>System.ValueTuple</AssemblyReference>
<AssemblyReference>System.Data.DataSetExtensions</AssemblyReference>
</scg:List>
</TextExpression.ReferencesForImplementation>
<Sequence sap:VirtualizedContainerService.HintSize="510,975" sap2010:WorkflowViewState.IdRef="Sequence_3">
<Sequence.Variables>
<Variable x:TypeArguments="sd:DataTable" Default="[New System.Data.DataTable]" Name="ExtractDataTable" />
<Variable x:TypeArguments="ui:Browser" Name="Browser" />
</Sequence.Variables>
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<ui:OpenBrowser CommunicationMethod="{x:Null}" Hidden="{x:Null}" NewSession="{x:Null}" Private="{x:Null}" BrowserType="Firefox" DisplayName="Open Browser" sap:VirtualizedContainerService.HintSize="468,351" sap2010:WorkflowViewState.IdRef="OpenBrowser_1" UiBrowser="[Browser]" Url="https://www.bursamalaysia.com/trade/trading_resources/listing_directory/main_market">
<ui:OpenBrowser.Body>
<ActivityAction x:TypeArguments="x:Object">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="x:Object" Name="ContextTarget" />
</ActivityAction.Argument>
<ui:BrowserScope Browser="{x:Null}" SearchScope="{x:Null}" TimeoutMS="{x:Null}" UiBrowser="{x:Null}" BrowserType="Firefox" DisplayName="Attach Browser" sap:VirtualizedContainerService.HintSize="434,252" sap2010:WorkflowViewState.IdRef="BrowserScope_2" InformativeScreenshot="49520eaf054f3a2d88e58aa9f0f1cdb7" Selector="<html app='firefox.exe' title='Main Market' />">
<ui:BrowserScope.Body>
<ActivityAction x:TypeArguments="x:Object">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="x:Object" Name="ContextTarget" />
</ActivityAction.Argument>
<ui:ExtractData DelayBetweenPagesMS="{x:Null}" ContinueOnError="True" DataTable="[ExtractDataTable]" DisplayName="Extract Structured Data" ExtractMetadata="<extract><column exact='1' name='Name' attr='text' name2='URL' attr2='href'><webctrl tag='tr'/><webctrl tag='td' class=' text-left position-relative'/><webctrl tag='a' class='company-announcement-link' idx='1'/></column></extract>" sap:VirtualizedContainerService.HintSize="334,106" sap2010:WorkflowViewState.IdRef="ExtractData_2" MaxNumberOfResults="100" NextLinkSelector="<webctrl parentid='DataTables_Table_0_next' tag='A' />" SimulateClick="True">
<ui:ExtractData.Target>
<ui:Target ClippingRegion="{x:Null}" Element="{x:Null}" InformativeScreenshot="c9106f042e4e67a92a010ed284896366" Selector="<webctrl parentid='DataTables_Table_0' tag='TBODY' />" WaitForReady="COMPLETE">
<ui:Target.TimeoutMS>
<InArgument x:TypeArguments="x:Int32" />
</ui:Target.TimeoutMS>
</ui:Target>
</ui:ExtractData.Target>
</ui:ExtractData>
</ActivityAction>
</ui:BrowserScope.Body>
</ui:BrowserScope>
</ActivityAction>
</ui:OpenBrowser.Body>
</ui:OpenBrowser>
<ui:ForEachRow CurrentIndex="{x:Null}" DataTable="[ExtractDataTable]" DisplayName="For Each Row" sap:VirtualizedContainerService.HintSize="468,492" sap2010:WorkflowViewState.IdRef="ForEachRow_1">
<ui:ForEachRow.Body>
<ActivityAction x:TypeArguments="sd:DataRow">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="sd:DataRow" Name="row" />
</ActivityAction.Argument>
<Sequence DisplayName="Body" sap:VirtualizedContainerService.HintSize="376,344" sap2010:WorkflowViewState.IdRef="Sequence_7">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<ui:NavigateTo Browser="[Browser]" DisplayName="Navigate To" sap:VirtualizedContainerService.HintSize="334,59" sap2010:WorkflowViewState.IdRef="NavigateTo_1" Url="["https://www.bursamalaysia.com" + row("Url").ToString]" />
<Delay Duration="00:00:05" sap:VirtualizedContainerService.HintSize="334,22" sap2010:WorkflowViewState.IdRef="Delay_1" />
<ui:LogMessage DisplayName="Log Message" sap:VirtualizedContainerService.HintSize="334,91" sap2010:WorkflowViewState.IdRef="LogMessage_3" Level="Info" Message="["Here you do all the stuff like Click Annual Report..."]" />
</Sequence>
</ActivityAction>
</ui:ForEachRow.Body>
</ui:ForEachRow>
</Sequence>
</Activity>
I am facing issue with onbeforeunload window event popup in chrome. I have installed chrome extension.
Steps:
Create Open Browser activity with url:
https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onbeforeunload"\
Create Click Event with selector:
<webctrl aaname='Click here to go to w3schools.com' tag='A' />
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="<webctrl aaname='Click here to go to w3schools.com' tag='A' />" 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="<ctrl name='Leave site?' role='dialog' /><ctrl name='Leave' role='push button' />" 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>
Which not working with script alerts.
Please find the solved workflow here. It's a tricky way to solve your problem.
I want to import a ".webtest" in Azure's Application Insights availability feature. I dont have a test edition of Visual Studio, but this MSDN article suggests using Fiddler as another option to creating web tests.
I need to perform 2 requests on a REST API:
Request a bearer token from the connect/token endpoint.
Perform a GET at api/resources with the bearer token (retrieved from the above request) in the header.
It's a typical client credentials OAuth 2 flow.
I cannot seem to figure out how to do this with Fiddler. Basically I need to extract a value from the response body of request 1 and use it as the header value in request 2.
This is what the web test looks like without passing the token:
<?xml version="1.0" encoding="utf-8"?>
<TestCase Name="FiddlerGeneratedWebTest" Id="" Owner="" Description="" Priority="0" Enabled="True" CssProjectStructure="" CssIteration="" DeploymentItemsEditable="" CredentialUserName="" CredentialPassword="" PreAuthenticate="True" Proxy="" RequestCallbackClass="" TestCaseCallbackClass="">
<Items>
<Request Method="POST" Version="1.1" Url="https://example.com/connect/token" ThinkTime="8" Timeout="60" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8">
<Headers>
<Header Name="Content-Type" Value="application/x-www-form-urlencoded" />
</Headers>
<FormPostHttpBody ContentType="application/x-www-form-urlencoded">
<FormPostParameter Name="client_id" Value="myclientid" UrlEncode="True" />
<FormPostParameter Name="client_secret" Value="password123" UrlEncode="True" />
<FormPostParameter Name="grant_type" Value="client_credentials" UrlEncode="True" />
<FormPostParameter Name="scope" Value="myscopes" UrlEncode="True" />
</FormPostHttpBody>
</Request>
<Request Method="GET" Version="1.1" Url="https://example.com/api/resources" ThinkTime="0" Timeout="60" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8">
<Headers>
<Header Name="Authorization" Value="Bearer {{token}}" />
</Headers>
</Request>
</Items>
</TestCase>
Assuming this comes back as the following example you can use a regex extraction to get it.
{"token_type":"Bearer","scope":"user_impersonation","expires_in":"3600 ... "access_token":"{{TOKEN}}", ...}
<?xml version="1.0" encoding="utf-8"?>
<TestCase Name="FiddlerGeneratedWebTest" Id="" Owner="" Description="" Priority="0" Enabled="True" CssProjectStructure="" CssIteration="" DeploymentItemsEditable="" CredentialUserName="" CredentialPassword="" PreAuthenticate="True" Proxy="" RequestCallbackClass="" TestCaseCallbackClass="">
<Items>
<Request Method="POST" Version="1.1" Url="https://example.com/connect/token" ThinkTime="8" Timeout="60" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8">
<ExtractionRules>
<ExtractionRule Classname="Microsoft.VisualStudio.TestTools.WebTesting.Rules.ExtractRegularExpression, Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" VariableName="token" DisplayName="Extract Regular Expression" Description="Extract text from the response matching a regular expression and place it into the test context.">
<RuleParameters>
<RuleParameter Name="RegularExpression" Value=".*"access_token":"([^"]*)".*" />
<RuleParameter Name="IgnoreCase" Value="True" />
<RuleParameter Name="Required" Value="True" />
<RuleParameter Name="Index" Value="0" />
<RuleParameter Name="HtmlDecode" Value="True" />
<RuleParameter Name="UseGroups" Value="True" />
</RuleParameters>
</ExtractionRule>
</ExtractionRules>
<Headers>
<Header Name="Content-Type" Value="application/x-www-form-urlencoded" />
</Headers>
<FormPostHttpBody ContentType="application/x-www-form-urlencoded">
<FormPostParameter Name="client_id" Value="myclientid" UrlEncode="True" />
<FormPostParameter Name="client_secret" Value="password123" UrlEncode="True" />
<FormPostParameter Name="grant_type" Value="client_credentials" UrlEncode="True" />
<FormPostParameter Name="scope" Value="myscopes" UrlEncode="True" />
</FormPostHttpBody>
</Request>
<Request Method="GET" Version="1.1" Url="https://example.com/api/resources" ThinkTime="0" Timeout="60" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8">
<Headers>
<Header Name="Authorization" Value="Bearer {{token}}" />
</Headers>
</Request>
</Items>
</TestCase>
To compliment James Davis's answer, if you need to login to https://yourapp.com/auth/login by posting the JSON:
{
user: 'youruser',
password: 'yourpassword'
}
first base64 encode the json:
> echo "{user: 'youruser', password: 'yourpassword'}" | base64
e3VzZXI6ICd5b3VydXNlcicsIHBhc3N3b3JkOiAneW91cnBhc3N3b3JkJ30K
Then pass this base64 value in a StringHttpBody tag
<?xml version="1.0" encoding="utf-8"?>
<WebTest Name="login-healthcheck" Id="e91b6e1d-3fa0-475f-a18b-b694b463589c" Owner="" Priority="0" Enabled="True" CssProjectStructure="" CssIteration="" Timeout="0" WorkItemIds="" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010" Description="" CredentialUserName="" CredentialPassword="" PreAuthenticate="True" Proxy="default" StopOnError="False" RecordedResultFile="" ResultsLocale="">
<Items>
<Request Method="POST" Guid="ef9d1d00-5663-476a-a3cb-ccf49c4d2229" Version="1.1" Url="https://yourapp.com/auth/login" ThinkTime="8" Timeout="60" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False">
<Headers>
<Header Name="Content-Type" Value="application/json" />
</Headers>
<ExtractionRules>
<ExtractionRule Classname="Microsoft.VisualStudio.TestTools.WebTesting.Rules.ExtractRegularExpression, Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" VariableName="token" DisplayName="Extract Regular Expression" Description="Extract text from the response matching a regular expression and place it into the test context.">
<RuleParameters>
<RuleParameter Name="RegularExpression" Value=".*"access_token":"([^"]*)".*" />
<RuleParameter Name="IgnoreCase" Value="True" />
<RuleParameter Name="Required" Value="True" />
<RuleParameter Name="Index" Value="0" />
<RuleParameter Name="HtmlDecode" Value="True" />
<RuleParameter Name="UseGroups" Value="True" />
</RuleParameters>
</ExtractionRule>
</ExtractionRules>
<StringHttpBody ContentType="application/json" InsertByteOrderMark="False">e3VzZXI6ICd5b3VydXNlcicsIHBhc3N3b3JkOiAneW91cnBhc3N3b3JkJ30K</StringHttpBody>
</Request>
<Request Method="GET" Guid="d566422f-af74-47bf-90aa-0c66db6ef567" Version="1.1" Url="https://yourapp.com/api/v1/healthcheck" ThinkTime="0" Timeout="60" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False">
<Headers>
<Header Name="Authorization" Value="Bearer {{token}}" />
</Headers>
</Request>
</Items>
</WebTest>
Worked for me on Azure Application Insights Availability checking
I Have a (simple) wix project. In the project, I have a property which gets it's value from the registry (if such registry key exists).
On a dialog, the user sees the value of that property and then can change it.
For some reason, I cannot see that the property gets the value from the registry...
Will appreciate your help:
from the wix project:
<!-- The Registry group of the installation package. -->
<ComponentGroup Id="RegistryGroup">
<Component Id="_70B15100_F11D_48BF_8349_3E3B83157C54" Guid="2F344400-5C37-4CAE-902E-7100FDD2DB22" Transitive="no" Directory="TARGETDIR">
<RegistryKey Root="HKLM" Key="Software\[Manufacturer]\YYY" ForceCreateOnInstall="no" ForceDeleteOnUninstall="no">
<RegistryValue Type="string" Name="ServerPort" Value="[SERVERPORT]" />
<RegistryValue Type="string" Name="ServerAddress" Value="[SERVERADDRESS]" />
</RegistryKey>
</Component>
</ComponentGroup>
<!-- The composite feature of the installation package. -->
<Feature Id="CompleteInstall" Title="All Files" Level="1">
<ComponentGroupRef Id="FileSystemGroup" />
<ComponentGroupRef Id="RegistryGroup" />
</Feature>
<Upgrade Id="{D627BB25-59CB-4387-AF42-0127AC701DBE}">
<UpgradeVersion Minimum="3.11.7" Property="NEWPRODUCTFOUND" OnlyDetect="yes" IncludeMinimum="no" Language="1033" />
<UpgradeVersion Maximum="3.11.7" Property="OLDPRODUCTFOUND" OnlyDetect="no" IncludeMinimum="yes" IncludeMaximum="no" Language="1033" />
</Upgrade>
<InstallExecuteSequence>
<Custom Action="CA_CreateConfig" Sequence="1" />
<Custom Action="DIRCA_TARGETDIR" Before="CostInitialize"><![CDATA[TARGETDIR = ""]]></Custom>
<Custom Action="PreventDowngrading" After="FindRelatedProducts"><![CDATA[NEWPRODUCTFOUND]]></Custom>
<Custom Action="_C976A2F6_5EC5_4EE5_898C_4A660FC42C9F.Commit.SetProperty" After="StartServices"><![CDATA[(NOT DISABLESERVICE) AND $com_DCAB0809_69B4_442E_82E5_E600A7E1E769>2]]></Custom>
<Custom Action="_C976A2F6_5EC5_4EE5_898C_4A660FC42C9F.Commit" After="_C976A2F6_5EC5_4EE5_898C_4A660FC42C9F.Commit.SetProperty"><![CDATA[(NOT DISABLESERVICE) AND $com_DCAB0809_69B4_442E_82E5_E600A7E1E769>2]]></Custom>
<Custom Action="_458FD9FC_2B2B_45E5_B89F_E5C67FA1AB86.Install.SetProperty" After="_C976A2F6_5EC5_4EE5_898C_4A660FC42C9F.Commit"><![CDATA[(NOT DISABLESERVICE) AND $com_DCAB0809_69B4_442E_82E5_E600A7E1E769>2]]></Custom>
<Custom Action="_458FD9FC_2B2B_45E5_B89F_E5C67FA1AB86.Install" After="_458FD9FC_2B2B_45E5_B89F_E5C67FA1AB86.Install.SetProperty"><![CDATA[(NOT DISABLESERVICE) AND $com_DCAB0809_69B4_442E_82E5_E600A7E1E769>2]]></Custom>
<Custom Action="_854AE351_70ED_4318_82B0_B079EDD6C3CD.Rollback.SetProperty" After="_458FD9FC_2B2B_45E5_B89F_E5C67FA1AB86.Install"><![CDATA[(NOT DISABLESERVICE) AND $com_DCAB0809_69B4_442E_82E5_E600A7E1E769>2]]></Custom>
<Custom Action="_854AE351_70ED_4318_82B0_B079EDD6C3CD.Rollback" After="_854AE351_70ED_4318_82B0_B079EDD6C3CD.Rollback.SetProperty"><![CDATA[(NOT DISABLESERVICE) AND $com_DCAB0809_69B4_442E_82E5_E600A7E1E769>2]]></Custom>
<Custom Action="_BEF9A9A6_06F8_43FA_85B9_F40521FCC587.Uninstall.SetProperty" After="MsiUnpublishAssemblies"><![CDATA[(NOT DISABLESERVICE) AND $com_DCAB0809_69B4_442E_82E5_E600A7E1E769=2]]></Custom>
<Custom Action="_BEF9A9A6_06F8_43FA_85B9_F40521FCC587.Uninstall" After="_BEF9A9A6_06F8_43FA_85B9_F40521FCC587.Uninstall.SetProperty"><![CDATA[(NOT DISABLESERVICE) AND $com_DCAB0809_69B4_442E_82E5_E600A7E1E769=2]]></Custom>
<RemoveExistingProducts Before="InstallInitialize" />
<Custom Action="CustomTextA_SetProperty_EDIT1" Sequence="701" />
<Custom Action="CustomTextA_SetProperty_EDIT2" Sequence="702" />
<Custom Action="CustomTextA_SetProperty_EDIT3" Sequence="703" />
<Custom Action="CustomTextA_SetProperty_EDIT4" Sequence="704" />
</InstallExecuteSequence>
<InstallUISequence>
<Custom Action="ERRCA_UIANDADVERTISED" Sequence="5"><![CDATA[ProductState=1]]></Custom>
<AppSearch Sequence="100" />
<FindRelatedProducts Sequence="200" />
<LaunchConditions Sequence="400"><![CDATA[NOT Installed]]></LaunchConditions>
<CCPSearch Sequence="500"><![CDATA[NOT Installed]]></CCPSearch>
<RMCCPSearch Sequence="600"><![CDATA[NOT Installed]]></RMCCPSearch>
<ValidateProductID Sequence="700" />
<Custom Action="DIRCA_TARGETDIR" Before="CostInitialize"><![CDATA[TARGETDIR = ""]]></Custom>
<Custom Action="PreventDowngrading" After="FindRelatedProducts"><![CDATA[NEWPRODUCTFOUND]]></Custom>
<CostInitialize Sequence="800" />
<FileCost Sequence="900" />
<IsolateComponents Sequence="950"><![CDATA[RedirectedDllSupport]]></IsolateComponents>
<CostFinalize Sequence="1000" />
<ExecuteAction Sequence="1300" />
<Custom Action="CustomTextA_SetProperty_EDIT1" Sequence="701" />
<Custom Action="CustomTextA_SetProperty_EDIT2" Sequence="702" />
<Custom Action="CustomTextA_SetProperty_EDIT3" Sequence="703" />
<Custom Action="CustomTextA_SetProperty_EDIT4" Sequence="704" />
<Show Dialog="CustomTextA" Sequence="1001"><![CDATA[Installed="" AND NOT RESUME]]></Show>
<Show Dialog="ProgressForm" Sequence="1299" />
<Show Dialog="FatalErrorForm" OnExit="error"><![CDATA[NOT HideFatalErrorForm]]></Show>
<Show Dialog="UserExitForm" OnExit="cancel" />
<Show Dialog="FinishedForm" OnExit="success" />
<Custom Action="VSDCA_FolderForm_AllUsers" Sequence="997"><![CDATA[Installed="" AND NOT RESUME AND ALLUSERS=1]]></Custom>
<Show Dialog="ResumeForm" Sequence="998"><![CDATA[Installed="" AND RESUME]]></Show>
<Show Dialog="MaintenanceForm" Sequence="999"><![CDATA[Installed<>""]]></Show>
</InstallUISequence>
<AdminUISequence>
<Custom Action="DIRCA_TARGETDIR" Before="CostInitialize"><![CDATA[TARGETDIR = ""]]></Custom>
<CostInitialize Sequence="800" />
<FileCost Sequence="900" />
<CostFinalize Sequence="1000" />
<ExecuteAction Sequence="1300" />
<Show Dialog="AdminWelcomeForm" Sequence="1001"><![CDATA[Installed="" AND NOT RESUME]]></Show>
<Show Dialog="AdminProgressForm" Sequence="1299" />
<Show Dialog="AdminFatalErrorForm" OnExit="error" />
<Show Dialog="AdminUserExitForm" OnExit="cancel" />
<Show Dialog="AdminFinishedForm" OnExit="success" />
<Show Dialog="AdminResumeForm" Sequence="998"><![CDATA[Installed="" AND RESUME]]></Show>
<Show Dialog="AdminMaintenanceForm" Sequence="999"><![CDATA[Installed<>""]]></Show>
</AdminUISequence>
<UI Id="Base">
<Error Id="1001">Error [1]. [2]</Error>
<Property Id="VSDNETURLMSG" Value="This setup requires the .NET Framework version [1]. Please install the .NET Framework and run this setup again. The .NET Framework can be obtained from the web. Would you like to do this now?" />
<Property Id="VSDIISMSG" Value="This setup requires Internet Information Server 5.1 or higher and Windows XP or higher. This setup cannot be installed on Windows 2000. Please install Internet Information Server or a newer operating system and run this setup again." />
<Property Id="VSDUIANDADVERTISED" Value="This advertised application will not be installed because it might be unsafe. Contact your administrator to change the installation user interface option of the package to basic." />
<Property Id="VSDNETMSG" Value="This setup requires the .NET Framework version [1]. Please install the .NET Framework and run this setup again." />
<Property Id="VSDINVALIDURLMSG" Value="The specified path '[2]' is unavailable. The Internet Information Server might not be running or the path exists and is redirected to another machine. Please check the status of this virtual directory in the Internet Services Manager." />
<Property Id="VSDVERSIONMSG" Value="Unable to install because a newer version of this product is already installed." />
</UI>
<CustomAction Id="CustomTextA_SetProperty_EDIT1" Property="SERVERADDRESS" Value="[SERVERADDRESS]" Execute="firstSequence" />
<CustomAction Id="CustomTextA_SetProperty_EDIT2" Property="SERVERPORT" Value="[SERVERPORT]" Execute="firstSequence" />
<CustomAction Id="CustomTextA_SetProperty_EDIT3" Property="EDITA3" Value="" Execute="firstSequence" />
<CustomAction Id="CustomTextA_SetProperty_EDIT4" Property="EDITA4" Value="" Execute="firstSequence" />
<CustomAction Id="VSDCA_FolderForm_AllUsers" Property="FolderForm_AllUsers" Value="ALL" />
<CustomAction Id="ERRCA_UIANDADVERTISED" Error="[VSDUIANDADVERTISED]" />
<Property Id="CustomTextA_NextArgs" Value="EulaForm" />
<Property Id="EulaForm_PrevArgs" Value="CustomTextA" />
<Property Id="EulaForm_NextArgs" Value="WelcomeForm" />
<Property Id="WelcomeForm_PrevArgs" Value="EulaForm" />
<Property Id="WelcomeForm_NextArgs" Value="ConfirmInstallForm" />
<Property Id="ConfirmInstallForm_PrevArgs" Value="WelcomeForm" />
<UI Id="CustomText1Dlg">
<Dialog Id="CustomTextA" X="50" Y="50" Width="373" Height="287" Title="[ProductName]">
<Control Id="NextButton" Type="PushButton" X="300" Y="261" Width="66" Height="18" Text="{\VSI_MS_Sans_Serif13.0_0_0}&Next >" TabSkip="no" Default="yes">
<Publish Event="EndDialog" Value="Return"><![CDATA[CustomTextA_NextArgs=""]]></Publish>
<Publish Event="NewDialog" Value="[CustomTextA_NextArgs]"><![CDATA[CustomTextA_NextArgs<>""]]></Publish>
</Control>
<Control Id="Label1" Type="Text" X="18" Y="108" Width="348" Height="12" Text="{\VSI_MS_Sans_Serif13.0_0_0}Server Address (leave empty for default)" TabSkip="no" />
<Control Id="Edit1" Type="Edit" X="18" Y="120" Width="348" Height="18" Text="{\VSI_MS_Sans_Serif13.0_0_0}" TabSkip="no" Property="SERVERADDRESS" Sunken="yes" />
<Control Id="Label2" Type="Text" X="18" Y="144" Width="348" Height="12" Text="{\VSI_MS_Sans_Serif13.0_0_0}Server Port (leave empty for default)" TabSkip="no" />
<Control Id="Edit2" Type="Edit" X="18" Y="156" Width="348" Height="18" Text="{\VSI_MS_Sans_Serif13.0_0_0}" TabSkip="no" Property="SERVERPORT" Sunken="yes" />
<Control Id="Label3" Type="Text" X="18" Y="180" Width="348" Height="12" Text="{\VSI_MS_Sans_Serif13.0_0_0}Edit3:" Hidden="yes" TabSkip="no" />
<Control Id="Edit3" Type="Edit" X="18" Y="192" Width="348" Height="18" Text="{\VSI_MS_Sans_Serif13.0_0_0}" TabSkip="no" Property="EDITA3" Hidden="yes" Sunken="yes" />
<Control Id="Label4" Type="Text" X="18" Y="216" Width="348" Height="12" Text="{\VSI_MS_Sans_Serif13.0_0_0}Edit4:" Hidden="yes" TabSkip="no" />
<Control Id="Edit4" Type="Edit" X="18" Y="228" Width="348" Height="18" Text="{\VSI_MS_Sans_Serif13.0_0_0}" TabSkip="no" Property="EDITA4" Hidden="yes" Sunken="yes" />
<Control Id="CancelButton" Type="PushButton" X="156" Y="261" Width="66" Height="18" Text="{\VSI_MS_Sans_Serif13.0_0_0}Cancel" TabSkip="no" Cancel="yes">
<Publish Event="SpawnDialog" Value="Cancel" />
</Control>
<Control Id="PreviousButton" Type="PushButton" X="228" Y="261" Width="66" Height="18" Text="{\VSI_MS_Sans_Serif13.0_0_0}< &Back" TabSkip="no">
<Condition Action="disable"><![CDATA[CustomTextA_PrevArgs=""]]></Condition>
<Condition Action="enable"><![CDATA[CustomTextA_PrevArgs<>""]]></Condition>
<Publish Event="NewDialog" Value="[CustomTextA_PrevArgs]"><![CDATA[CustomTextA_PrevArgs<>""]]></Publish>
</Control>
<Control Id="BannerBmp" Type="Bitmap" X="0" Y="0" Width="375" Height="52" Text="_bbb3a8b4c218495cb88ea30ee85d4499" TabSkip="no" Disabled="yes" />
<Control Id="BodyText" Type="Text" X="9" Y="63" Width="354" Height="42" Text="{\VSI_MS_Sans_Serif13.0_0_0}The installed agent will use the following connection properties." TabSkip="yes" NoPrefix="yes" />
<Control Id="BannerText" Type="Text" X="9" Y="9" Width="306" Height="33" Text="{\VSI_MS_Sans_Serif16.0_1_0}Specify Connection Details" TabSkip="yes" Transparent="yes" NoPrefix="yes" />
<Control Id="Control273" Type="Line" X="0" Y="252" Width="375" Height="6" Text="{\VSI_MS_Sans_Serif13.0_0_0}MsiHorizontalLine" TabSkip="yes" Disabled="yes" />
<Control Id="Control278" Type="Line" X="0" Y="52" Width="375" Height="6" Text="{\VSI_MS_Sans_Serif16.0_1_0}MsiHorizontalLine" TabSkip="yes" Disabled="yes" />
</Dialog>
</UI>
You say that you are getting the value of the property from the registry, but that requires a RegistrySearch element and there doesn't seem to be one in your WiX source.
My problem was that I used a tool that automatically converted my vdproj to a wix project. This conversion was not perfect and it created a custom action and a set property that I did not need. Once these were deleted, everything worked perfectly.
The opportunity form as a quotes sub-grid. I am trying to hide the existing "New" button and create a custom one. Hiding the existing button works like a charm. However, nothing I do seems to make the custom button appear.
I have tried making the enable and visibility conditions as simple as just checking that the form is for an existing entity. Nothing seems to work.
Here's the XML for the quote. Generated using Ribbon Workbench:
<RibbonDiffXml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CustomActions>
<CustomAction Id="ntcp.quote.Button1.Button.CustomAction" Location="Mscrm.SubGrid.quote.MainTab.Management.Controls._children" Sequence="17">
<CommandUIDefinition>
<Button Alt="$LocLabels:ntcp.quote.Button1.Button.Alt" Command="ntcp.quote.Command0.Command" Description="" Id="ntcp.quote.Button1.Button" Image32by32="/_imgs/ribbon/newrecord32.png" Image16by16="/_imgs/ribbon/New_16.png" LabelText="$LocLabels:ntcp.quote.Button1.Button.LabelText" Sequence="17" TemplateAlias="o1" ToolTipTitle="$LocLabels:ntcp.quote.Button1.Button.ToolTipTitle" ToolTipDescription="$LocLabels:ntcp.quote.Button1.Button.ToolTipDescription" ModernImage="New" />
</CommandUIDefinition>
</CustomAction>
<HideCustomAction HideActionId="ntcp.Mscrm.SubGrid.quote.AddNewStandard.Hide" Location="Mscrm.SubGrid.quote.AddNewStandard" />
</CustomActions>
<Templates>
<RibbonTemplates Id="Mscrm.Templates" />
</Templates>
<CommandDefinitions>
<CommandDefinition Id="ntcp.quote.Command0.Command">
<EnableRules>
<EnableRule Id="ntcp.quote.EnableRule0.EnableRule" />
</EnableRules>
<DisplayRules>
<DisplayRule Id="ntcp.quote.DisplayRule0.DisplayRule" />
</DisplayRules>
<Actions>
<JavaScriptFunction FunctionName="ntcp_QuoteFromOpportunity" Library="$webresource:ntcp_/quoteFromOpportunity.js" />
</Actions>
</CommandDefinition>
</CommandDefinitions>
<RuleDefinitions>
<TabDisplayRules />
<DisplayRules>
<DisplayRule Id="ntcp.quote.DisplayRule0.DisplayRule">
<FormStateRule State="Existing" Default="true" />
</DisplayRule>
</DisplayRules>
<EnableRules>
<EnableRule Id="ntcp.quote.EnableRule0.EnableRule">
<FormStateRule State="Existing" Default="true" />
</EnableRule>
</EnableRules>
</RuleDefinitions>
<LocLabels>
<LocLabel Id="ntcp.quote.Button1.Button.LabelText">
<Titles>
<Title description="Add New Quote" languagecode="1033" />
</Titles>
</LocLabel>
<LocLabel Id="ntcp.quote.Button1.Button.ToolTipTitle">
<Titles>
<Title description="Add New Quote" languagecode="1033" />
</Titles>
</LocLabel>
<LocLabel Id="ntcp.quote.Button1.Button.ToolTipDescription">
<Titles>
<Title description="Add New Quote" languagecode="1033" />
</Titles>
</LocLabel>
<LocLabel Id="ntcp.quote.Button1.Button.Alt">
<Titles>
<Title description="Add New Quote" languagecode="1033" />
</Titles>
</LocLabel>
</LocLabels>
</RibbonDiffXml>
Any ideas?
Is this CRM2011 or CRM2013? If it is CRM2013 you can't add a new button on the Form Subgrids - only on the full related subgrid view.
Buttons are visible by default, so you don't need any special Display/Enable rules.
Hope this helps,
Scott