Forum Discussion

sowmya_bs's avatar
sowmya_bs
Contributor
15 years ago

'File' object type with Browse button - Not able to click on Browse button

Hi.

i am creating a automation script with testcomplete to automate the file upload functionality in our application. But i could find a text box with a Browse button next to it. When i tried to fetch the Browse button object i could notice it gets identified as a 'File' object which includes the text box. it does not show up any child objects. But i have to click on the Browse button, which i am not able to find it. Can anyone please help on this. Solutions on this as soon as possible will be appriciated.





-Thanks

Sowmya BS

3 Replies


  • Hi Sowmya,





    Try using the code below to click the button:



      Set wUpload = ' ... obtain the control

      Call wUpload.Click(wUpload.Width - wUpload.Height / 2, wUpload.Height /2)

  • Hey Thanks, It worked.

    But i had an alternative solution with the code lines.


    Set BrowseBtnObject = ... Get the object..

    BrowseBtnObject.Click     'This will set the cursor on the text box

    BrowseBtnObject.Keys("[Tab] ")   'This will press the space bar after the focus is changed to Browse button



    But i am curious to know why i was not able to get the browse button object uniquely!! Any answers for these would help in further scripting knowledge.



    -Thanks

    Sowmya BS

  • Hi Sowmya,


    TestComplete cannot recognize the button as an individual object because the control doesn't have special support for this control.


    BTW, I have registered a suggestion to implement special support for the control. Thanks.