Telerik Forums
Testing Framework Forum
1 answer
27 views

Hi Team,

Our test application use java script navigator.clipboard.writetext  to copy content into clipboard, when we run cases with telerik 2024, some scenario pops error "fail to copy", the exception for java script is "NotAllowedError: Failed to execute 'writeText' on 'Clipboard': Write permission denied.".

After check, we can see it's because clipboard-write is denied when telerik open browser, but if we manually open the browser, it's fine. Only failed for browser which is opened by telerik.

You can use below example code to check in browsers which is opened by telerik.

test code:

// Initialize the settings

mySettings = new Settings();

// Set the default browser

mySettings.Web.DefaultBrowser = BrowserType.Chrome;  // we can change the two lines for different scenario test

mySettings.Web.UseBrowserExtension = false;

myManager = new Manager(mySettings);

// Start the manager

myManager.Start();

// Launch a new browser instance. [This will launch an IE instance given the setting above]

myManager.LaunchNewBrowser();

myManager.ActiveBrowser.NavigateTo("https://www.telerik.com");

when the browser is opened, you can execute below script in develop tools.

await navigator.permissions.query({

        name: 'clipboard-write',

    });

Below is what I have summary for telerik 2024 and 2022, please help to confirm if all the the denied scenarios are expected.

Thanks,

Jun

Elena
Telerik team
 answered on 22 Oct 2024
1 answer
26 views

Hi,

I've created a simple test for a WPF application that clicks a button in my main window to open another window and then clicks a button in this window. Half of the time the test executes as expected, half of the time it fails, because the window was not found. I added a delay before clicking the second button to make sure, that the window is fully loaded. The title of the window is always the same.

I've tried to create a test like this for another window, but there I have the same issue.

Why is the Test Studio not able to find the window and is there anything I can do to fix this? 

 

This are the logs:

Overall Result: Fail
------------------------------------------------------------
'09.10.2024 11:40:43' - Executing test: '10 - Storage Overview', path: 'Overviews\10 - Storage Overview.tstest.'
'09.10.2024 11:40:43' - Using .Net Runtime version: '4.0.30319.42000' for test execution. Build version is '2024.3.813.1'.
'09.10.2024 11:40:43' - Starting execution....
'09.10.2024 11:40:47' - Detected custom code in test. Locating test assembly: 3S_Tests.dll.
'09.10.2024 11:40:47' - Assembly Found: C:\TestStudio\3S_Tests\bin\3S_Tests.dll
'09.10.2024 11:40:47' - Loading code class: '_S_Tests._0___Storage_Overview'.
------------------------------------------------------------
------------------------------------------------------------
'09.10.2024 11:40:47' - Using 'C:\MLM Apps\3S Debug\ProbenverwaltungV3.exe' application.
'09.10.2024 11:40:57' - 'Pass' : 1. Click BtGenerelOverviewCopyButton
'09.10.2024 11:41:02' - 'Pass' : 2. Wait for '5000' msec.
'09.10.2024 11:42:03' - 'Fail' : 3. Desktop command: LeftClick on HeaderButtonRadtogglebutton
------------------------------------------------------------
Failure Information: 
~~~~~~~~~~~~~~~
Unable to find the window 'General Overview' inside application 'C:\Apps\3S Debug\ProbenverwaltungV3.exe'
---- Current Windows: ----
--------------------------

InnerException:
System.Exception: Unable to find the window 'General Overview' inside application 'C:\Apps\3S Debug\ProbenverwaltungV3.exe'
---- Current Windows: ----
--------------------------
 ---> System.TimeoutException: Wait for condition has timed out
   bei ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo, Object target)
   bei ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout, WaitResultType errorResultType)
   bei ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout)
   bei ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Int32 timeout)
   bei ArtOfTest.WebAii.Wpf.WpfApplication.WaitForWindow(String caption, Int32 timeout)
   --- Ende der internen Ausnahmestapelüberwachung ---
   bei ArtOfTest.WebAii.Wpf.WpfApplication.WaitForWindow(String caption, Int32 timeout)
   bei ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteStep(Int32 order)
------------------------------------------------------------
'09.10.2024 11:42:03' - Detected a failure. Step is marked 'ContinueOnFailure=False' aborting test execution.
------------------------------------------------------------
'09.10.2024 11:42:03' - Overall Result: Fail
'09.10.2024 11:42:03' - Duration: [1 min: 15 sec: 234 msec]
------------------------------------------------------------
'09.10.2024 11:42:03' - Test completed!
Elena
Telerik team
 answered on 10 Oct 2024
1 answer
42 views

Hi Team, 

After we upgrade telerik 2024(we have tried Q1, QA2, QA3), we found some of our cases with keyboard operation do not work now, below is the list, could you please help to check, no exception, just not work actually. Not all, just some. And the old version Testing_Framework_2022_1_0601_1_Free could work well.

