Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Playback.PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.Disabled;
- Playback.PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.UIThreadOnly;
- /// <summary> A class containing Coded UI Tests. </summary>
- [CodedUITest]
- public class UI_Tests
- {
- /// <summary> Common initialization for all of the tests in this class. </summary>
- [TestInitialize]
- public void TestInit()
- {
- // Call a common routine to set up the test
- MyCodedUITests.StartTest();
- }
- /// <summary> Some test. </summary>
- [TestMethod]
- public void SomeTest()
- {
- this.UIMap.Assert_HomePageElements();
- this.UIMap.Recorded_DoSomething();
- this.UIMap.Assert_FinalPageElements();
- }
- }
- /// <summary> Coded UI Test support routines. </summary>
- class MyCodedUITests
- {
- /// <summary> Test startup. </summary>
- public static void StartTest()
- {
- // Configure the playback engine
- Playback.PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.Disabled;
- Playback.PlaybackSettings.MaximumRetryCount = 10;
- Playback.PlaybackSettings.ShouldSearchFailFast = false;
- Playback.PlaybackSettings.DelayBetweenActions = 500;
- Playback.PlaybackSettings.SearchTimeout = 1000;
- // Add the error handler
- Playback.PlaybackError -= Playback_PlaybackError; // Remove the handler if it's already added
- Playback.PlaybackError += Playback_PlaybackError; // Ta dah...
- }
- /// <summary> PlaybackError event handler. </summary>
- private static void Playback_PlaybackError(object sender, PlaybackErrorEventArgs e)
- {
- // Wait a second
- System.Threading.Thread.Sleep(1000);
- // Retry the failed test operation
- e.Result = PlaybackErrorOptions.Retry;
- }
- }
- Name EqualsTo “Sales order (1 - ceu) - Sales order: SO-101375, Forest Wholesales”
- Name Contains “Sales order (1 - ceu) - Sales order: SO”
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement