Telerik Forums
Test Studio Forum
1 answer
311 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
3 answers
49 views

Hello

Our application raises two pop ups upon close action 

First is a save changes confirmation which test studio can handle but after that an internet explorer dialog raises and asks are you sure you want to leave this page in a windows dialog.

I cant manage to handle this problem and it makes internet explorers stack and blocks our test list executions

I am open to every work around if you guys have an idea :)

Thanks in Advance

Elena
Telerik team
 answered on 23 Nov 2016
1 answer
67 views

I have a varriable a with contains the value .I need to click on the link having the value of the varriable. Example on screen has a lick as <id-217>. i have captured the same  in a varriable.i need to click the same  .

Please help

Nikolay Petrov
Telerik team
 answered on 23 Nov 2016
1 answer
68 views

I would like to know if the ordered list can be assigned to the HtmlUnorderedList object. If it cannot be assigned is there a way to handle the ordered list.

Nikolay Petrov
Telerik team
 answered on 23 Nov 2016
3 answers
114 views

Hi,

I need the Project Path to create log files in respective folder. I am able to get the Project Path in non-static class/functions using "this.ExecutionContext.DeploymentDirectory;". However; when I try same in static classes/functions it gives error like "Keyword 'this' is not valid in a static property, static method, or static field initializer" which is valid as we cannot do that.

Is there any other way I can use get DeploymentDirectory in static class/function?

Thanks,

Chandresh Parmar

Nikolay Petrov
Telerik team
 answered on 23 Nov 2016
9 answers
127 views
Hi,

We have an issue where when you drag an item in internet explore to another area in the same window the window is automatically resizing to a smaller size.

We have set the window to open at 1280x1024 when the test runs and would like it to remain this size for the duration of the test.

Is there a way we could prevent the window from resizing automatically as this is causing our tests to fail as the target area is no longer on screen when the window resizes.

This is using Silverlight.

Thanks in advance for your help

Kev
Boyan Boev
Telerik team
 answered on 22 Nov 2016
5 answers
2.5K+ views
Hi,
I'm seeing this "you are using unsupported command line flag --disable web security" error message in Chrome (Version 46.0.2490.86 m)​, which appears to be coming from Test Studio plugins, as I don't see it when those are disabled.
Is there a way to get rid of that error message?
Thanks,
Nikolay Petrov
Telerik team
 answered on 21 Nov 2016
1 answer
67 views

Hi,

I am testing an on a web application which Create a Purchase Order. I have successfully recorded a test which login, adds some value to the Purchase Order, complete the Purchase Order and logout.

I can re-run that test perfectly.  The browser spins up and I see the various steps occur and then I see the new order under Purchase Order

I have now used that test for a Load Test but I am not getting what I expected, and I think perhaps what I need and what's being provided are not the same.  I need to simulate 10 concurrent users processing that Purchase Order. I need that test run in 10 separate threads in one go.  What I get though is no browsers popping up and no new sales being created in the database.

There is no indication of failure, but nothing seems to be "happening"

So, can someone explain if what I expect of Load Test and what it does are actually not the same?  I would have expected 10 new Purchase Order in the database, but what I get instead is nothing.  The "steps" appear to have been reduced to a series of HTTP requests of traffic.

Please help

Kind regards,
Shawn

Elena
Telerik team
 answered on 18 Nov 2016
26 answers
526 views

Hi,

 

I’m using trail version of QA edition Q3 release. I want to know is there any feature which will helps me writing data to excel sheet?

More clear; in my Silverlight web application I created some data, I want to store that data in excel spread sheet using this Web UI QA tool.

 

Help is appreciated.

 

Thanks & Regards,

 

Madhu Tekmal

Elena
Telerik team
 answered on 17 Nov 2016
34 answers
343 views
We recently upgraded our test studio project and run time edition to the most recent version.  Our builds are now failing with the following error.

c:\Windows\Microsoft.NET\assembly\GAC_MSIL\ArtOfTest.WebAii.Design\v4.0_2013.1.806.0__4fc62bbc3827ab1d\ArtOfTest.WebAii.Design.dll: Assembly 'ArtOfTest.WebAii.Design, Version=2013.1.806.0, Culture=neutral, PublicKeyToken=4fc62bbc3827ab1d' uses 'ArtOfTest.WebAii, Version=2013.1.806.0, Culture=neutral, PublicKeyToken=4fd5f65be123776c' which has a higher version than referenced assembly 'ArtOfTest.WebAii, Version=2012.2.1420.0, Culture=neutral, PublicKeyToken=4fd5f65be123776c'

Where is this conflicting reference coming from?  We have done searches for this reference to see if there are any old files somewhere but do not see any.  Has anyone else encountered this issue?

Thanks

*****UPDATE*****
It seems that creating a brand new project/solution picks up the correct references and we were able to see our tests run against the agent.  This seems to be a work-around, and not the solution.  Still looking into a possible solution.
*********************
Elena
Telerik team
 answered on 17 Nov 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?