Hi,
We are using Telerik Test Studio 2017.1.207.0 and we implement custom DLL to launch or close our application.
Regularly, when calling the methods included in that code, the Test Freeze and nothing is done. I am putting the code below.
The problem concerns the call but not our code itself.
Currently the code is compiled in Debug / AnyCPU. Do you advise to compile that code in Debug or in Release mode ?
Is this problem known and is there a workaround ?
Is this problem fixed in latest version ?
Thanks in advance,
Best regards.
using System.Text;
using System.Threading.Tasks;
namespace Common
{
public class Utility
{
public static void StartCustomApp(Manager manager, ExecutionContext executionContext, string customAppPath, string args = "", int waitForWindow = 10000, int waitingTime = 10000)
{
Assert.IsNotNull(manager, $"Manager is null.");
manager.ActiveApplication.MainWindow.Window.Minimize();
manager.ActiveApplication.Detach(false);
var executablePath = executionContext.DeploymentDirectory + customAppPath;
Assert.IsTrue(File.Exists(executablePath), $"Can not found {customAppPath} path.");
var appName = Path.GetFileNameWithoutExtension(customAppPath);
// Prepare the process to run
ProcessStartInfo app = new ProcessStartInfo();
app.Arguments = args;
app.FileName = executablePath;
Assert.IsNotNull(manager.LaunchNewApplication(app), $"Failed to connect to {appName}.");
manager.ActiveApplication.WaitForWindow($"~{appName}", waitForWindow);
System.Threading.Thread.Sleep(waitingTime);
manager.ActiveApplication.MainWindow.SetWindowFocus();
manager.ActiveApplication.MainWindow.Window.Maximize();
manager.ActiveApplication.MainWindow.RefreshVisualTrees();
}
public static void connectToApp(Manager manager, string appName, bool closeAppOnDetach = false)
{
manager.Log.WriteLine(DateTime.Now.ToString()+" - Start connectToApp"+appName);
Assert.IsNotNull(manager, $"Manager is null.");
Assert.IsNotNull(manager.ActiveApplication, $"ActiveApplication is null.");
manager.Log.WriteLine(DateTime.Now.ToString() + " - detach previous App");
manager.ActiveApplication.Detach(closeAppOnDetach);
var proc = Process.GetProcesses().Where(p => p.ProcessName.Contains(appName)).FirstOrDefault();
Assert.IsNotNull(proc, $"{appName} is not running.");
manager.Log.WriteLine(DateTime.Now.ToString() + " - connect to App " + appName);
Assert.IsNotNull(manager.ConnectToApplication(proc), $"Failed to connect to {appName}.");
manager.ActiveApplication.MainWindow.Window.SetFocus();
manager.ActiveApplication.MainWindow.Window.SetActive();
manager.ActiveApplication.MainWindow.Window.Maximize();
manager.ActiveApplication.MainWindow.RefreshVisualTrees();
}
public static void CloseApp(string appName)
{
var runningApp = System.Diagnostics.Process.GetProcesses().Where(p => p.ProcessName.Contains(appName));
string executablePath = string.Empty;
if (runningApp.Count() > 0)
{
foreach (var process in runningApp)
process.Kill();
}
}
}
}
Hi,
We bought few years ago the Tekerik Test Studio 2017.1.207.0.
When we run tests, and application windows or popup are closed, we frequently have the message :
Failure Information:
~~~~~~~~~~~~~~~
Collection was modified; enumeration operation may not execute.
InnerException:
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
at System.Collections.Generic.List`1.Enumerator.MoveNext()
at System.Linq.Enumerable.LastOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
at ArtOfTest.WebAii.Core.Manager.get_ActiveWpfWindow()
at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteStep(Int32 order)
We tried to add a wait command after the close but it does not succeeded.
Is there a workaround to bypass this bug ?
Is this bug fixed in latest version ?
Thanks in advance,
Best regards.

I am trying to open our web site which is located abroad so there is a considerable delay between request and response. Sometimes it takes up to 10-15 seconds to load the page and while waiting for it Test studio is throwing the following error (but after all it loads the page though):
'30/04/2021 14:46:42' - 'Fail' : 6. Navigate to : eHarmony by NavigateURL variable
------------------------------------------------------------
Failure Information:
~~~~~~~~~~~~~~~
Exception thrown executing coded step: 'Navigate to : eHarmony by NavigateURL variable'.
InnerException:
System.TimeoutException: Wait for condition has timed out
at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo, Object target)
at ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout, WaitResultType errorResultType)
at ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout)
at ArtOfTest.WebAii.Core.Browser.WaitUntilReady()
at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request, Boolean performDomRefresh, Boolean waitUntilReady)
at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request)
at ArtOfTest.WebAii.Core.Browser.InternalNavigateTo(Uri uri, Boolean useDecodedUrl)
at ArtOfTest.WebAii.Core.Browser.NavigateTo(Uri uri, Boolean useDecodedUrl)
at ArtOfTest.WebAii.Core.Browser.NavigateTo(String url, Boolean useDecodedUrl)
at UpdateIdkynScreenFull.YN_GeneralManagerLoginProduction.YN_General_Manager_Login__CodedStep2() in c:\Automate\ATP%20Sources\eHarmonySecurity11\Logins\YN- General Manager Login .tstest.cs:line 111
------------------------------------------------------------
Has someone faced this issue and how could you handle this, please? I know that I can put "continue on failure"=true, but then the overall result of the test will be shown as failed

Hi Team,
I am getting error while executing Rest API for authentication. This works fine on fiddler but does not work on Telerik Test studio API. Please help!
I have attached a code and screenshot.
Error:
'The request was aborted: The request was canceled.'
Thank you so much in advance.

Hi,
I am new to Telerik Test Studio.
I am trying to figure out how to find a label if it's pseudo element ::before or ::after contains specific CSS class (.custom-control-input:checked).
Please see the screenshot attached.
If I locate required element as below:
var label = div.Find.ByAttributes<HtmlControl>("class=~custom-control-label");
I can't find the way to examine its pseudo elements. There is no trace of .custom-control-input:checked
Please advise

Hello,
Recently I get this error when filling in something in a textbox in chrome. Does anybody have a glue why and how to solve this.
ExecuteCommand failed!
InError set by the client. Client Error:
Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src https: 'unsafe-inline'".
BrowserCommand (Type:'Action',Info:'NotSet',Action:'InvokeJsFunction',Target:'ElementId (tagName: '',occurrenceIndex: '-1')',Data:'document.getElementsByTagName('input')[0].focus()',ClientId:'e0aa945a-25fb-49b3-83a5-e4b7da4f60bb',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src https: 'unsafe-inline'".
')
InnerException: none.
Thanks
Bjorn

Is it possible to make a custom coded testing step that iterates the current webpage DOM, finds all of the date fields and types in a date?
I am a C# coder but not that familiar with the object model of test studio so I could use a little starter code.
Thanks!

Hi Guys,
I am getting this error when I run convert recorded steps to Code.
Please refer video.
Code :
Actions.SetText(Pages.Time2Work.TbUsernameEmail, "AutoCycle");
Failure Information:

Hi,
I have a question related to running a specific test case in the test list to run on a specific browser.
Intro:
I have two test cases.
A) Loads the Google.ca website.
B) Loads the DuckDuckGo.com website.
-----------------------------------------------------------------------------------------------------------------------
Expectation.
I want to add both of them to the Test List and would like testcase A to be executed on Chrome and IE (both) but testcase B to be executed only on IE.
-----------------------------------------------------------------------------------------------------------------------
Current Configuration:
Under Projects:
Test Case A --> Properties "BrowserType" --> NotSet
Test Case B --> Properties "BrowserType" -->InternetExplorer
TestLists --> Properties, "Browser" --> NotSet; "ExecutingBrowsers" --> IE, and Chrome
-------------------------------------------------------------------------------------------------------------------
With my current Config, Test Studio does the following
Open IE --> Run testcase A and B,
then Open Chrome --> Run testcase A, Opens IE (Again) --> Runs testcase B
Thus, I am looking a way to tell Test Studio, that if the browser does not match then please ignore the testcase in the testlist.
Please let me know if this is achievable.
Thanks,
RG.

Hello,
I try to associate a test created in Telerik Test Studio project to TFS test case but I get the error (on the picture)
Microsoft Visual Studio Professional 2019
Version 16.9.3
Test Studio version 2020.2.804.0
How can I fix the problem?
