Scenario 1:
Given main window (a window with only 1 button "Execute")
When click "Execute"
Then main window display "Hello, World"
Scenario 2:
Given main window (a window with only 1 button "Execute")
When click "Execute" (it will call domainFunc.Execute method, and inside the method it will pop up a messageBox. DomainFunc locates in BL)
And click "Yes" button (the domainFunc.Execute will proceed to next statement)
Then main window display "Hello, World"
I know how to write an automate test for scenario 1, but have no idea for scenario 2. The difficult part of scenario 2 is that I don't know how to gain control of the messageBox to automate its clicking event and proceed the test.
Anyone has any idea?