1

Closed

Add remaining HtmlControls to CUITe framework

description

Hi,

Could the remaining HtmlControls that are not covered by the CUITe framework (e.g. HtmlEditableDiv, HtmlEditableSpan etc) be added to the CUITe framework?

Thanks

file attachments

Closed Feb 14, 2013 at 8:25 AM by icnocop
Fixed in CUITe 1.0.6 Beta

comments

icnocop wrote Nov 1, 2012 at 6:59 AM

Hi flapmio,

Can you give some example html and the expected functionality for each control you'd like wrapped please?

Thank you.

flapmio wrote Nov 1, 2012 at 11:43 AM

Thanks icnopop,

I'm working on a SharePoint 2007 application and thought I was interacting with a standard HtmlEdit control, but when recorded with the CodedUI Test Builder it recorded it as a HtmlEditableDiv control:
  public HtmlEditableDiv AAAAAAAA
    {
        get
        {
            if ((this.mAAAAAAAA == null))
            {
                this.mAAAAAAAA = new HtmlEditableDiv(this);
                #region Search Criteria
                this.mAAAAAAAA.SearchProperties[HtmlEdit.PropertyNames.Id] = "ctl00_m_g_07a58e60_6e53_4527_8b29_7d41dfe931e0_ctl00_ctl04_ctl04_ctl00_ctl00_ctl0" +
                    "4_ctl00_ctl00_MetaEngineField_upLevelDiv";
                this.mAAAAAAAA.SearchProperties[HtmlEdit.PropertyNames.Name] = "upLevelDiv";
                this.mAAAAAAAA.FilterProperties[HtmlEdit.PropertyNames.InnerText] = "BBBBBBBB";
                this.mAAAAAAAA.FilterProperties[HtmlEdit.PropertyNames.Title] = null;
                this.mAAAAAAAA.FilterProperties[HtmlEdit.PropertyNames.Class] = "ms-inputuserfield";
                this.mAAAAAAAA.FilterProperties[HtmlEdit.PropertyNames.ControlDefinition] = "onblur=\"updateControlValue(\'ctl00_m_g_07";
                this.mAAAAAAAA.FilterProperties[HtmlEdit.PropertyNames.TagInstance] = "15";
                this.mAAAAAAAA.WindowTitles.Add("Home");
                #endregion
            }
            return this.mAAAAAAAA;
        }
    }
Hopefully this is the HTML you require:
<div tabIndex="0" title="" class="ms-inputuserfield" id="ctl00_m_g_9cc4e426_4533_4eae_a22e_b7e16b30dbcf_ctl00_ctl04_ctl04_ctl00_ctl00_ctl04_ctl00_ctl00_MetaEngineField_upLevelDiv" style="overflow-x: hidden; overflow-y: auto; background-color: window; width: 100%; height: 18px; color: windowtext;" contentEditable="true" onkeydown="return onKeyDownRw(this, 'ctl00_m_g_9cc4e426_4533_4eae_a22e_b7e16b30dbcf_ctl00_ctl04_ctl04_ctl00_ctl00_ctl04_ctl00_ctl00_MetaEngineField', 3, true, event);" onkeyup="return onKeyUpRw('ctl00_m_g_9cc4e426_4533_4eae_a22e_b7e16b30dbcf_ctl00_ctl04_ctl04_ctl00_ctl00_ctl04_ctl00_ctl00_MetaEngineField');" onclick="onClickRw(true, true);" onblur="updateControlValue('ctl00_m_g_9cc4e426_4533_4eae_a22e_b7e16b30dbcf_ctl00_ctl04_ctl04_ctl00_ctl00_ctl04_ctl00_ctl00_MetaEngineField')" ondragstart="canEvt(event);" oncopy="docopy();" onpaste="dopaste();" onfocusin="this._fFocus=1;saveOldEntities('ctl00_m_g_9cc4e426_4533_4eae_a22e_b7e16b30dbcf_ctl00_ctl04_ctl04_ctl00_ctl00_ctl04_ctl00_ctl00_MetaEngineField_upLevelDiv')" onfocusout="this._fFocus=0;" _events="[object Object]" name="upLevelDiv" AutoPostBack="0" onChange="updateControlValue('ctl00_m_g_9cc4e426_4533_4eae_a22e_b7e16b30dbcf_ctl00_ctl04_ctl04_ctl00_ctl00_ctl04_ctl00_ctl00_MetaEngineField')" _behaviors="[object Object]" tip="XXXXXXXXXXXXX. " ToolTipBehavior="[object Object]">


The functionality I would like wrapped please is:

Text (Gets or Sets the contents of the control)
IsPassword (Gets a value whether the control is a password control)
InnerText
Password (Gets the encoded contents of the control)

Cheers

flapmio wrote Nov 1, 2012 at 4:36 PM

Hi icnopop,

Apologies if you've started on any of this but I had a go at adding the controls myself.

In the attachment you will find the following files:

CUITe_HtmlEditableDiv.cs - copy of the CUITe_HtmlEdit class, contains a simple get and set method on the 'Text' property
CUITe_HtmlEditableSpan.cs - copy of the CUITe_HtmlEdit class. The 'Text' property only performs a Get according to the Help file but I've used the 'CopyPastedText' property in the Set method, hopefully that will work.
CUITe_BrowserWindow.cs - Added refs to the above in the "Objects initialized at runtime..." section @ lines 244 and 252
CUITe_HtmlContol.cs - Added refs to the above in the WrapUtil method @ lines 232 and 268.

This was done using the code from patch #20526 in VS 2010 Ultimate with FP2 and API 3.0. I have re-built and was able to use the CUITe_HtmlEditableDiv control successfully to set the text of a control.

I don't know if other parts of the framework needed adding/updating, if there are please let me know what and I will try to update accordingly.
If you can incorporate into your latest release making amendments where required that would be great.

wrote Nov 2, 2012 at 3:46 AM

Associated with changeset 21563.

icnocop wrote Nov 2, 2012 at 3:51 AM

Thank you flapmio.

FYI, I usually like to have at least one unit\integration tests with all code changes, one per class.

Regardless, I've went ahead and checked in your code changes except for the changes in CUITe_BrowserWindow.cs because those methods are deprecated.

Thank you for contributing! :)

flapmio wrote Nov 2, 2012 at 12:06 PM

Cool! Thanks