Forum Discussion

rajeshthomas's avatar
rajeshthomas
Contributor
13 years ago

Can I develop a "Startup" screen to get input from user before testing

Hi All,



Before starting to test the important test cases, i added some test item to get the email address from the user to send test report ; after a while there was a necessary to get input from user to display the no. of iteration (count) set. So i need to popup another input box added after getting email ID. 



Now again there is a necessary to get the process type information from the user, so another input box. 



Is there is any way to develop a single screen (like VB) where i can get all input rather than giving input thrice and press OK for three message/input boxes.



Note: there is a possible that the message box may go up in future. So a "Startup Input screen" is mandatory rather necessary.

6 Replies

  • Hi ,



    Thanks...



    I got it and done it.



    One more assistance needed,





     Is it possible to remove the Close  button from the screen (X - at right top corner). Or any where i can set the form type in the properties.




  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)
    Hi Rajesh,



    Is it possible to remove the Close button from the screen (X - at right top corner).


    Yes, you can do this. You'll need to create the OnShow event handler for your form (see Handling Events in User Forms for steps). In the event handling routine, set the Sender.BorderIcons property to 0 or an empty string. For example:

    Sub UserForm1_OnShow(Sender)

      Sender.BorderIcons = 0

      ' -- or --

      Sender.BorderIcons = ""

    End Sub


    However, if you do this, make sure that you have added the close buttons to the form itself, otherwise, you'll end up with an unclosable form. For example, for the OK button, use TcxButton with the ModalResult property value of mrOk and the Default property set to True. For the Cancel button, you can use TcxButton with ModalResult of mrCancel and Cancel set to True.
  • Hi Helen,



    It is not working for me. adding the above said coding give back a exception error.



    Below is my coding to open startup screen. i call this function directly from my first test item. 





    -----------



    Sub Startup




      if project.testitems.Current.Iteration =< 1 Then


        userforms.Startup_Screen.itrtxt.Text= Project.TestItems.Current.Count


         


        userforms.Startup_Screen.process_type.Text = "x86"


        log.Message("Startup screen opens") 


        userforms.Startup_Screen.ShowModal


       


       Else


        Log.Message("Iteration No." &  project.testitems.Current.Iteration)


     End IF

     End Sub 


    -----
  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)
    Hi Rajesh,



    Sorry, there's an error in the event handler code that I posted above. Please use the following code:



    Sub UserForm1_OnShow(Sender)

      Sender.BorderIcons = ""

    End Sub



    Let me know whether this helps.