1

I am working on Visual Studio Environment with Selenium and CodedUI together. while i am trying to build a Unit Test with those Infrastructures i am getting an exception that i could not handle.

An exception of type 'System.ArgumentException' occurred in Microsoft.VisualStudio.TestTools.UITesting.dll but was not handled in user code

Additional information: Invalid value for parameter. Value: -1. Parameter: SearchTimeout.

here is part of the source code that i am running:

Playback.PlaybackSettings.WaitForReadyLevel = WaitForReadyLevel.Disabled;
BossHome.FindScreen.UserNameField = username;
BossHome.FindScreen.Serch();
Thread.Sleep(5000);
BossHome.RelatedAccounts.closeRelatedAccountWindow();
BossHome.AccountsTab.MoveToManualDepositWindow();
Thread.Sleep(10000);                       
Mouse.Click(this.UIMap.UIItem702553427MultiInWindow.UIItem702553427MultiInDocument10.UIGrantBonusMainIframeFrame1.UIHttpsbossmiragebackoDocument.UIMy_frameFrame.UIItem888comCashierDocument.UIItem100Pane);
            Mouse.Click(this.UIMap.UIItem702553427MultiInWindow.UIItem702553427MultiInDocument10.UIGrantBonusMainIframeFrame1.UIHttpsbossmiragebackoDocument.UIMy_frameFrame.UIItem888comCashierDocument.UIEntercardnumberEdit);
            Keyboard.SendKeys(this.UIMap.UIItem702553427MultiInWindow.UIItem702553427MultiInDocument10.UIGrantBonusMainIframeFrame1.UIHttpsbossmiragebackoDocument.UIMy_frameFrame.UIItem888comCashierDocument.UIEntercardnumberEdit, "nadavb");

Thanks, nadav

2
  • Why do you use WaitForReadyLevel.Disabled? If the control isn't loaded and available when you Mouse.Click, the search won't find anything and may time out. I see you use a thread.Sleep to work around this, but this isn't robust. I'd suggest using the default WaitForReadyLevel (UiThreadOnly I believe). Mar 7, 2016 at 10:48
  • thx, your answer helped me! Nov 14, 2016 at 12:58

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.