현재 WatiN을 설정하여 새 CRM 솔루션의 자동화 된 테스트를 수행하려고합니다. 고급 찾기라는 화면 버튼이 있습니다.
이 버튼을 클릭하면 새 팝업이 열립니다. 이 팝업에는 드롭 다운 메뉴가 있으며이를 클릭하고 옵션을 선택하고 싶습니다.WatiN - 팝업 메뉴에서 드롭 다운 메뉴 선택
팝업 창에 대한 코드는 다음과 같습니다
다음td class="ms-crm-AdvFind-Label"><br>
td class="ms-crm-AdvFind-EntityList"> <br>
select name="slctPrimaryEntity" class="ms-crm-SelectBox " id="slctPrimaryEntity" Sort="ascending" defaultSelected="activitypointer"><br>
option title="Organisations" value="account">
내가 가진 WatiN 코드가 될 때 : 내가 잘못 갈 곳
ie.Image(Find.ByClass("ms-crm-ImageStrip-advancedfind32")).Click();
IE poppedUpBrowser = IE.AttachTo<IE>(Find.ByTitle("Advanced Find - Microsoft Dynamics CRM"));
SelectList ddl = poppedUpBrowser.SelectList(Find.ByClass("ms-crm-AdvFind-Label")&(Find.ById("slctPrimaryEntity")));<br>
ddl.Option("Organisations").Select();<br>
Assert.That(ddl.SelectedItem.Equals("Organisations"));<br>
누군가가 지적하시기 바랍니다 수 있습니다.
감사합니다.
편집 :
테스트를 실행할 때 나는 현재이 오류 메시지가 점점 오전 :
Failure: WatiN.Core.Exceptions.ElementNotFoundException : Could not find OPTION element tag matching criteria: Attribute 'innertext' equals 'Organisations' ignoring case at http://website
Stack Trace:
at WatiN.Core.Element.get_NativeElement()
at WatiN.Core.Element.GetAttributeValueImpl(String attributeName)
at WatiN.Core.Component.GetAttributeValue(String attributeName)
at WatiN.Core.Option.setSelected(Boolean value, Boolean WaitForComplete)
at WatiN.Core.Option.Select()
편집 : 더 HTML 코드 :
<tbody>
<tr height="100%">
<td class="AdvFind_td_FindBody">
<span id="advancedFind">
<table class="ms-crm-AdvFindControl" id="advFind" cellSpacing="0" cellPadding="0" EntityName="activitypointer" UIProvider="" DataProvider="" EntityTypeCode="4200" DisableValueControlInSimpleMode="0" DistinctFetch="1" SaveChangesAlert="1" IncludeUserQuery="1" IncludeSystemQuery="1" ValidQueryType="0" FilterControlVisible="1" TitleVisible="0" EntityListVisible="1" RelatedEntitiesVisible="1" QueryListVisible="1" CanCreateUserQuery="1" CanWriteUserQuery="1" IncludeAPIQuery="0" FetchMode="2" Buttons="1023" Modes="3" Mode="1" aliasesInInitialFetch="">
<tbody>
<tr class="ms-crm-AdvFind-TitleArea">
<td>
<table class="ms-crm-AdvFind-Title-table" style="table-layout: fixed;">
<tbody>
<tr>
<td>
<table>
<tbody>
<tr>
<td class="ms-crm-AdvFind-EntityList">
<select name="slctPrimaryEntity" class="ms-crm-SelectBox " id="slctPrimaryEntity" Sort="ascending" defaultSelected="activitypointer">
<option title="Activities" value="activitypointer">
<option title="Addresses" value="customeraddress">
예, 팝업에 프레임이 있었는데, 그걸 발견하고 아래에서 정보를 사용하여 항목을 선택했습니다. – user1361245