locked
Creating Smoke Tests on Dynamics CRM using watin RRS feed

  • Question

  • When deleting a record there are two dialog boxes the first is the primary and then there is a secondary. Watin is having trouble with accessing the secondary dialog box. Anyone have any experience with programming against the second delete dialog box either during smoke testing or otherwise extending?

    Thanks!

    Anne

    Thursday, July 29, 2010 6:51 PM

Answers

  • Hi ,

    I am working on Smoke Tests using WatiN for Microsoft Dynamics CRM 4.0.

    I am trying to write Smoke Test for a particular Delete Case.

    When I hit delete button, it pulls up the web-page dialog with 3 options Delete, Deactivate or Cancel.

    This dialog I am able to access using WatiN command

    HtmlDialog firstDialog = ie.HtmlDialog(Find.ByTitle("Entity Delete Confirmation");

    firstDialog.Button(Find.ById("btnEntityDelete")).Click();

    After this a new dialog is opens up for Confirmation, this Dialog I am not able to access or Identify using similar above steps.

    HtmlDialog secondDialog = ie.HtmlDialog(Find.ByTitle("Confirm Deletion"));

    secondDialog.Button(Find.ById("confirmDelete")).Click();

    It is not able to find secondary delete dialog.

    At first, I even tried to find secondary dialog using,

     firstDialog.HtmlDialog(Find.ByTitle("Confirm Deletion"));

    But WatiN does not allow you to execute above command, then I tried downcast dialog to "IE" which gives you error of cannot convert WatiN.Core.HtmlDialog to WatiN.Core.IE.

    So the option of IE.firstDialog.secondDialog was ruled out.

    Then I tried to locate the title of secondary dialog under properties of mainWindow under quickwatch.

    Under quick watch for "ie" , the count of HtmlDialogs shows up only as 1 for primary dialog "Entity Delete Confirmation".

    Then I tried to find how actually list of HtmlDialogs is populated for mainWindow and opened up source code of WatiN. And there I could see list is been populated as

    ie.FindHtmlDialog(findBy);

    FindHtmlDialog looked something like  HtmlDialogs.first(findBy);

    Which I assumed as reason for not being able to find on secondary level as its finds only one directly associated with mainWindow, as secondary dialog is been pulled by Javascript being executed on firstDialog and not the mainWindow.

    I also tried using out of box dialog handlers as in ConfirmDialogHandler, AlertandConfirmDialogHandler, AlertDialogHandler, etc as the dialogs of CRM 4.0 do not match source code of these default ones.

    Please correct if my attempt to access secondary dialog is pulled by primary dialog was incorrect.

    I am definitely missing something.

    Thanks in advance, any help on this front is really appreciated.

    Sincerely,

    Ashish Harchwani

    • Marked as answer by Anne Stanton Wednesday, October 20, 2010 10:31 PM
    Thursday, July 29, 2010 7:17 PM

All replies

  • Hi ,

    I am working on Smoke Tests using WatiN for Microsoft Dynamics CRM 4.0.

    I am trying to write Smoke Test for a particular Delete Case.

    When I hit delete button, it pulls up the web-page dialog with 3 options Delete, Deactivate or Cancel.

    This dialog I am able to access using WatiN command

    HtmlDialog firstDialog = ie.HtmlDialog(Find.ByTitle("Entity Delete Confirmation");

    firstDialog.Button(Find.ById("btnEntityDelete")).Click();

    After this a new dialog is opens up for Confirmation, this Dialog I am not able to access or Identify using similar above steps.

    HtmlDialog secondDialog = ie.HtmlDialog(Find.ByTitle("Confirm Deletion"));

    secondDialog.Button(Find.ById("confirmDelete")).Click();

    It is not able to find secondary delete dialog.

    At first, I even tried to find secondary dialog using,

     firstDialog.HtmlDialog(Find.ByTitle("Confirm Deletion"));

    But WatiN does not allow you to execute above command, then I tried downcast dialog to "IE" which gives you error of cannot convert WatiN.Core.HtmlDialog to WatiN.Core.IE.

    So the option of IE.firstDialog.secondDialog was ruled out.

    Then I tried to locate the title of secondary dialog under properties of mainWindow under quickwatch.

    Under quick watch for "ie" , the count of HtmlDialogs shows up only as 1 for primary dialog "Entity Delete Confirmation".

    Then I tried to find how actually list of HtmlDialogs is populated for mainWindow and opened up source code of WatiN. And there I could see list is been populated as

    ie.FindHtmlDialog(findBy);

    FindHtmlDialog looked something like  HtmlDialogs.first(findBy);

    Which I assumed as reason for not being able to find on secondary level as its finds only one directly associated with mainWindow, as secondary dialog is been pulled by Javascript being executed on firstDialog and not the mainWindow.

    I also tried using out of box dialog handlers as in ConfirmDialogHandler, AlertandConfirmDialogHandler, AlertDialogHandler, etc as the dialogs of CRM 4.0 do not match source code of these default ones.

    Please correct if my attempt to access secondary dialog is pulled by primary dialog was incorrect.

    I am definitely missing something.

    Thanks in advance, any help on this front is really appreciated.

    Sincerely,

    Ashish Harchwani

    • Marked as answer by Anne Stanton Wednesday, October 20, 2010 10:31 PM
    Thursday, July 29, 2010 7:17 PM
  • Can u please share with me smoke test document for crm?
    Thursday, July 19, 2012 11:35 AM