Problem Using HatTestHarness in Web Application

Oct 27, 2011 at 6:32 PM

Hello!

When i´m trying to test if HatTestHarness a HTML page give the error:

DataDrivenAdapterException (op=ExecuteControlAction,controlName=btnBusca): Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

the AnchorElement named "btnBusca" has a javascript da execute an asp.net postback.

Anyone can help ?Regards!

Here the XML:

<?xml version="1.0" encoding="utf-16"?>
<initstring>
  <optimumSize x="0" y="0" />
  <minimumSize x="0" y="0" />
  <global />
  <displayGroup>
  </displayGroup>
  <adapter>
    <URL>Microsoft.Uii.HostedApplicationToolkit.AutomationHosting</URL>
    <type>Microsoft.Uii.HostedApplicationToolkit.AutomationHosting.AutomationAdapter</type>
  </adapter>
  <homePage useNewProcess="False">https://contoso.com.br/contfacil</homePage>
  <hostOnTop />
  <toolbar />
  <DataDrivenAdapterBindingsCollection>
    <DataDrivenAdapterBindings>
      <Type>Microsoft.Uii.HostedApplicationToolkit.DataDrivenAdapter.WebDataDrivenAdapter, Microsoft.Uii.HostedApplicationToolkit.DataDrivenAdapter</Type>
      <Controls>
        <AnchorElement name="btnBusca" type="HtmlElement">
          <ElementMatchPath>/HTML/BODY/FORM/DIV[1]/DIV[2]/DIV/IFRAME/HTML/BODY/FORM/TABLE/TBODY/TR/TD/TABLE/TBODY/TR/TD/TABLE/TBODY/TR[1]/TD/TABLE/TBODY/TR[1]/TD[1]/A</ElementMatchPath>
        </AnchorElement>
        <HtmlElement name="BtnNovoAtendimento" type="HtmlElement">
          <ElementMatchPath>/HTML/BODY/FORM/DIV[1]/DIV[2]/DIV/IFRAME</ElementMatchPath>
        </HtmlElement>
        <AnchorElement name="BtnRecepcao" type="AnchorElement">
          <ElementMatchPath>/HTML/BODY/FORM/DIV[1]/DIV/DIV[1]/DIV/DIV/A</ElementMatchPath>
        </AnchorElement>
        <InputElement name="txtCodCarteira" type="InputElement">
          <ElementMatchPath>/HTML/BODY/FORM/DIV[1]/DIV[2]/DIV/IFRAME/HTML/BODY/FORM/TABLE/TBODY/TR/TD/TABLE/TBODY/TR/TD/TABLE/TBODY/TR[1]/TD/TABLE/TBODY/TR[1]/TD/DIV[2]/INPUT</ElementMatchPath>
        </InputElement>
      </Controls>
    </DataDrivenAdapterBindings>
  </DataDrivenAdapterBindingsCollection>
</initstring>

Oct 28, 2011 at 11:59 AM
Edited Oct 28, 2011 at 6:59 PM

There is an odd behavior, now it´s works. But i got other error now.

I Created  an Automation based in the xml above, testing in the HatTestHarness the controls are found. But when executing inside IAD, my first step is to find the control "txtCodCarteira",  but always returns false. Can anyone help me to understand this behavior. Inside HatTestHarness is working and inside IAD not??

The error when try to set control value:

Microsoft.Uii.HostedApplicationToolkit.DataDrivenAdapter.DataDrivenAdapterException: DataDrivenAdapterException (op=SetControlValue,controlName=txtCodCarteira): Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) ---> System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
   at mshtml.HTMLWindow2Class.IHTMLWindow2_get_document()
   at Microsoft.Uii.HostedApplicationToolkit.DataDrivenAdapter.WebDataDrivenAdapter.FindControlHtmlElementViaElementMatching(IHTMLElementCollection htmlElementCollection, XmlNode elementMatchPath)
   at Microsoft.Uii.HostedApplicationToolkit.DataDrivenAdapter.WebDataDrivenAdapter.FindControlHtmlElement(String controlName, Boolean throwExceptionIfNotFound)
   at Microsoft.Uii.HostedApplicationToolkit.DataDrivenAdapter.WebDataDrivenAdapter.InputElement(OperationType op, String controlName, String controlValue)
   at Microsoft.Uii.HostedApplicationToolkit.DataDrivenAdapter.WebDataDrivenAdapter.OperationHandler(OperationType op, String controlName, String controlValue)
   --- End of inner exception stack trace ---
   at Microsoft.Uii.HostedApplicationToolkit.AutomationHosting.AutomationAdapter.AdapterFireActionFromAutomation(String applicationName, String actionName, Object data)
   at Microsoft.Uii.HostedApplicationToolkit.AutomationHosting.AutomationBridgeService.SetControlValue(String applicationName, String controlName, String controlValue)
   at Microsoft.Uii.HostedApplicationToolkit.Activity.SetControlValue.ExecuteImpl(ActivityExecutionContext context, AutomationBridgeService service)
   at Microsoft.Uii.HostedApplicationToolkit.Activity.HatActivityBase.Execute(ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(Activity activity, ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
   at System.Workflow.Runtime.Scheduler.Run()
2011-10-28 15:56:36: WF/Automation 51b0be03-d5ea-4cb2-9d1c-d703c5cc9629 terminated (duration 234ms): data=

Oct 28, 2011 at 7:22 PM

I SOLVED!

The page need to be inside Trusted Site in Internet Explorer!