Advertisement
Guest User

Untitled

a guest
Aug 27th, 2014
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. Playback.PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.Disabled;
  2.  
  3. Playback.PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.UIThreadOnly;
  4.  
  5. /// <summary> A class containing Coded UI Tests. </summary>
  6. [CodedUITest]
  7. public class UI_Tests
  8. {
  9. /// <summary> Common initialization for all of the tests in this class. </summary>
  10. [TestInitialize]
  11. public void TestInit()
  12. {
  13. // Call a common routine to set up the test
  14. MyCodedUITests.StartTest();
  15. }
  16.  
  17. /// <summary> Some test. </summary>
  18. [TestMethod]
  19. public void SomeTest()
  20. {
  21. this.UIMap.Assert_HomePageElements();
  22. this.UIMap.Recorded_DoSomething();
  23. this.UIMap.Assert_FinalPageElements();
  24. }
  25. }
  26.  
  27.  
  28. /// <summary> Coded UI Test support routines. </summary>
  29. class MyCodedUITests
  30. {
  31. /// <summary> Test startup. </summary>
  32. public static void StartTest()
  33. {
  34. // Configure the playback engine
  35. Playback.PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.Disabled;
  36. Playback.PlaybackSettings.MaximumRetryCount = 10;
  37. Playback.PlaybackSettings.ShouldSearchFailFast = false;
  38. Playback.PlaybackSettings.DelayBetweenActions = 500;
  39. Playback.PlaybackSettings.SearchTimeout = 1000;
  40.  
  41. // Add the error handler
  42. Playback.PlaybackError -= Playback_PlaybackError; // Remove the handler if it's already added
  43. Playback.PlaybackError += Playback_PlaybackError; // Ta dah...
  44. }
  45.  
  46. /// <summary> PlaybackError event handler. </summary>
  47. private static void Playback_PlaybackError(object sender, PlaybackErrorEventArgs e)
  48. {
  49. // Wait a second
  50. System.Threading.Thread.Sleep(1000);
  51.  
  52. // Retry the failed test operation
  53. e.Result = PlaybackErrorOptions.Retry;
  54. }
  55. }
  56.  
  57. Name EqualsTo “Sales order‬ (‎‪1‬ - ‎‪ceu‬)‎‪ - ‎‪‪‪Sales order‬: ‎‪SO-101375‬‬, ‎‪‪Forest Wholesales”
  58.  
  59. Name Contains “Sales order‬ (‎‪1‬ - ‎‪ceu‬)‎‪ - ‎‪‪‪Sales order‬: ‎‪SO”
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement