This project is read-only.

How to select Form data in web application ?

Oct 11, 2013 at 9:14 AM
Edited Oct 11, 2013 at 9:16 AM
Hi
In my application page, i could see fields form control, which are not able to record by recorder.

Can any one know how to use this ?
below is sample html code
<form action="http://testlink.in/" method="post" accept-charset="utf-8" id="global_search_form" name="global_search_form">
    <fieldset>
        <select id='user_city' data-placeholder='Select Your City' style="width:90%;" class="chosen-select city_select" name="user_city" tabindex="1">
             <option>Select your city</option>  
                <option value="http://testlink.in/pune#pune#1" >Pune</option>
                <option value="http://testlink.in/mumbai#mumbai#2" >Mumbai</option>
                <option value="http://testlink.in/bangalore#bangalore#4" >Bangalore</option>
                <option value="http://testlink.in/gurgaon#gurgaon#5" selected="selected">Gurgaon</option>
                <option value="http://testlink.in/delhi#delhi#6" >Delhi</option>
                <option value="http://testlink.in/noida#noida#7" >Noida</option>
                <option value="http://testlink.in/faridabad#faridabad#9" >Faridabad</option>
                <option value="http://testlink.in/ghaziabad#ghaziabad#11" >Ghaziabad</option>
        </select>
        <select class='chosen-select location_select' data-placeholder='Select or type location' id='home_location' style="width:90%;" name='location'  type="text" class="text" tabindex="2">
        </select>  
        <div class="form_text">Find restaurants around you&nbsp;
            <a class="btn-red" href="javascript:search();" >Search</a>
        </div>
    </fieldset>                             
</form>
Oct 11, 2013 at 9:31 AM
Hi Neeraj,

What actions are you trying to record?

What error message(s) do you get?
Oct 11, 2013 at 9:46 AM
Hi icnocop,

There is no error but.

my application is having dropdown option which is in fieldset form format, so which control do i need to use to work on fieldset form. while recording recorder not able to identify field form control.

Thanks
Neeraj
Oct 11, 2013 at 10:05 AM
Hi Neeraj,

I didn't have any problems using CUITe's Test Recorder to generate the UI repository class.

It was able to generate the following code for the drop down control:
public CUITe_HtmlComboBox cboTemp1 = new CUITe_HtmlComboBox("Id=user_city");
If the CUITe Test Recorder ever has issues, you can also try Visual Studio's Coded UI Test Recorder and then manually convert that code to CUITe.
Oct 11, 2013 at 10:11 AM
Hi icnocop,

it is not identify as CUITe_HtmlComboBox while recording but custom control.

