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
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
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
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
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.
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
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
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