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

7 posts, 0 answers
  1. N1t1nA
    N1t1nA avatar
    37 posts
    Member since:
    Mar 2011

    Posted 16 Apr 2012 Link to this post

    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 ? 


  2. Konstantin Petkov
    Admin
    Konstantin Petkov avatar
    1911 posts

    Posted 16 Apr 2012 Link to this post

    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
  3. N1t1nA
    N1t1nA avatar
    37 posts
    Member since:
    Mar 2011

    Posted 16 Apr 2012 Link to this post

    Hi Konstantin Petkov

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

    Regards
    -Nitin-
  4. N1t1nA
    N1t1nA avatar
    37 posts
    Member since:
    Mar 2011

    Posted 21 May 2012 Link to this post

    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

  5. Konstantin Petkov
    Admin
    Konstantin Petkov avatar
    1911 posts

    Posted 21 May 2012 Link to this post

    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
  6. N1t1nA
    N1t1nA avatar
    37 posts
    Member since:
    Mar 2011

    Posted 21 May 2012 Link to this post

    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
  7. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 22 May 2012 Link to this post

    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
Back to Top
  Cast Your Vote at DevPro Connections! Cast Your Vote at  Win IT Pro Connections!