Results 1 to 2 of 2

Thread: Junk Characters entered in HtmlTextField (eg:- Username Field)

  1. #1
    Contributing Member
    Join Date
    May 2008
    Answers
    32

    Junk Characters entered in HtmlTextField (eg:- Username Field)

    Hi

    I observed that the silktest enters junk characters into the HtmlTextfield on SetText() calls. Mostly these junk characters are from the clipboard (i.e if you copy any text while your script is in progress or otherwise and at any point of time the script needs to enter some text in a htmltextfield, the silktest pastes the text in clipboard to the textfield).

    Any workaround available???

    Regards


  2. #2
    Contributing Member
    Join Date
    May 2008
    Answers
    32

    Re: Junk Characters entered in HtmlTextField (eg:- Username Field)

    Hi all

    For those who have experienced this issue:-

    We contacted Borland regarding this issue and they provided a workaround i.e when and where we are typing any text in a textfield before typing the text clear the contents in the clipboard.
    Something like -
    clipboardContents = [STRING]Clipboard.GetText()
    [-] if(!(clipboardContents==""))
    [ ] Clipboard.SetText({})

    and also for logging into the application using username an password - we did something like:-
    [ ] Clipboard.SetText({username})
    [ ] Applicationwindow.HtmlTextField(USERNAME_FIELD).SetFocus()
    [ ] Applicationwindow.HtmlTextField(USERNAME_FIELD).Click()
    [ ] Applicationwindow.HtmlTextField(USERNAME_FIELD).TypeKeys("")
    [ ] Applicationwindow.HtmlTextField(USERNAME_FIELD).TypeKeys("")
    [ ] Applicationwindow.HtmlTextField(USERNAME_FIELD).TypeKeys("")

    i.e we paste ("") the contents in the clipboard to the htmltextfield..


    But somehow for our disguise the clipboard workaround did not help us with the random character issue.
    We still got the random characters typed into the textfields or the URL's...

    One day i just came across an interesting behavior was observed for TypeKeys()

    See the below scenario for TypeKeys() –
    1. Take a HtmlTextField and try to type some text into it using typekeys().
    2. When the script is typing the value, tab the screen to silktest and observe
    The text is typed in the silktest work area instead of the text field. Sometimes the Silktest does not respond until the whole text is typed in.

    So i feel may be the text is typed in dur to this behaviour in typekeys().

    Hence i feel a possible workaround for this is to use SetText() method. and before calling this method just call a Cleartext() method to make sure there is no pre-exixting text.
    Hope this fixes our issues as of now we did not encounter any troubles fingers crossed.

    If anybody else have a better idea or workaround, then revert back to this post.


    Thanks and Regards
    Sabarish


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact