Telerik Forums
Test Studio Forum
3 answers
62 views

I'm attempting to run a Load Test with Telerik Test Studio. I've recorded a user profile and would like to run it with 100 VUs.

How long does Test Studio wait between starting the user profile with each VU? The "sample rate" seems like maybe it would affect this, but I would like to set it so that it waits 500 ms in between each VU, not 5 whole seconds. Is this possible? 100 VUs should break my site but it's only getting a peak of 150 responses received per second. I am assuming that means 150 HTTP requests responded to (I have 50 HTTP requests in my user profile, so this means it's only doing 3 VUs per second).

How can I get it to send more requests at a time at my server?
Boyan Boev
Telerik team
 answered on 14 Dec 2016
1 answer
96 views

Hi,

 

I couldn`t find it anywhere, so i hope you can answer me.

How could I link test cases in Test Studio with user stories in Jira?

 

For example, if i have a user story in Jira, I would like to create test cases for that user story in Test Studio. After executing my tests, if i get any bugs, I would like to submit it into Jira, not only into the right project, but also into a right User story.

 

How could I manage this?

Nikolay Petrov
Telerik team
 answered on 14 Dec 2016
1 answer
223 views
Here's the situation:

I am testing a form using Telerik Test Studio.

There are 3 drop downs (State, City, Building) and what you choose on the previous box decides what is in the next box. Before you choose what is in the drop down box number one, two and three are empty (no choices). When you choose a State, it gives you options for cities, then once you choose a city, the building drop down gets populated with options.

The problem is, when I am testing this with the drop downs, it chooses the state correctly, but it, for some reason, doesn't register that there is a state chosen, so the city drop down does not get populated. I slowed the process down while the test is running to try and see if it was something simple, but I saw myself that it DOES choose a state, so I tried to manually choose the city but there was nothing to populate the drop down options. But, if I choose the state myself, then the cities populate.

Thank you for your help.

M

Here's the situation:

I am testing a form using Telerik Test Studio.

There are 3 drop downs (State, City, Building) and what you choose on the previous box decides what is in the next box. Before you choose what is in the drop down box number one, two and three are empty (no choices). When you choose a State, it gives you options for cities, then once you choose a city, the building drop down gets populated with options.

The problem is, when I am testing this with the drop downs, it chooses the state correctly, but it, for some reason, doesn't register that there is a state chosen, so the city drop down does not get populated. I slowed the process down while the test is running to try and see if it was something simple, but I saw myself that it DOES choose a state, so I tried to manually choose the city but there was nothing to populate the drop down options. But, if I choose the state myself, then the cities populate.

Thank you for your help.

M

Here's the situation:

I am testing a form using Telerik Test Studio.

There are 3 drop downs (State, City, Building) and what you choose on the previous box decides what is in the next box. Before you choose what is in the drop down box number one, two and three are empty (no choices). When you choose a State, it gives you options for cities, then once you choose a city, the building drop down gets populated with options.

The problem is, when I am testing this with the drop downs, it chooses the state correctly, but it, for some reason, doesn't register that there is a state chosen, so the city drop down does not get populated. I slowed the process down while the test is running to try and see if it was something simple, but I saw myself that it DOES choose a state, so I tried to manually choose the city but there was nothing to populate the drop down options. But, if I choose the state myself, then the cities populate.

Thank you for your help.

M

Boyan Boev
Telerik team
 answered on 08 Dec 2016
1 answer
60 views

Hi , Im trying test and compare json response from post api call but for some reason my jsom looks like this : 

���������|�φ���_d�����#��I�l����i>������:o��Z�o��O�M��������EV��O�+�o_��"��_Ϋe�b����G[;�޿��}z�}��������u gu�����fm~R���hw����ݽ�]���V3|���ͧ�6Nj��� �]�5/�Z6�{��M��v�t'��B����լ8/d4�ogg�C�4xrMM�w�c��&R�f�|�p�^�,+��:}Z{mN�}|�ݳoN_�/�_�^޷�[�

 

I import my request from fiddler.

 

Other issue is that i still cant understand how i compare json from the response with exacted json .

 

Kiril Stanoev
Telerik team
 answered on 07 Dec 2016
2 answers
251 views

Hi,

 

When recording a test, i highlight Element, and i want to verify if there is any numbers in the text block. How can i do this? I only found, i can look for the exact number.

 

 

Thanks

Elena
Telerik team
 answered on 06 Dec 2016
1 answer
74 views

I'm a new user to Test Studio and looking to see of there is sample code, video or documentation on how to handle get and post requests to the server.  I recorded a script where you fill in text into fields then the users clicks submit.  The next page is a verification page to verify the information before submitting to the website. After hitting submit on that screen, the server doesn't get the information and the script fails.

 

Elena
Telerik team
 answered on 06 Dec 2016
17 answers
73 views

This has happened three times now so I don't think it is just me :) ...  WIthin the same project, I will copy and paste a test script and then rename the new version.  I open the new version, delete a majority of the test steps and save (call this my "initial version" of the new test script).  I then edit the new version extensively, saving several times intermittently, and run a number of times in a test list, both locally and remotely.  All good so far.  I close TestStudio, do a reboot of my machine and then re-open TestStudio.  The test script now matches the "initial version" with all subsequent changes missing.  Any idea what is going on?

 

Your help will be most appreciated!  Thanks.

 

Briar

Boyan Boev
Telerik team
 answered on 01 Dec 2016
4 answers
60 views

I am a newbie to Test , I just couldn’t find the answer directly from the help documents!

Question: I would like to extract a particular value from the I am testing and write it to a text file.

I tried

And in coded test:
public void MyFirstCodeTest_CodedStep()
        {
            string myData = GetExtractedValue(seconds);
System.IO.StreamWriter file = new System.IO.StreamWriter("c:\\source.txt");
            file.WriteLine("Expected Result: "+ myData);
            file.Close();
}
But it doesn’t help!

Can you suggest a please?

Please email the answer to minu@hot.co.nz

Thanks!

Boyan Boev
Telerik team
 answered on 30 Nov 2016
2 answers
300 views

I am trying to define xpath as one of the find settings for an element in the element repository. I am replacing the automatically generated xpath with an xpath that works in the coded step using Find.ByXPath, but the identification fails after the auto generated xpath is replaced.

I would also like to know the difference between xpath and html path.

 

Default xpath generated: /article[1]/fieldset[1]/ol[1]/li[11]/span[2]/input[2]

Changed xpath: /ol/li[contains(span,'Speech conditions')]/span/input[@value='No'] (I have also tried adding the '@' escape character for the "," and "@" symbols in the xpath)

The following is the html of the page

<html class=" js flexbox canvas canvastext webgl no-touch geolocation postmessage no-websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients no-cssreflections csstransforms csstransforms3d csstransitions fontface generatedcontent video audio localstorage sessionstorage webworkers applicationcache svg inlinesvg no-smil svgclippaths" lang="en"><head>
        <meta charset="utf-8">
        <title></title>
        <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon">
        <script src="https://ssl.google-analytics.com/ga.js" type="text/javascript" async=""></script><script src="/Scripts/App/namespace.js" type="text/javascript"></script>
        <script src="/Scripts/App/modernizr.custom.24465.js" type="text/javascript"></script>
        <link href="/Content/css?v=y9MbIqhxSJ9syvKPl6VvsW91UpoZTibWFIr7ztvYKyY1" rel="stylesheet" type="text/css">
        <link href="/Content/ClientStyles/2008/css?v=cEvFed-VjJeJdJgeSzGl8h4W3IKEazh8p7RiAX-0XZk1" rel="stylesheet" type="text/css">
        
        <link href="/Content/themes/base/css?v=AumV9aQh6a_U8B-s6SUUgfjxQegD-CiF3g84ONgQrY01" rel="stylesheet" type="text/css">

        <meta name="viewport" content="width=device-width">
        
        <script type="text/javascript">

            var _gaq = _gaq || [];
            _gaq.push(['_setAccount', '']);
            _gaq.push(['_trackPageview']);

            (function () {
                var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
                ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
            })();

        </script>

    </head>
    <body>
    
    <noscript> &lt;p class="alert-message alert-message-long alert-message-long-all"&gt;Your browser does not support JavaScript!&lt;/p&gt;</noscript>


  


<div class="ajaxLoderLook" id="testAjaxImage" style="display: none;">
    <img alt="Loading..." src="/Images/ajaxloader.gif">

</div>

        <div class="content">
            <header>
                <div class="content-wrapper header-content">
                  
                    <img class="float-right main-logo" alt="logo" src="/Images/Logos/hannover_re.png">
                 
                        <a class="apply button decisionSummary" id="btnDecisionSummary" href="#">Decision Summary</a>
                            <div class="age">
                                <span>Age: 41</span>
                            </div>
                    
<fieldset>
    <h3>Applicant: Johnni Jones</h3>
    <h3>Age Next birthday: 41 (11/08/1976)</h3>
</fieldset>                
                </div>
            </header>
            <div id="body">
                <section class="content-wrapper main-content clear-fix">
                    
                    <div id="content">
                        
                        <div id="innerContent" style="visibility: visible;">
                            

 

<div class="statusbar-container">
    
<div class="statusbar">
        <div class="statusbar-item" style="display: block;">
            
            Review
        </div>
        <div class="statusbar-item" style="display: block;">
            
            Your declaration
        </div>
</div>
</div>

<article>
    <fieldset>
        <legend>Direct Medical</legend>
        <input name="categoryId" id="categoryId" type="hidden" value="3502">
        <input name="yesRequired" id="yesRequired" type="hidden" value="False">
        <ol data-bind="foreach: { data: questions, afterRender: initControls }">
            <!-- ko if: type == 'Group' --> 
            <li>
                <h4 data-bind="text: text">In the last 5 years have you suffered from, been diagnosed with or sought medical advice or treatment for:</h4>
            </li>
            <!-- /ko --> 
            <!-- ko if: type == 'YesNo' --><!-- /ko --> 
        
            <!-- ko if: type == 'Group' --><!-- /ko --> 
            <!-- ko if: type == 'YesNo' --> 
            <li>
                <span class="question-text group-question-label" data-bind="text: text, css: { 'invalid-question': !answer.isValid() }">High Blood Pressure (other than fully resolved pregnancy related high blood pressure)</span>
                <span data-bind="foreach: $parent.answerOptions">
                    <span data-bind="text: value">Yes</span><input name="4548" type="radio" value="Yes" data-bind="value: key, attr: { name: $parent.qid, 'data-qcode': $parent.qcode }, checked: $parent.answer, css: { 'readonly': $parent.readOnly }" data-qcode="DMEDI00Q1_1_BD">
                
                    <span data-bind="text: value">No</span><input name="4548" type="radio" value="No" data-bind="value: key, attr: { name: $parent.qid, 'data-qcode': $parent.qcode }, checked: $parent.answer, css: { 'readonly': $parent.readOnly }" data-qcode="DMEDI00Q1_1_BD">
                </span>
            </li>          
            <!-- /ko --> 
        
            <!-- ko if: type == 'Group' --><!-- /ko --> 
            <!-- ko if: type == 'YesNo' --> 
            <li>
                <span class="question-text group-question-label" data-bind="text: text, css: { 'invalid-question': !answer.isValid() }">High Cholesterol</span>
                <span data-bind="foreach: $parent.answerOptions">
                    <span data-bind="text: value">Yes</span><input name="4577" type="radio" value="Yes" data-bind="value: key, attr: { name: $parent.qid, 'data-qcode': $parent.qcode }, checked: $parent.answer, css: { 'readonly': $parent.readOnly }" data-qcode="DMEDI00Q1_2_BD">
                
                    <span data-bind="text: value">No</span><input name="4577" type="radio" value="No" data-bind="value: key, attr: { name: $parent.qid, 'data-qcode': $parent.qcode }, checked: $parent.answer, css: { 'readonly': $parent.readOnly }" data-qcode="DMEDI00Q1_2_BD">
                </span>
            </li>          
            <!-- /ko --> 
        
            <!-- ko if: type == 'Group' --> 
            <li>
                <h4 data-bind="text: text">Have you EVER suffered from, been diagnosed with or sought medical advice or treatment for:</h4>
            </li>
            <!-- /ko --> 
            <!-- ko if: type == 'YesNo' --><!-- /ko --> 
        
            <!-- ko if: type == 'Group' --><!-- /ko --> 
            <!-- ko if: type == 'YesNo' --> 
            <li>
                <span class="question-text group-question-label" data-bind="text: text, css: { 'invalid-question': !answer.isValid() }">Lung or Breathing conditions (other than childhood Asthma), Digestive conditions or Urinary conditions</span>
                <span data-bind="foreach: $parent.answerOptions">
                    <span data-bind="text: value">Yes</span><input name="4595" type="radio" value="Yes" data-bind="value: key, attr: { name: $parent.qid, 'data-qcode': $parent.qcode }, checked: $parent.answer, css: { 'readonly': $parent.readOnly }" data-qcode="DMEDI00Q2_1_BD">
                
                    <span data-bind="text: value">No</span><input name="4595" type="radio" value="No" data-bind="value: key, attr: { name: $parent.qid, 'data-qcode': $parent.qcode }, checked: $parent.answer, css: { 'readonly': $parent.readOnly }" data-qcode="DMEDI00Q2_1_BD">
                </span>
            </li>          
            <!-- /ko --> 
        
            <!-- ko if: type == 'Group' --><!-- /ko --> 
            <!-- ko if: type == 'YesNo' --> 
            <li>
                <span class="question-text group-question-label" data-bind="text: text, css: { 'invalid-question': !answer.isValid() }">Gynaecological conditions, or Pregnancy</span>
                <span data-bind="foreach: $parent.answerOptions">
                    <span data-bind="text: value">Yes</span><input name="5448" type="radio" value="Yes" data-bind="value: key, attr: { name: $parent.qid, 'data-qcode': $parent.qcode }, checked: $parent.answer, css: { 'readonly': $parent.readOnly }" data-qcode="DMEDI00Q2_8_BD">
                
                    <span data-bind="text: value">No</span><input name="5448" type="radio" value="No" data-bind="value: key, attr: { name: $parent.qid, 'data-qcode': $parent.qcode }, checked: $parent.answer, css: { 'readonly': $parent.readOnly }" data-qcode="DMEDI00Q2_8_BD">
                </span>
            </li>          
            <!-- /ko --> 
        
            <!-- ko if: type == 'Group' --><!-- /ko --> 
            <!-- ko if: type == 'YesNo' --> 
            <li>
                <span class="question-text group-question-label" data-bind="text: text, css: { 'invalid-question': !answer.isValid() }">Brain conditions, Nerve conditions, Recurrent Headaches, Migraines, Psychological or Emotional conditions</span>
                <span data-bind="foreach: $parent.answerOptions">
                    <span data-bind="text: value">Yes</span><input name="4597" type="radio" value="Yes" data-bind="value: key, attr: { name: $parent.qid, 'data-qcode': $parent.qcode }, checked: $parent.answer, css: { 'readonly': $parent.readOnly }" data-qcode="DMEDI00Q2_2_BD">
                
                    <span data-bind="text: value">No</span><input name="4597" type="radio" value="No" data-bind="value: key, attr: { name: $parent.qid, 'data-qcode': $parent.qcode }, checked: $parent.answer, css: { 'readonly': $parent.readOnly }" data-qcode="DMEDI00Q2_2_BD">
                </span>
            </li>          
            <!-- /ko --> 
        
            <!-- ko if: type == 'Group' --><!-- /ko --> 
            <!-- ko if: type == 'YesNo' --> 
            <li>
                <span class="question-text group-question-label" data-bind="text: text, css: { 'invalid-question': !answer.isValid() }">Cancer, Cysts, Growths, Polyps, Tumours or Thyroid conditions</span>
                <span data-bind="foreach: $parent.answerOptions">
                    <span data-bind="text: value">Yes</span><input name="4599" type="radio" value="Yes" data-bind="value: key, attr: { name: $parent.qid, 'data-qcode': $parent.qcode }, checked: $parent.answer, css: { 'readonly': $parent.readOnly }" data-qcode="DMEDI00Q2_3_BD">
                
                    <span data-bind="text: value">No</span><input name="4599" type="radio" value="No" data-bind="value: key, attr: { name: $parent.qid, 'data-qcode': $parent.qcode }, checked: $parent.answer, css: { 'readonly': $parent.readOnly }" data-qcode="DMEDI00Q2_3_BD">
                </span>
            </li>          
            <!-- /ko --> 
        
            <!-- ko if: type == 'Group' --><!-- /ko --> 
            <!-- ko if: type == 'YesNo' --> 
            <li>
                <span class="question-text group-question-label" data-bind="text: text, css: { 'invalid-question': !answer.isValid() }">Heart related conditions, Diabetes, Kidney, Gall Bladder, Pancreas or Liver conditions</span>
                <span data-bind="foreach: $parent.answerOptions">
                    <span data-bind="text: value">Yes</span><input name="4601" type="radio" value="Yes" data-bind="value: key, attr: { name: $parent.qid, 'data-qcode': $parent.qcode }, checked: $parent.answer, css: { 'readonly': $parent.readOnly }" data-qcode="DMEDI00Q2_4_BD">
                
                    <span data-bind="text: value">No</span><input name="4601" type="radio" value="No" data-bind="value: key, attr: { name: $parent.qid, 'data-qcode': $parent.qcode }, checked: $parent.answer, css: { 'readonly': $parent.readOnly }" data-qcode="DMEDI00Q2_4_BD">
                </span>
            </li>          
            <!-- /ko --> 
        
            <!-- ko if: type == 'Group' --><!-- /ko --> 
            <!-- ko if: type == 'YesNo' --> 
            <li>
                <span class="question-text group-question-label" data-bind="text: text, css: { 'invalid-question': !answer.isValid() }">Auto Immune Diseases or Blood conditions</span>
                <span data-bind="foreach: $parent.answerOptions">
                    <span data-bind="text: value">Yes</span><input name="4603" type="radio" value="Yes" data-bind="value: key, attr: { name: $parent.qid, 'data-qcode': $parent.qcode }, checked: $parent.answer, css: { 'readonly': $parent.readOnly }" data-qcode="DMEDI00Q2_5_BD">
                
                    <span data-bind="text: value">No</span><input name="4603" type="radio" value="No" data-bind="value: key, attr: { name: $parent.qid, 'data-qcode': $parent.qcode }, checked: $parent.answer, css: { 'readonly': $parent.readOnly }" data-qcode="DMEDI00Q2_5_BD">
                </span>
            </li>          
            <!-- /ko --> 
        
            <!-- ko if: type == 'Group' --><!-- /ko --> 
            <!-- ko if: type == 'YesNo' --> 
            <li>
                <span class="question-text group-question-label" data-bind="text: text, css: { 'invalid-question': !answer.isValid() }">Speech conditions, Eye conditions, Ear conditions or Non-Cancerous Skin conditions</span>
                <span data-bind="foreach: $parent.answerOptions">
                    <span data-bind="text: value">Yes</span><input name="4605" type="radio" value="Yes" data-bind="value: key, attr: { name: $parent.qid, 'data-qcode': $parent.qcode }, checked: $parent.answer, css: { 'readonly': $parent.readOnly }" data-qcode="DMEDI00Q2_6_BD">
                
                    <span data-bind="text: value">No</span><input name="4605" type="radio" value="No" data-bind="value: key, attr: { name: $parent.qid, 'data-qcode': $parent.qcode }, checked: $parent.answer, css: { 'readonly': $parent.readOnly }" data-qcode="DMEDI00Q2_6_BD">
                </span>
            </li>          
            <!-- /ko --> 
        
            <!-- ko if: type == 'Group' --><!-- /ko --> 
            <!-- ko if: type == 'YesNo' --> 
            <li>
                <span class="question-text group-question-label" data-bind="text: text, css: { 'invalid-question': !answer.isValid() }">Back, Neck or Knee complaint or any disorder of the Joints, Bones or Muscles (e.g. Gout, Arthritis)</span>
                <span data-bind="foreach: $parent.answerOptions">
                    <span data-bind="text: value">Yes</span><input name="4607" type="radio" value="Yes" data-bind="value: key, attr: { name: $parent.qid, 'data-qcode': $parent.qcode }, checked: $parent.answer, css: { 'readonly': $parent.readOnly }" data-qcode="DMEDI00Q2_7_BD">
                
                    <span data-bind="text: value">No</span><input name="4607" type="radio" value="No" data-bind="value: key, attr: { name: $parent.qid, 'data-qcode': $parent.qcode }, checked: $parent.answer, css: { 'readonly': $parent.readOnly }" data-qcode="DMEDI00Q2_7_BD">
                </span>
            </li>          
            <!-- /ko --> 
        </ol>
    </fieldset>
</article>
<nav class="nav">
    <a title="navigate next" class="standout button float-right" href="#" data-bind="event:{ click: navigateNext }">Next</a>
    <a title="navigate previous" class="button float-left" href="#" data-bind="event:{ click: navigatePrevious }">Previous</a>

</nav>
<aside>
    <div class="aside-container">
        <p class="field-validation-error" data-bind="validationMessage: isDataValid"></p>
        <div class="help-text" data-bind="html: helpText.selectedText"></div>
        <div class="aside-footer help-text" data-bind="html: helpText.footerText">For more information please refer to the Product Disclosure Statement which contains all of the details of cover plus terms and conditions of cover.</div>
    </div>
</aside>
                    
                        </div>
                    
                    </div>
                </section>
            </div>
            <footer>
                <div class="content-wrapper">
                    <div class="float-left">
                        © Hannover Life Re of Australasia Ltd
                    </div>
                </div>
            </footer>
        </div>

         


        <script type="text/javascript">
            maz.baseUrl = '/';
        </script>
        <script src="/Scripts/Lib/js?v=QPWEIV3aAl4mBKiTff9diiX6D5tUEZmRw2CZauQq2M41" type="text/javascript"></script>
       

        <script src="/Scripts/App/Views/group.js" type="text/javascript"></script>
<script src="/Scripts/App/ajaxLoader.js" type="text/javascript"></script>

        <script type="text/javascript">
            $(document).ready(function () {

                master.constructDecision();
                maz.utils.loadView(true);
            });
        </script>
        

    

<div tabindex="-1" class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable ui-resizable" role="dialog" aria-labelledby="ui-dialog-title-dvDecisionSummary" style="outline: 0px; display: none; position: absolute; z-index: 30000;"><div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix"><span class="ui-dialog-title" id="ui-dialog-title-dvDecisionSummary">&nbsp;</span><a class="ui-dialog-titlebar-close ui-corner-all" role="button" href="#"><span class="ui-icon ui-icon-closethick">close</span></a></div><div class="ui-dialog-content ui-widget-content" id="dvDecisionSummary"></div><div class="ui-resizable-handle ui-resizable-n"></div><div class="ui-resizable-handle ui-resizable-e"></div><div class="ui-resizable-handle ui-resizable-s"></div><div class="ui-resizable-handle ui-resizable-w"></div><div class="ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se ui-icon-grip-diagonal-se" style="z-index: 1001;"></div><div class="ui-resizable-handle ui-resizable-sw" style="z-index: 1002;"></div><div class="ui-resizable-handle ui-resizable-ne" style="z-index: 1003;"></div><div class="ui-resizable-handle ui-resizable-nw" style="z-index: 1004;"></div></div></body></html>

 

 

 

 

Elena
Telerik team
 answered on 28 Nov 2016
1 answer
266 views

Hi,

I have a combobox where I am trying to select an item by text, but it seems that I am not able to do so.

 

I have tried to use the following method

  • Find the combobox by automationId (which works): combo = app.MainWindow.Find.
                    ByAutomationId<ArtOfTest.WebAii.Controls.Xaml.Wpf.ComboBox>(comboBoxAutoId);
  • Use itemByText to select the item (which doesn´t work): combo.SelectItemByText(true, itemToSelect);

When I use combobox.selectItemByText("Text") I get a null reference exception.

 

The whole method:

public void selectItemFromComboBox(WpfApplication app, string comboBoxAutoId, string itemToSelect)
        {
            ArtOfTest.WebAii.Controls.Xaml.Wpf.ComboBox combo;
            Thread.Sleep(350);
            app.MainWindow.RefreshVisualTrees();
            combo = app.MainWindow.Find.
                ByAutomationId<ArtOfTest.WebAii.Controls.Xaml.Wpf.ComboBox>(comboBoxAutoId);
            combo.OpenDropDown(true);
             
            FrameworkElement indicator;
            for (int i = 0; i < 50; i++)
            {
                app.MainWindow.RefreshVisualTrees();
                Thread.Sleep(350);   
                indicator = app.MainWindow.Find.ByTextContent(itemToSelect);
                if (indicator != null)
                {
                    for (int j = 0; j < 50; j++)
                    {
                        Thread.Sleep(1000);
                        app.MainWindow.RefreshVisualTrees();
                        combo.Refresh();
                        combo.SelectItemByText(true, itemToSelect);
                        Debug.WriteLine("AAAAAA");
                        Thread.Sleep(500);
                        if (combo.Text.Equals(itemToSelect))
                        {
                            Thread.Sleep(350);
                            break;
                        }
                    }
                     
                }
                 
            }

Please note that I am using a framework element to ensure that the item is visible/not null.

The xaml of the combobox:

<ComboBox x:Name="cmbAttributeType"
          Grid.Row="0"
          Grid.Column="1"
          materialDesign:HintAssist.Hint="Select Type"
          Style="{StaticResource MaterialDesignFloatingHintComboBox}"
          ItemsSource="{Binding Path=AttributeTypesAvailable, ElementName=LevelAttributes}"
          SelectedItem="{Binding Path=SelectedAttributeType, ElementName=LevelAttributes}"
          IsEditable="True"
          IsReadOnly="True"
          Margin="3,0,0,0"
          AutomationProperties.AutomationId="Level_Att_Type_ComboBox"/>

 

 I tried doing this with a Framework element (opening the combobox and then clicking on the FWE), but every time I click on the FWE the comboboxlist closes and the comboboxitem is not selected. This is the same for clicking on a combobox item from an Ilist of the combobox.

Any help on this would be great.

Many thanks in advance,

David

Nikolay Petrov
Telerik team
 answered on 25 Nov 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?