Publish shortcut key

F5 --- Refresh the page

Control + R  --- Refresh the page

Control + Tab  --- switch tab

Control + Shift + Tab --- switch tab

Alt + Left ---- go back 

Alt + Right  --- go forward

Shift + End  ---- select to the end

Control + multiple select ---- select multiple

Shift + select two range ---- select range

Private application keyboard

Control + Alt + L   ---open the navigation panel

Control + Shift + OemQuestion   ---- Open the help dialog

Control + Shift + H   ---- open home page

 

Thanks,

Jun

Elena
Telerik team
 answered on 30 Sep 2024
0 answers
51 views

Hi Team, 

We met one issue, for click copy button and get clip text, with telerik 2024, chrome could work well, but chrome headless couldn't work well, the text is always empty.

The code we use is like this::

Clipboard.Clear();

copybutton.click();

Clipboard.GetText();

Can you give some suggestion about this?'

 

Thanks very much,

Jun

Jun
Top achievements
Rank 1
Iron
Iron
 asked on 21 Aug 2024
0 answers
36 views

Hi Team,

We are reviewing test results for chromeheadless, we found below exception for some cases run together, which can be reproduced. But they are good for chrome, seems only chromeheadless issue.

The exception is like below, I couldn't find any clue for it, can you give me any suggestion about why such exception occur, so that we can try to fix it.

19:04:03 System.ServiceModel.CommunicationObjectFaultedException: The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state.
19:04:03 
19:04:03 Server stack trace: 
19:04:03    at System.ServiceModel.Channels.CommunicationObject.ThrowIfDisposedOrNotOpen()
19:04:03    at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)
19:04:03    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
19:04:03    at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
19:04:03    at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
19:04:03 
19:04:03 Exception rethrown at [0]: 
19:04:03    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
19:04:03    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
19:04:03    at Telerik.TestingFramework.Hosts.Common.IBrowserLauncher.LaunchBrowser(ILauncherOptions launchOptions)
19:04:03    at ArtOfTest.WebAii.Messaging.Process.HostsProxy.LaunchBrowser(ILauncherOptions launcherOptions)
19:04:03    at ArtOfTest.WebAii.BrowserSpecialized.Chrome.ChromeActions.LaunchCDPManagedBrowser(String startUrl, BrowserType browserType, Boolean windowVisible)
19:04:03    at ArtOfTest.WebAii.BrowserSpecialized.Chrome.ChromeActions.LaunchNewCDPManagedBrowser(Manager manager, Boolean windowVisible)
19:04:03    at ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunch, Boolean waitForBrowserToConnect, ProcessWindowStyle windowStyle, String arguments)
19:04:03    at ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser()
19:04:03    at WebAii.Framework.Context.WebTest.LaunchNewBrowser(Int32 attempts) in c:\jenkins\workspace\AutomatedTests Build\WebAii.Framework\Context\WebTest.cs:line 173
19:04:03    at WebAii.Framework.Context.WebTest.LaunchNewBrowser(Int32 attempts) in c:\jenkins\workspace\AutomatedTests Build\WebAii.Framework\Context\WebTest.cs:line 177
19:04:03    at WebAii.Framework.Context.WebTest.LaunchNewBrowser(Int32 attempts) in c:\jenkins\workspace\AutomatedTests Build\WebAii.Framework\Context\WebTest.cs:line 177
19:04:03    at WebAii.Framework.Context.WebTest.LaunchNewBrowser(Int32 attempts) in c:\jenkins\workspace\AutomatedTests Build\WebAii.Framework\Context\WebTest.cs:line 177
19:04:03    at WebAii.Framework.Context.WebTest.LaunchNewBrowser(Int32 attempts) in c:\jenkins\workspace\AutomatedTests Build\WebAii.Framework\Context\WebTest.cs:line 177
19:04:03    at WebAii.Framework.Context.WebTest.LaunchNewBrowser(Int32 attempts) in c:\jenkins\workspace\AutomatedTests Build\WebAii.Framework\Context\WebTest.cs:line 177
19:04:03    at WebAii.Framework.Context.WebTest.get_ActiveBrowser() in c:\jenkins\workspace\AutomatedTests Build\WebAii.Framework\Context\WebTest.cs:line 156
19:04:03    at WebAii.Framework.WebAiiSupport.get_ActiveBrowser() in c:\jenkins\workspace\AutomatedTests Build\WebAii.Framework\WebAiiAssemblyContext.cs:line 171
19:04:03    at WebAii.Framework.WebAiiResultSupplementer.SupplementResult(Result result) in c:\jenkins\workspace\AutomatedTests Build\WebAii.Framework\WebAiiResultSupplementer.cs:line 50
19:04:03 OnSpecificationStart