below is the code which i tried to recorded using UIMap
/// <summary>
    /// RecordedMethod1
    /// </summary>
    public void RecordedMethod1()
    {
        #region Variable Declarations
        HtmlCustom uIItemCustom = this.UIOrderFoodOnlineTakeAWindow.UIOrderFoodOnlineTakeADocument.UIGurgaonPane.UIItemCustom;
        HtmlCustom uISelectyourcityCustom = this.UIOrderFoodOnlineTakeAWindow.UIOrderFoodOnlineTakeADocument.UIGurgaonPane.UISelectyourcityCustom;
        HtmlCustom uIPuneCustom = this.UIOrderFoodOnlineTakeAWindow.UIOrderFoodOnlineTakeADocument.UIGurgaonPane.UIPuneCustom;
        HtmlCustom uIMumbaiCustom = this.UIOrderFoodOnlineTakeAWindow.UIOrderFoodOnlineTakeADocument.UIGurgaonPane.UIMumbaiCustom;
        HtmlCustom uIBangaloreCustom = this.UIOrderFoodOnlineTakeAWindow.UIOrderFoodOnlineTakeADocument.UIGurgaonPane.UIBangaloreCustom;
        HtmlDiv uIFindrestaurantsarounPane = this.UIOrderFoodOnlineTakeAWindow.UIOrderFoodOnlineTakeADocument.UIGlobal_search_formCustom.UIFindrestaurantsarounPane;
        HtmlCustom uIItemCustom1 = this.UIOrderFoodOnlineTakeAWindow.UIOrderFoodOnlineTakeADocument.UISelectalocationPane.UIItemCustom;
        HtmlCustom uIArmaneNagarCustom = this.UIOrderFoodOnlineTakeAWindow.UIOrderFoodOnlineTakeADocument.UISelectalocationPane.UIArmaneNagarCustom;
        HtmlCustom uIArmaneNagar10thmainRCustom = this.UIOrderFoodOnlineTakeAWindow.UIOrderFoodOnlineTakeADocument.UISelectalocationPane.UIArmaneNagar10thmainRCustom;
        HtmlCustom uIArmaneNagar11thMainRCustom = this.UIOrderFoodOnlineTakeAWindow.UIOrderFoodOnlineTakeADocument.UISelectalocationPane.UIArmaneNagar11thMainRCustom;
        HtmlDiv uIItem4000restaurants2Pane = this.UIOrderFoodOnlineTakeAWindow.UIOrderFoodOnlineTakeADocument.UIFoodbgPane.UIItem4000restaurants2Pane;
        HtmlHyperlink uISearchHyperlink = this.UIOrderFoodOnlineTakeAWindow.UIOrderFoodOnlineTakeADocument.UIGlobal_search_formCustom.UISearchHyperlink;
        #endregion

        // Click custom control
        Mouse.Click(uIItemCustom, new Point(244, 12));

        // Set flag to allow play back to continue if non-essential actions fail. (For example, if a mouse hover action fails.)
        Playback.PlaybackSettings.ContinueOnError = true;

        // Mouse hover  custom control at (246, 21)
        Mouse.Hover(uIItemCustom, new Point(246, 21));

        // Mouse hover 'Select your city' custom control at (244, 0)
        Mouse.Hover(uISelectyourcityCustom, new Point(244, 0));

        // Mouse hover 'Pune' custom control at (245, 0)
        Mouse.Hover(uIPuneCustom, new Point(245, 0));

        // Mouse hover 'Mumbai' custom control at (249, 0)
        Mouse.Hover(uIMumbaiCustom, new Point(249, 0));

        // Reset flag to ensure that play back stops if there is an error.
        Playback.PlaybackSettings.ContinueOnError = false;

        // Click 'Bangalore' custom control
        Mouse.Click(uIBangaloreCustom, new Point(255, 13));

        // Set flag to allow play back to continue if non-essential actions fail. (For example, if a mouse hover action fails.)
        Playback.PlaybackSettings.ContinueOnError = true;

        // Mouse hover 'Find restaurants around you Search' pane at (268, 31)
        Mouse.Hover(uIFindrestaurantsarounPane, new Point(268, 31));

        // Reset flag to ensure that play back stops if there is an error.
        Playback.PlaybackSettings.ContinueOnError = false;

        // Click custom control
        Mouse.Click(uIItemCustom1, new Point(255, 10));

        // Set flag to allow play back to continue if non-essential actions fail. (For example, if a mouse hover action fails.)
        Playback.PlaybackSettings.ContinueOnError = true;

        // Mouse hover 'Armane Nagar' custom control at (264, 18)
        Mouse.Hover(uIArmaneNagarCustom, new Point(264, 18));

        // Mouse hover 'Armane Nagar 10th main Road' custom control at (264, 0)
        Mouse.Hover(uIArmaneNagar10thmainRCustom, new Point(264, 0));

        // Reset flag to ensure that play back stops if there is an error.
        Playback.PlaybackSettings.ContinueOnError = false;

        // Click 'Armane Nagar 11th Main Road' custom control
        Mouse.Click(uIArmaneNagar11thMainRCustom, new Point(259, 15));

        // Set flag to allow play back to continue if non-essential actions fail. (For example, if a mouse hover action fails.)
        Playback.PlaybackSettings.ContinueOnError = true;

        // Mouse hover '4000+ restaurants | 2,50,000+ orders sin' pane at (310, 38)
        Mouse.Hover(uIItem4000restaurants2Pane, new Point(310, 38));

        // Reset flag to ensure that play back stops if there is an error.
        Playback.PlaybackSettings.ContinueOnError = false;

        // Click 'Search' link
        Mouse.Click(uISearchHyperlink, new Point(55, 14));
    }
