Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can not get text to be recognized in HTML field........
#1
Solved: 11 Years, 4 Months ago
I am trying to enter some text into an HTML field in my application.

Using the following Set command (code below) inserts the text "TEST", but the HTML field does not recognize the text. The text gets set but it acts like a copy and paste. The field allows 254 characters and when "TEST" is set the field thinks there is no characters in it.

Code example:
Code:
Browser("Browser").Page("GeneralInformation").PSFrame("ContractHeader").WebEdit("txtAssign").Set ("Test")


So I decided to try to use SendKeys but I cant seem to get it to work with my application. I cant seem to get 12345 displayed into the application??

Code example:

Code:
Set WshShell = CreateObject("Wscript.Shell")

Browser("Browser").Page("General Information").PSFrame("Contract Header").WebEdit("txtAssign").Click

WshShell.SendKeys "12345"



Any ideas on why SendKeys does not work for me? or if anyone has another way I can SET the text in the HTML field? The field will allow 254 characters but when I do the SET in QTP the HTML field still thinks there is 254 available characters in the field so a message box appears stating "No text has been entered".


The application I am using is PeopleSoft 9.0
Reply
#2
Solved: 11 Years, 4 Months ago
I resolved the issue for some reason I had to use descriptive programing on the object in order for send keys to work. Used the following code

Code:
Set WshShell = CreateObject("WScript.Shell")

Browser("title:=General Information").Page("title:=General Information").PSFrame("title:=Contract Header").WebEdit("name:=ASSIGN").Click

WshShell.SendKeys("E")

Set WshShell = Nothing
Reply
#3
Solved: 11 Years, 4 Months ago
Can you try this and let us know -

Code:
Browser("Browser").Page("GeneralInformation").PSFrame("ContractHeader").WebEdit("txtAssign").Click
Browser("Browser").Page("GeneralInformation").PSFrame("ContractHeader").WebEdit("txtAssign").Set "Test"
Browser("Browser").Page("GeneralInformation").PSFrame("ContractHeader").WebEdit("txtAssign").Click

Also please use proper code formatting while asking /responding to queries.
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#4
Solved: 11 Years, 4 Months ago
Ankur,

The above code does not work.
The Browser("Browser").Page("GeneralInformation").PSFrame("ContractHeader").WebEdit("txtAssign").Set "Test"
does put the word TEST in the field, but the HTML field does not recognize it. The field has a max of 254 char's once I do the
Browser("Browser").Page("GeneralInformation").PSFrame("ContractHeader").WebEdit("txtAssign").Set "Test"
the field char counter does not go down to 250 char like expected the counter is still at 254 char.
Reply
#5
Solved: 11 Years, 4 Months ago
Hi,
Put Index:=0 as the additional property for WebEdit class , you may not face this issue.

Venkat.Batchu
Reply
#6
Solved: 11 Years, 4 Months ago
Just checking. Have you tried this or is it just your assumption? Also try it by putting Wait statements before and after Set statement.

(08-05-2010, 07:33 PM)Wonka Wrote:
(08-05-2010, 01:47 PM)Ankur Wrote: Can you try this and let us know -

Code:
Browser("Browser").Page("GeneralInformation").PSFrame("ContractHeader").WebEdit("txtAssign").Click
Browser("Browser").Page("GeneralInformation").PSFrame("ContractHeader").WebEdit("txtAssign").Set "Test"
Browser("Browser").Page("GeneralInformation").PSFrame("ContractHeader").WebEdit("txtAssign").Click

Also please use proper code formatting while asking /responding to queries.

Ankur,

The above code does not work.
The Browser("Browser").Page("GeneralInformation").PSFrame("ContractHeader").WebEdit("txtAssign").Set "Test"
does put the word TEST in the field, but the HTML field does not recognize it. The field has a max of 254 char's once I do the
Browser("Browser").Page("GeneralInformation").PSFrame("ContractHeader").WebEdit("txtAssign").Set "Test"
the field char counter does not go down to 250 char like expected the counter is still at 254 char.
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#7
Solved: 11 Years, 4 Months ago
Ankur,
my 2 cents around, i guess clicking on the frame after the set may help rather than click on the webedit itself.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#8
Solved: 11 Years, 4 Months ago
I did true this solution and it did not work:
Code:
Browser("Browser").Page("GeneralInformation").PSFrame("ContractHeader").WebEdit("txtAssign").Click
Browser("Browser").Page("GeneralInformation").PSFrame("ContractHeader").WebEdit("txtAssign").Set "Test"
Browser("Browser").Page("GeneralInformation").PSFrame("ContractHeader").WebEdit("txtAssign").Click

The following with the WAIT statements worked:

Code:
Browser("Browser").Page("GeneralInformation").PSFrame("ContractHeader").WebEdit("txtAssign").Click
Wait(2)
Browser("Browser").Page("GeneralInformation").PSFrame("ContractHeader").WebEdit("txtAssign").Set "Test"
Wait(2)
Browser("Browser").Page("GeneralInformation").PSFrame("ContractHeader").WebEdit("txtAssign").Click

Thanks for all the helpful posts.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  getting the value from the field learning 0 1,046 03-19-2019, 09:13 AM
Last Post: learning
  Telnet command not recognized Sanjana1987 1 2,060 09-20-2017, 03:16 PM
Last Post: Ankur
  Customized HTML reports in QTP azeem 11 49,493 12-31-2016, 02:57 PM
Last Post: chevronneraji
  [UFT] Get text into DIV through HTML tag robertosalemi 2 5,533 03-29-2016, 09:43 PM
Last Post: robertosalemi
  Need to Validate Text filed is blank after clicking on the Text box balak89 3 4,905 09-13-2015, 12:06 AM
Last Post: ADITI1992

Forum Jump:


Users browsing this thread: 1 Guest(s)