Need More Info
Last Updated: 29 Jan 2025 10:11 by ADMIN
Nahla
Created on: 28 Jan 2025 19:05
Type: Bug Report
0
Error when entering a text that has '\' with headless browser

I am getting an error when entering a password that contains '\' character in a password text field.  I tried using the field definition (eg. LoginPage.Password.TypeTextAndWait(pwd, false).   Receiving this error:
ArtOfTest.WebAii.Exceptions.ExecuteCommandException: 'ExecuteCommand failed!
InError set by the client. Client Error:
Evaluation failed: SyntaxError: Invalid or unexpected token
    at eval (<anonymous>)
    at __puppeteer_evaluation_script__:1:35
    at __puppeteer_evaluation_script__:1:562
BrowserCommand (Type:'Action',Info:'NotSet',Action:'InvokeJsFunction',Target:'ElementId (tagName: '',occurrenceIndex: '-1')',Data:'((window.top && window.top.Telerik && window.top.Telerik.TestStudio && window.top.Telerik.TestStudio.Common && window.top.Telerik.TestStudio.Common.DomProviders && window.top.Telerik.TestStudio.Common.DomProviders.DomProvideFactory && window.top.Telerik.TestStudio.Common.DomProviders.DomProvideFactory.getProvider().getElementByTagNameAndIndex(document, 'input', 1)) || document.getElementsByTagName('input')[1]).value = "pwd"',ClientId:'CEB2876D',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'Evaluation failed: SyntaxError: Invalid or unexpected token
    at eval (<anonymous>)
    at __puppeteer_evaluation_script__:1:35
    at __puppeteer_evaluation_script__:1:562')
InnerException: none.

It works fine if I run with Chrome  (non-headless).   Note:  the last character of the pwd is the  " \ "

Any suggestions or workaround would be greatly appreciated.  This is urgent as our script is not able to execute properly at the moment.

 

1 comment
ADMIN
Elena
Posted on: 29 Jan 2025 10:11

Hello Nahla,

As far as I understand you are using the Testing Framework to build your automation tests. Please, correct me if this assumption is not on spot. 

Based on the details you share I belive that you only need to insert a short delay in the test before the action which enters the password. The execution of the actions is really fast especially in the headless browser and since this same action is performed correctly in the head-full browser, I assume that the issue is related to the lack of synchronization between the actions and the speed of their execution. 

In case this suggestion doesn't help you, please, share a sample code which I can use to reproduce the issue on my end. 

Thank you for your cooperation in advance.

Regards,
Elena
Progress Telerik

Virtual Classroom is the free self-paced technical training portal that gets you up to speed with Telerik and Kendo UI products including Telerik Test Studio! Check it out at https://learn.telerik.com/.