Oct 11, 2013 at 10:16 AM
Which browser and version are you recording with?

Have you tried recording with CUITe_ObjectRecorder.exe?
Oct 11, 2013 at 10:18 AM
Edited Oct 11, 2013 at 10:29 AM
Hi again,

I guess, it has silver light control in application.

I am using CUITe for .NET v4.5 (CUITe.dll and CUITe_ObjectRecorder.exe) and VS 2012 premium, framework 4.5
Browser: IE 10
try to records object as below

object :
public class ORSelectRestaurant : CUITe_BrowserWindow
    {
        public new string sWindowTitle = "Order Food Online";        
        public CUITe_HtmlSpan spnSelectCity = new CUITe_HtmlSpan("InnerText=Mumbai");
        public CUITe_HtmlSpan spnSelectALocation = new CUITe_HtmlSpan("InnerText=Select a location");

        public CUITe_HtmlSpan spnKamotheSector11 = new CUITe_HtmlSpan("InnerText=Kamothe sector 11");
        public CUITe_HtmlHyperlink lnkSearch = new CUITe_HtmlHyperlink("Class=btn-red;InnerText= Search ");
    }
script:
ORSelectRestaurant objORSelectRestaurant = CUITe_BrowserWindow.GetBrowserWindow<ORSelectRestaurant>();
objORSelectRestaurant.spnSelectCity.Click();
Throwing error as :
Error Message:
Could not load file or assembly 'Microsoft.VisualStudio.TestTools.UITest.Extension.Silverlight, Version=11.0.0.0, Culture=neutral, PublicKeyToken=374b4c93160c098c' or one of its dependencies. The system cannot find the file specified.
Trace :
 at CUITe.ObjectRepositoryManager.GetInstance(Type typePageDefinition, Object[] args)
   at CUITe.ObjectRepositoryManager.GetInstance(Type typePageDefinition)
   at CUITe.ObjectRepositoryManager.GetInstance[T]()
   at CUITe.Controls.HtmlControls.CUITe_BrowserWindow.GetBrowserWindow[T]()
any idea now?

Thanks
Neeraj
Oct 11, 2013 at 11:48 AM
Hi Again,

More error code:

'vstest.executionengine.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'vstest.executionengine.exe' (Managed (v4.0.30319)): Loaded 'C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO 11.0\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\vstest.executionengine.exe'
'vstest.executionengine.exe' (Managed (v4.0.30319)): Loaded 'C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO 11.0\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\Microsoft.VisualStudio.TestPlatform.TestExecutor.Core.dll'
'vstest.executionengine.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'vstest.executionengine.exe' (Managed (v4.0.30319)): Loaded 'C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO 11.0\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll'
'vstest.executionengine.exe' (Managed (v4.0.30319)): Loaded 'C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO 11.0\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\Microsoft.VisualStudio.TestPlatform.Core.dll'
'vstest.executionengine.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'vstest.executionengine.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'vstest.executionengine.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'vstest.executionengine.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'vstest.executionengine.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'vstest.executionengine.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\SMDiagnostics\v4.0_4.0.0.0__b77a5c561934e089\SMDiagnostics.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'vstest.executionengine.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Internals\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Internals.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'vstest.executionengine.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.VisualStudio.Diagnostics.ServiceModelSink\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Diagnostics.ServiceModelSink.dll'
'vstest.executionengine.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.IdentityModel\v4.0_4.0.0.0__b77a5c561934e089\System.IdentityModel.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'vstest.executionengine.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_32\System.Transactions\v4.0_4.0.0.0__b77a5c561934e089\System.Transactions.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'vstest.executionengine.exe' (Managed (v4.0.30319)): Loaded 'C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO 11.0\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\Microsoft.VisualStudio.TestPlatform.Utilities.dll'
'vstest.executionengine.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.Diagnostics.Measurement\11.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Diagnostics.Measurement.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'vstest.executionengine.exe' (Managed (v4.0.30319)): Loaded 'C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO 11.0\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\Extensions\Microsoft.VisualStudio.TestPlatform.Extensions.dll'
'vstest.executionengine.exe' (Managed (v4.0.30319)): Loaded 'C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO 11.0\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\Extensions\Microsoft.VisualStudio.TestPlatform.Extensions.GenericTestAdapter.dll'
'vstest.executionengine.exe' (Managed (v4.0.30319)): Loaded 'C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO 11.0\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\Extensions\Microsoft.VisualStudio.TestPlatform.Extensions.MSAppContainerAdapter.dll'
'vstest.executionengine.exe' (Managed (v4.0.30319)): Loaded 'C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO 11.0\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\Extensions\Microsoft.VisualStudio.TestPlatform.UnitTestFramework.dll'
'vstest.executionengine.exe' (Managed (v4.0.30319)): Loaded 'C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO 11.0\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\Extensions\Microsoft.VisualStudio.TestPlatform.Extensions.OrderedTestAdapter.dll'
'vstest.executionengine.exe' (Managed (v4.0.30319)): Loaded 'C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO 11.0\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\Extensions\Microsoft.VisualStudio.TestPlatform.Extensions.TmiAdapter.dll'
'vstest.executionengine.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.QualityTools.Common\11.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.QualityTools.Common.dll'
.
.
.
A first chance exception of type 'System.IO.FileNotFoundException' occurred in CUITe.dll
The thread 'STA Helper Thread' (0xbcc) has exited with code 0 (0x0).
The thread 'STA Helper Thread' (0x157c) has exited with code 0 (0x0).
The thread 'Agent: state execution thread for test 'CodedUITestMethod1' with id 'e9887257-0638-44f4-9de4-40fa0e515905'' (0x9c8) has exited with code 0 (0x0).
The thread 'Agent: adapter run thread for test 'CodedUITestMethod1' with id 'e9887257-0638-44f4-9de4-40fa0e515905'' (0x3cc) has exited with code 0 (0x0).
The thread 'Uia Technology Manager Thread' (0x169c) has exited with code 0 (0x0).
The thread 'Agent: test queue thread' (0x16a0) has exited with code 0 (0x0).
The thread 'MSAA STA Helper Thread' (0x854) has exited with code 0 (0x0).
The thread '<No Name>' (0x260) has exited with code 0 (0x0).
The thread 'Agent: heartbeat thread' (0x1578) has exited with code 0 (0x0).
The thread 'Controller: Release worker thread for agent SATTYAM-PC' (0x115c) has exited with code 0 (0x0).
The thread 'Controller: heartbeat thread' (0x570) has exited with code 0 (0x0).
The thread 'Controller: state execution thread for run 49610c8a-1d95-486c-8088-37db0a631431' (0x8b8) has exited with code 0 (0x0).
The thread 'TestAgentProcessMonitor' (0x1788) has exited with code 0 (0x0).
The program '[2740] QTAgent32.exe: Managed (v4.0.30319)' has exited with code 0 (0x0).
The thread 'Controller: run queue thread' (0x163c) has exited with code 0 (0x0).
The thread 'Controller: deployment queue thread' (0x1434) has exited with code 0 (0x0).
The thread 'Local run message listener test message receiver cleanup thread' (0x1244) has exited with code 0 (0x0).
The thread '<No Name>' (0xd2c) has exited with code 0 (0x0).
The thread '<No Name>' (0xf5c) has exited with code 0 (0x0).
The program '[1548] vstest.executionengine.exe: Managed (v4.0.30319)' has exited with code 0 (0x0).
Oct 15, 2013 at 6:35 AM
Hi

any update or solution?
Oct 16, 2013 at 9:45 AM
Hi Neeraj,

Have you tried to add a reference to "Microsoft.VisualStudio.TestTools.UITest.Extension.Silverlight" in your project?

See the Microsoft Visual Studio UI Test Plugin for Silverlight for Visual Studio 2012 here.

Thank you.
Oct 16, 2013 at 9:49 AM
Hi icnocop,

I have tried and problem was CUITe project missing Silverlight dll and i downloaded and working fine.

Thanks
Neeraj