Results 1 to 5 of 5
  1. #1

    Unable to record an item in drop down box


    Iam encountering problems with two issues in my script, 1) unable to recognize activex component 2) system date.
    I have drop down boxes in my application which are activex components and I need to select one of the options from the drop down box after I clicking the down arrow. When I recorded in regular mode QTP couldn't record any thing, but it is able to record until clicking the down arrow mark when I recorded in Low lwevel recording mode. And it couldn't record hte option I have selected from the drop down box. I tried to insert a standard check point by recording so that I can make any modifications to the statement to select the option, but it couldn't record at all. I tried to insert the object in Object Repository by Add Object option in Object Repository. The object couldn't be added. When I spied it for its properties, QTP recognizing that object as:
    WinObject("SSChildDrop Down")
    Do any one face this problem in selecting an item from a drop down box?
    2)Iam trying to set system date for the date objects which has the format mm/dd/yyyy;
    when I say Window.(...).......Type Date
    QTP is writing system date as 2/17/2005 but I like to have the system date in the format 02/17/2005.
    I tried with vbGeneralDate and also tried to convert date into the above format by using CDate, none of the trials helped me out.

    Any suggestions/input on above issues are greatley appreciated.


  2. #2

    Re: Unable to record an item in drop down box

    Hi shika,
    I downloaded this from the MI knowledge base.. Hope this helps
    I like what i know and I know what i like

  3. #3

    Re: Unable to record an item in drop down box

    As for issue #1, I haven't run into that yet since I started using QTP, but I've run into it with WinRunner and Robot - the process is similar but I cannot detail it having no QTP experience with it. It sounds like you need to map the activex control to a known object type. In your Tools menu in QTP there is an Object Identification tool. That should get you started, hopefully there is enough info in the helpfiles to guide you through the tool.

    As for issue #2, QTP has a FormatDateTime function that formats according to your system settings. Open your windows control panel and then open Regional and Language Options. Click Customize and select the date tab. Your short date setting is probably "M/d/yyyy" - change it to "MM/dd/yyyy" and save. Once you've done that, your QTP FormatDateTime function will format according to that date-mask you created in the windows settings.

    GetCurrentDate = FormatDateTime(Date, vbShortDate)

    If you don't want to change windows settings, you could always force the date format with a set of If..Then constructs using the Day(), Month(), and Year() functions and building a string from those functions that will add the leading zero if a day or month < 10.


  4. #4

    Re: Unable to record an item in drop down box

    try adding the object without recording through OR (add object)

    see if it does anythign diff

  5. #5

    Re: Unable to record an item in drop down box

    Thanks Maxj and Walker for your inputs.
    Walker, Actually, I'm not looking to set date format through contol panel since we run the script on multiple machines. Thanks for your suggestion of Day()....methods, I got it resolved by using Day(), Month() and Year() methods in If then loop.
    But still I am struggling with the first issue. Though QTP is recognising the Listbox/Combobox/Dropdown window it is unable to record the selected option. Is there any way to set the value I want to this object rather selecting from the drop down box.
    My code is as follows:

    Edit text object which contains down arrow mark and clicking on the down arrow mark is
    Window("xxx").Window("xxx").WinObject(AfxoleContro l42").Click 94,11

    Drop down window, clicking on the selected item:
    Window ("SSDropdownframe").WinObject("SSChildDropdown").C lick 98,66

    Though it could opens the drop down window, it couldn't click /select the option and so retreiving an empty edit box.

    I really appreciate if some body give me a clue on this.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 05:55 PM.

Copyright BetaSoft Inc.