This is a migrated thread and some comments may be shown as answers.

Facing NullReference Exception on Selecting First Item from Combox when Using SelectItemByText

6 Answers 73 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
N1t1nA
Top achievements
Rank 1
N1t1nA asked on 16 Apr 2012, 01:18 PM
Hi Support 

I am Facing "Object reference not set to an instance of an object." Error when I SelectItemByText

I am using the Code as

 //Wait for OrderSearch dropdown Exists in DOM
Pages.Application.SilverlightApp.OrderDataSearchComboBox.Wait.ForExists(timeout);
            
 //Select the orderType from the ComboBox           
Pages.Application.SilverlightApp.OrderDataSearchComboBox.SelectItemByText(true, orderType,true);

I am Passing the orderType as Parameter in the Method and
orderType picks the Value from the Combobox

Note: Combobox Fist Value is: Purchase Orders 
and Second Value is :Goods Receipts

Code is Executed Successfully when I pass the Second Value i.e Goods Receipt but it throws Null Reference Exception when I Pass the First Value i.e. Purchase Orders, 
Please Clarify Is this a Bug ? 


6 Answers, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 16 Apr 2012, 01:22 PM
Hi Nitin,

It sounds like you've hit the problem described here. This one has been resolved with the 2012 R1 version we published last week. Please upgrade and let us know if you need further assistance.

All the best,
Konstantin Petkov
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
N1t1nA
Top achievements
Rank 1
answered on 16 Apr 2012, 01:27 PM
Hi Konstantin Petkov

Thanks for the Quick Reply, I will Upgrade my Test Studio Version and let you know

Regards
-Nitin-
0
N1t1nA
Top achievements
Rank 1
answered on 21 May 2012, 10:16 AM
Hi Konstantin Petkov

I have Upgraded my Test Studio to Latest Version, But Still I am Facing the Issue


//Select the orderType from the ComboBox
Pages.Application.SilverlightApp.OrderDataSearchComboBox.SelectItemByText(true, orderType,true);

This Line of Code Just open the Dropdown, and First Value is Selected by Default, but it is Not closing the Dropdown, I am Using in Silverllight

Please help, Here my Script is Stuck

Regards
Nitin

0
Konstantin Petkov
Telerik team
answered on 21 May 2012, 11:11 AM
Hi Nitin,

This sounds like another problem and we will need more data to analyze it. Can you please take a look at this issue shared publicly? If that's the same you experience (note, it's specific to RadComboBox for Silverlight) we have a solution implemented in the latest internal build (labeled 2012.1.518 available for download from your account). If that's not the case we will need a test case replicating the problem we can run locally and will get back to you with our findings.

Kind regards,
Konstantin Petkov
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
N1t1nA
Top achievements
Rank 1
answered on 21 May 2012, 12:24 PM
Hi Konstantin Petkov

This is Not the Issue, When My Code Executed it Just Open the dropdown and does Not select the First Value and Not Close it (like real action)

as per defination of SelectItemByText(true,orderType,true); this Should Open the Dropdown and Select the Text, and Close the ComboBox
My Requirement is to Select the First Item in Combobox (and its Failing) by this Code.

Pages.Application.SilverlightApp.OrderDataSearchComboBox.SelectItemByText(true, orderType,true);

This is the Type of Control

public ArtOfTest.WebAii.Silverlight.UI.ComboBox OrderDataSearchComboBox

get

{       

return Get<ArtOfTest.WebAii.Silverlight.UI.ComboBox>("AutomationId=OrderDataSearchComboBox", "XamlTag=combobox");

}


This Code for SelectItemByText is SuccessFully Executed if Second Item needs to be Selected.

You can Schedule a Meeting to see the Real Problem as we Dont have Public URL.
Regards
Nitin
0
Plamen
Telerik team
answered on 22 May 2012, 10:57 AM
Hi Nitin,

Thank you for the detailed information on the issue. I was able to reproduce it against a public site and confirm it as a bug. You can track the PITS item and vote for it here: Public URL.

In the meantime as a workaround you can select the item by index or record a Left Mouse Click on the ComboBoxItem element. You can do that from the Mouse Actions option in the Elements Menu, however you need to record the "Open drop down" step first. See this video for more information.

I've updated your Telerik points for bringing this to our attention.

Kind regards,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
N1t1nA
Top achievements
Rank 1
Answers by
Konstantin Petkov
Telerik team
N1t1nA
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or