简体   繁体   中英

Silk Test doesn't identify WPF control hosted in Windows Forms host

I have a simple WPF user control:

<StackPanel>
    <Button>Test</Button>
    <TextBox>Test</TextBox>
    <TextBlock>Test</TextBlock>
</StackPanel>

I am hosting this user control inside Windows Forms host. Silk Test identifies this entire user control as Element-Host only and is not able to identify individual buttons or text-boxes.

Has anybody more insight on this? Is this scenario supported by Silk Test?

Update :

I have little success with Silk Test 14.0 (Earlier i had 13.5). Created test application with similar structure (WPF Control in windows forms host) and checked with Silk Test 14.0 . It is able to detect all individual WPF controls within user-control . But with my application, it is still not able to detect controls apart from 2 combo-boxes in "Toolbar". In user-control, i am using custom grid which is derived from Data-grid class

This should work.

It might depend on how you are embedding the UserControl though.

In the application we are using for testing it is contained in a Windows Forms ElementHost -control. In the code-behind you should see member declarations for both the ElementHost and your UserControl , is this the case?

Is your application using multiple AppDomain s? Silk Test currently only supports multiple AppDomains for Windows Forms, not for WPF so this might be another reason why it isn't working for you.

I don't know Silk Test well but it seems to me that this tool supports only standalone WPF applications. In your case, there is a standalone WinForms application with embedded WPFs controls. Documentation says:

Silk Test Workbench provides built-in support for testing Windows Presentation Foundation (WPF) applications. Silk Test Workbench supports standalone WPF applications and can record and play back controls embedded in .NET version 3.5 or later.

Silk Test team has identified this to be a bug. Fix may be released as a patch over Silk Test 15.5 version. I will update this post once i have better details on its release.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM