Forum Discussion

kevin_kapell's avatar
kevin_kapell
Frequent Contributor
9 years ago

backslash being removed

backslashes appear to be being removed now in TestComplete 12.0.122.7, Web

 

To illustrate I have the following code.

 

var Filepath = "C:/Repository/Automation/TestFiles"
Log.Event(Filepath)
var Filepath = "C:\Repository\Automation\TestFiles"
Log.Event(Filepath)

 

This results in the first log entry being

C:/Repository/Automation/TestFiles

 

and the second log entry being

C:RepositoryAutomationTestFiles

 

I am running this on IE 11.

 

This is preventing me from uploading a file to a web page as part of my automation.

  • dnguyen's avatar
    dnguyen
    SmartBear Alumni (Retired)

    Hi Kevin,

     

    Please note that when scripting there are special characters that need to be 'escaped' when used in strings.

    Character sequence Description
    \\ Backslash
    \b Backspace
    \r Carriage return
    \" Double quote
    \f Form feed
    \n New line
    \' Single quote
    \t Tab

     

     

  • kevin_kapell's avatar
    kevin_kapell
    Frequent Contributor

    Some additional information.

     

    When I make the path

    C:\\Repository\\Automation\\TestFiles

     

    then it records it in the log as

    C:\Repository\Automation\TestFiles