Thanks,

Jun

Jun
Top achievements
Rank 1
Iron
Iron
 asked on 18 Jul 2024
1 answer
66 views

Hi Team,

I am trying chromeheadless now, most of the UI operations could work, but for keybord, which do not work, like below:

Manager.Current.Desktop.KeyBoard.KeyDown(Keys.Alt);
Manager.Current.Desktop.KeyBoard.KeyPress(Keys.End);
Manager.Current.Desktop.KeyBoard.KeyUp(Keys.Alt);

 

It's not always broken, when I use it in my case, the same code work for chrome, but broken for chromeheadless, i don't know how to debug the issue. Can you please help to check for us?

Message: 
    ExecuteCommand failed!
    InError set by the client. Client Error:
    Protocol error (Input.dispatchKeyEvent): Invalid 'text' parameter
    BrowserCommand (Type:'Action',Info:'NotSet',Action:'RealKeyboardAction',Target:'null',Data:'keyDown#$TS$#LMenu',ClientId:'1748F9AF024B6615B325B7310DF45C36',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'Protocol error (Input.dispatchKeyEvent): Invalid 'text' parameter')
    InnerException: none.


  Stack Trace: 
    ArtOfTest.WebAii.Exceptions.ExecuteCommandException: ExecuteCommand failed!
    InError set by the client. Client Error:
    Protocol error (Input.dispatchKeyEvent): Invalid 'text' parameter
    BrowserCommand (Type:'Action',Info:'NotSet',Action:'RealKeyboardAction',Target:'null',Data:'keyDown#$TS$#LMenu',ClientId:'1748F9AF024B6615B325B7310DF45C36',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'Protocol error (Input.dispatchKeyEvent): Invalid 'text' parameter')
    InnerException: none.
    Browser.ExecuteCommandInternal(BrowserCommand request)
    Browser.ExecuteCommand(BrowserCommand request, Boolean performDomRefresh, Boolean waitUntilReady)
    HeadlessKeyboard.PressOrReleaseKey(Keys key, Boolean release)
    KeyBoard.KeyDown(Keys code, Boolean delay)
    KeyBoard.KeyDown(Keys key)
    <.ctor>b__26_8() line 106

 

Thanks,

Jun

    
Elena
Telerik team
 answered on 14 May 2024
1 answer
54 views

I use ActiveBrowser.Cookies.GetCookies(BaseUri); to get browser cookie, cookie is got, but all expired cookie. The same code if I set chrome not headless, which could get un-expired cookie. Is it not supported yet?

Chrome headless:

Chrome:

Elena
Telerik team
 answered on 14 May 2024
1 answer
51 views

Hi Jun,

I tried not support, will got exception when lunch new browser, but still want to double confirm with team whether there's a possibility. 

Thanks,

Jun

Elena
Telerik team
 answered on 14 May 2024
1 answer
86 views
I searched lot, seems old version not support, not sure if the latest version support, but after I try not good. We also tried use keyboard to switch tab, which could switch successfully, but active browser will not switch.
Elena
Telerik team
 answered on 16 Apr 2024
1 answer
58 views

Hello,

I am currently evaluating Telerik Test Studio Dev Edition (Visual Studio Plugin) with a trial license.
I successfully created a few WPF Tests in a sample application I created from scratch using .NET 6, WPF and some Telerik UI for WPF components (e.g. RadGridView). Here, the recording works perfectly. When I click on Start by recording Test Steps, the application starts, gets unresponsive for ashort while (~3 sec.) and then the Recorder overlay appears and I can record the test.

But then I tried to automate tests for a small tool, let's call it SmallTool, which is also a .NET 6 WPF application. But here, recording only works by using a Desktop Test. This limits the available test steps significantly (e.g. I cannot "evaluate the third item in this List"), so the tests become useless.

Here are the differences between my sample project and SmallTool that I notice:

  • SmallTool does not use any Telerik UI lib
  • SmallTool does use two COM references (for interaction with outlook)

I also already checked the Desktop Application Will Not Record support article. My SmallTool did appear as a WPF application.

Can you help me with getting WPF tests to work?

Log output in the Test Studio log:

<see attachment "teststudioLog - Kopie.txt">
Elena
Telerik team
 answered on 18 Jan 2024
Narrow your results
Selected tags
Tags
+? more
Top users last month
n
Top achievements
Rank 1
Iron
Iron
Arifullah
Top achievements
Rank 2
Iron
Iron
Marat
Top achievements
Rank 1
Richard
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 2
Iron
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
n
Top achievements
Rank 1
Iron
Iron
Arifullah
Top achievements
Rank 2
Iron
Iron
Marat
Top achievements
Rank 1
Richard
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 2
Iron
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?