Can we automate Spreads using Coded UI Test in Visual Studio 2010

Posted by: preethaattuparampath on 8 September 2017, 2:19 pm EST

  • Posted 8 September 2017, 2:19 pm EST

    hi,


       We are using Coded UI Test for our test automation, and use Spreads within our application. When I record the test it does not recognise the spread part, but could get the window handle only,


     Coded UI Test allows us to add an external dll.


     Can u please let me know how can i automate the same.


    regards


    preetha

  • Replied 8 September 2017, 2:19 pm EST

    Hello Preetha,

    We have forwarded your request for more information from the project development team about Coded UI Tests in VS2010. We need some more time to research on the issue.

    Will get back to you.

    Thanks.

  • Replied 8 September 2017, 2:19 pm EST

    hi,


        Thank you will wait for your reply


     


    regards


    preetha

  • Replied 8 September 2017, 2:19 pm EST

    Hi All,


          Any Updates on this please.


    regards


    preetha


     

  • Replied 8 September 2017, 2:19 pm EST

    <FONT size=3 face="Times New Roman">Preetha,</FONT>


    <o:p><FONT size=3 face="Times New Roman"> </FONT></o:p>


    <FONT size=3 face="Times New Roman">I will request you to please give us some more time to research on this issue. </FONT>


    <FONT size=3 face="Times New Roman">We will update this thread with our observations.</FONT>


    <o:p><FONT size=3 face="Times New Roman"> </FONT></o:p>

  • Replied 8 September 2017, 2:19 pm EST

    <FONT color=#000000>Hello Preetha,</FONT>


    <FONT color=#000000>Apologies for the delay in responding. And after reseaching on the issue our project management team has found that Coded UI tests should work with Spread.</FONT>


    <SPAN style="FONT-SIZE:11pt;"><FONT color=#000000 size=2>Coded UI Test records user’s behaviors and generate code which re-send inputted message (from keyboard and mouse). It work on native window. The generated code also doesn’t contain code which instantiate Form and control. When we run the test methods which is created by Coded UI Test, it’ll find native window base on the recorded context. </FONT></SPAN>


    <SPAN style="FONT-SIZE:11pt;"><FONT color=#000000 size=2>For example, in my test, in order to find Spread control, Coded UI Test the generated code to find out the control which named “fpSpread1”.</FONT></SPAN>


    <BLOCKQUOTE>

    <FONT size=2><FONT color=#000000><SPAN style="FONT-FAMILY:Consolas;COLOR:blue;FONT-SIZE:9.5pt;">this</SPAN><SPAN style="FONT-FAMILY:Consolas;FONT-SIZE:9.5pt;">.SearchProperties[<SPAN>WinWindow</SPAN>.<SPAN>PropertyNames</SPAN>.ControlName] = <SPAN>"fpSpread1"</SPAN>;</SPAN></FONT></FONT>

    </BLOCKQUOTE>

    <SPAN style="FONT-SIZE:11pt;"><FONT color=#000000 size=2>Then, in order to find out our editing control, Coded UI Test generated code to find out the native window which inherits from EDIT (all TextBox in .NET Framework inherits from native EDIT window)</FONT></SPAN>


    <BLOCKQUOTE>

    <FONT size=2><FONT color=#000000><SPAN style="FONT-FAMILY:Consolas;COLOR:blue;FONT-SIZE:9.5pt;">this</SPAN><SPAN style="FONT-FAMILY:Consolas;FONT-SIZE:9.5pt;">.SearchProperties.Add(<SPAN style="COLOR:blue;">new</SPAN> <SPAN>PropertyExpression</SPAN>(<SPAN>WinWindow</SPAN>.<SPAN>PropertyNames</SPAN>.ClassName, <SPAN>"WindowsForms10.EDIT"</SPAN>, <SPAN>PropertyExpressionOperator</SPAN>.Contains));</SPAN></FONT></FONT>

    </BLOCKQUOTE>

    <SPAN style="FONT-SIZE:11pt;"><FONT color=#000000 size=2>So, if we want to pass the test, we must ensure that the form is already opened at the time we start run test methods. </FONT></SPAN>


    <SPAN style="FONT-SIZE:11pt;"><FONT color=#000000 size=2>Thanks.</FONT></SPAN>

  • Replied 8 September 2017, 2:19 pm EST

    I tried Coded UI on SpreadControl but it is not providing me ROWS, or COLUMNS access...in a grid. Custom control is derived from <FONT color=#1000a0>class</FONT> <B>FpSpread</B> for my application. So unable to proceed with UI automation. Can you help me here how to proceed ahead...and get ROWS, COLUMNS handle?

    <FONT size=2 face=Consolas><FONT size=2 face=Consolas>

    </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>public</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>class</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> </FONT></FONT><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas>UIFpSpread1Window</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> : </FONT></FONT><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas>WinWindow

    </FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>

    {


     


    </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>public</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> UIFpSpread1Window(</FONT></FONT><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas>UITestControl</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> searchLimitContainer) :


    </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>base</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>(searchLimitContainer)


    {

    </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>

    #region</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> Search Criteria


    </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>this</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>.SearchProperties[</FONT></FONT><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas>WinWindow</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>.</FONT></FONT><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas>PropertyNames</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>.ControlName] = </FONT></FONT><FONT color=#a31515 size=2 face=Consolas><FONT color=#a31515 size=2 face=Consolas><FONT color=#a31515 size=2 face=Consolas>"FpSpread1"</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>;


    </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>this</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>.WindowTitles.Add(</FONT></FONT><FONT color=#a31515 size=2 face=Consolas><FONT color=#a31515 size=2 face=Consolas><FONT color=#a31515 size=2 face=Consolas>"User Dashboard"</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>);

    </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>

    #endregion

    </FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>

    }

    </FONT></FONT>
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels