Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

How can I get around the arbitrary 1024 character limit when using the SetText() method on an HTML input field?

How can I get around the arbitrary 1024 character limit when using the SetText() method on an HTML input field?

Problem:

How can I get around the arbitrary 1024 character limit when using the SetText() method on an HTML input field?

Resolution:

QUESTION
----------------------------------

How can I get around the arbitrary 1024 character limit when using the SetText() method on an HTML input field?

ANSWER
----------------------------------

This limit of 1024 characters within SilkTest is only evident when used with an HTML input field.
However SetText on an application such as Notepad allows the user to enter the full string length. Using this fact in conjunction with the clipboard should allow the user to paste the full string into web applications. The following code demonstrates the approach:

[ ] const wMainWindow = MainBrowserWindow
[ ] 
[-] window BrowserChild MainBrowserWindow
    [ ]  tag "Main Browser Window"
    [ ] 
    [-] HtmlTextField TextField1
        [ ] tag "#5"
[ ] 
[-] window MainWin Notepad
    [ ] tag "*Notepad"
    [ ] 
    [-] Menu Edit
        [ ] tag "Edit"
        [+] MenuItem SelectAll
            [+] multitag "Select All"
                [ ] "$7"
    [-] TextField TextField1
        [ ] tag "$15"

[-] testcase Test1() appstate none
    [ ] 
    [ ] 
    [ ] string sString = Replicate ("This is a test string to be replicated.",250)
    [ ] 
    [ ] Notepad.SetActive()
    [ ] Notepad.TextField1.SetText(sString)
    [ ] Notepad.Edit.SelectAll.Pick()
    [ ] Notepad.TypeKeys("")
    [ ] 
    [ ] MainBrowserWindow.SetActive()
    [ ] MainBrowserWindow.TextField1.SetPosition (1, 1)
    [ ] MainBrowserWindow.TextField1.TypeKeys("")


Old KB# 22118

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-02-15 19:28
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.