Issue Finding Specific div
Elements with bUnit
#1354
-
Hello everyone, I've come across an issue while writing tests for my Blazor application using bUnit. I have a component that renders a list of Here's the relevant part of the rendered markup: <!-- Rendered markup snippet -->
<div class="disabled">Div 1</div>
<!-- The problematic div that is not found -->
<div `class="disabled">Div 2</div>
<div class="disabled">Div 3</div> var allDivs = cut.FindAll("div");
var div1= allDivs.FirstOrDefault(div => div.InnerHtml.Contains("Div 1") && div.ClassList.Contains("disabled"));
var div2 = allDivs.FirstOrDefault(div => div.InnerHtml.Contains("Div 2") && div.ClassList.Contains("disabled"));
var div3= allDivs.FirstOrDefault(div => div.InnerHtml.Contains("Div 3") && div.ClassList.Contains("disabled")); There are 9 more submenues of divs like this one, they all get rendered with some of the divs missing. Does anybody have any experience with this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Did you answer your own question since it's closed? |
Beta Was this translation helpful? Give feedback.
-
Thank you, i will keep this in mind for future threads.
man. 22. jan. 2024, 08:46 skrev Egil Hansen ***@***.***>:
… You are not doing anything wrong. But it's always a good idea to write why
you close it. Others may see the question and could learn from you.
—
Reply to this email directly, view it on GitHub
<#1354 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AVRSS3SCTMFA5LKUEKBOCE3YPYKN7AVCNFSM6AAAAABCACUTW2VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DEMBVGE4TE>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
Did you answer your own question since it's closed?