csharpfritz / csharpfritz/WebFormsTest

Can't find Controls - WebForms w/ nested Master pages

Open
#58 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
26
Forks
14
PR merge metrics
No merged PRs in 30d

Description

Has anyone had any success using WebFormsTest with nested Master Pages in WebForms?

I'm able to get WebApplicationProxy.Create to run, and WebApplicationProxy.GetPageLocation to run just fine, but controls are never able to be found.

```

WebApplicationProxy.Create(typeof(Platform.applications.applications), options);
var page= WebApplicationProxy.GetPageByLocation("/applications/test.aspx");
page.RunToEvent(WebFormEvent.Init);

var testControl= page.FindControl("btnTest"); // no controls are ever found recursively or otherwise.
```

Here is an example Master-page that inherits from a nested Master Page
```
<%@ Master Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="Site1.master.cs" Inherits="Platform.applications.Site1" %>
<%@ MasterType VirtualPath="~/Main.Master" %>



`
```

Thanks

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the WebApplicationProxy.Create and GetPageByLocation calls in the reproduction, then trace page.RunToEvent(WebFormEvent.Init) and FindControl("btnTest") for the nested Master Page example. Done means controls can be found when WebForms uses nested Master pages, including the shown Site1.master structure.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.