Telerik recorder vs System Windows Dialog box

7 posts, 0 answers
  1. Mark
    Mark avatar
    27 posts
    Member since:
    Nov 2011

    Posted 14 Jan 2013 Link to this post

    Hi All,

    It seems that the telerik recorder doesn't recognize the windows dialog.
    In the code:
    System.Windows.Forms.OpenFileDialog
    openFileDialog = new System.Windows.Forms.OpenFileDialog();

    It's pretty annoying to be stuck in a test case capture just because of that.
    For example, in my test case, I would like to delete a file and a windows dialog box ask for a confirmation and I can't click yes or no as Telerik doesn't recognize it.
    Do you have any ideas to solve this issue?

    Thanks in advance for your help.
  2. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 17 Jan 2013 Link to this post

    Hello Mark,

    I am sorry to hear you are experiencing this issue.
    From your explanation it seems more like unexpected dialog rather than OpenFileDialog. Could you please try to use this code instead:

    this.Manager.Settings.UnexpectedDialogAction = UnexpectedDialogAction.HandleAndContinue;

    If you continue experiencing this issue please provide more information like screen shots or short video demonstrating this behavior. The best scenario here will be if you can provide us with access to the application you are testing so we can take a look.

    Regards,
    Ivaylo
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  3. Mark
    Mark avatar
    27 posts
    Member since:
    Nov 2011

    Posted 18 Jan 2013 Link to this post

    Hi Ivaylo,
    Thanks for trying to help me.
    Could you please tell me how can I add this piece of code?
    Actually, I didn't have to add any code since I've started with Telerik.
    I know I can customize a step in the code but it seems I can't add your piece of code like that.
    Thanks again for your assistance.
  4. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 22 Jan 2013 Link to this post

    Hello Mark,

    Please check the following article in order to proceed with adding a custom coded step to your test. Please refer to the first method explained.

    Kind regards,
    Ivaylo
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  5. Mark
    Mark avatar
    27 posts
    Member since:
    Nov 2011

    Posted 22 Jan 2013 Link to this post

    Thanks a lot Ivaylo for your support. Now it works :)
  6. GREGORY
    GREGORY avatar
    2 posts
    Member since:
    May 2011

    Posted 16 Apr 2013 Link to this post

    I am having a similar issue.  In my case however, interaction with the Windows form is required to commit the action being tested to the database (Confirm/Delete a file upload).  The UnhandledDialog code you provided will cause the test script to not "error", but it will not give me "access" to automate the Confirm button click on the Windows form which pops-up.  Is there a way around this?  Thanks so much!

  7. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 18 Apr 2013 Link to this post

    Hello Gregory,

    You can try to workaround this behavior by pressing Enter key since it seems the Confirm button is active. In order to proceed you can add the following code right after this window appears:

    Manager.Desktop.KeyBoard.KeyPress(Keys.Enter);

    Please note that you might need to add an assembly reference to System.Windows.Forms as
    demonstrated in this video. And you should add the following line as well:

    using System.Windows.Forms;

    Kind regards,
    Ivaylo
    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!