To start with Selenium itself doesn't add any tag or attribute within the HTML DOM.
By all possible means the attribute __idm_frm__="467"
within the HTML, which is as follows:
<iframe src="NIB_MainFrame.asp" name="Principal" style="height:100%;width:100%;border:0;padding:0;border:0;margin:0;display:block;overflow-y:hidden" __idm_frm__="467"></iframe>`
looks to be dynamic and the attribute seems to be created/added by a JavaScript or AJAX.
As per the HTML in the question C#: Selenium - Element is not a frame element : FRAMESET it becomes much more clearer that the attribute is dynamically generated.
<iframe src="NIB_MainFrame.asp" name="Principal" style="height:100%;width:100%;border:0;padding:0;border:0;margin:0;display:block;overflow-y:hidden" __idm_frm__="467"></iframe>
<frameset id="frmSet" rows="55,0,*,24" border="0" framespacing="0" frameborder="no">
<frame noresize="noresize" scrolling="no" name="Header" src="NIB_Header.asp" __idm_frm__="472">
<frame noresize="noresize" scrolling="no" name="Menu" src="Blank.htm" __idm_frm__="473">
<frame noresize="noresize" scrolling="auto" name="Corpo" src="NIB_Pre_Bridge.asp?txtAgencia=4346&txtConta=014543708" __idm_frm__="474">
<frame noresize="noresize" scrolling="no" name="Rodape" src="NIB_Rodape.asp" __idm_frm__="475">
</frameset>
</iframe>
An example of Ember.js enabled DOM Tree containing the __idm_frm__
attribute:
<section id="ember22904" class="ad-banner-container ember-view"><iframe class="ad-banner" width="496" height="80" src="about:blank" scrolling="no" title="advertisement" kwframeid="3" __idm_frm__="1347"></iframe>
An example of implementation in Facebook containing the __idm_frm__
attribute::
<iframe style="display: none;" __idm_frm__="21" id="IFRAME_1007"></iframe>
Conclusion
As the attribute __idm_frm__="xyz"
does not contains a static value and dynamic in nature a wise decission would be to not to include this attribute while constructing any of the Locator Strategies.
You can find a detailed discussion in Ways to deal with #document under iframe