Micro Focus QTP (UFT) Forums
Hitting enter key aftrer seting value in webedit - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Hitting enter key aftrer seting value in webedit (/Thread-Hitting-enter-key-aftrer-seting-value-in-webedit)



Hitting enter key aftrer seting value in webedit - tbull - 03-10-2010

i have a situation when a button is being enabled only if i type the keys in.but when the qtp set the value the button is not being enabled.so i want to hit enter after seting the value in webedit.help please? i tried sedn keys but it hitting enter on the page not in the webedit form


RE: Hitting enter key aftrer seting value in webedit - Saket - 03-11-2010

Can you paste whatever you have tried?


RE: Hitting enter key aftrer seting value in webedit - rajeshwar - 03-11-2010

you can try using "FireEvent" Method.Check on which event the button is getting enabled and accordingly you can use appropriate event.

Example:
Code:
Browser("name:=XYZ").Page("title:=XYZ").WebEdit("name:=ABC").FireEvent "onblur"



RE: Hitting enter key aftrer seting value in webedit - tbull - 03-11-2010

i tried all these but still no luck,i need something like keyup or typekeys,Help please

Code:
AMA.Link("name:=Intermodal Storage").Click
AMA.WebEdit("name:=equipmentIdList").Set "PACU 898375"
'Wait(3)
''AMA.WebButton("name:= Search").FireEvent "onblur"
'Wait(2)
'
''Dim WshShell
'''             set WshShell = CreateObject("WScript.Shell")
'''         wait(3)
'''         WshShell.AppActivate "name:=UP: Accessorial Management: Intermodal Storage"
'''         WshShell.SendKeys" {ENTER}  "
'''         wait(3)
'''        
'
''
'''AMA.WebEdit("name:=equipmentIdList").Type micF5
'''AMA.WebEdit("name:=equipmentIdList").SendKeys TE_ENTER
AMA.WebButton("name:= Search").Click



RE: Hitting enter key aftrer seting value in webedit - Saket - 03-11-2010

i guess sendkeys should work here.
you just need to ativate the edit box by clicking there before sending the enter/tab.

I would prefer to send Tab key instead of Enter (if AUT permits)
try this

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

AMA.WebEdit("name:=equipmentIdList").Set "PACU 898375"
AMA.WebEdit("name:=equipmentIdList").Click
WshShell.SendKeys"{TAB}"
'or try sending Enter as well
'WshShell.SendKeys"{ENTER}"

let me know if this helps.


RE: Hitting enter key aftrer seting value in webedit - tbull - 03-11-2010

Thank you so much, that worked.I tried send kys but i was activating the main window.which was a mistake


RE: Hitting enter key aftrer seting value in webedit - DhanavanthaG - 03-12-2010

*********************
Hi,
'Send Keys', are very faster than other scripting logic, so before coming to the sendkeys we have to activate the particular object
For example:
Code:
Browser(BrName).Page(PgName).Frame(FrName).WebEdit(textboxName).Activate
then use the 'Enter' functionality SendKeys afterwards, even though if it's not working, just use the 'Enter' functionality SendKeys one more time, because sendkeys won't wait for screen/page loading, after using sendkeys method please use wait(2)

Note: To use the Fireevent method we have to activate the events before from "WebEvent Configuration Method" under the Tools menu
select the particular object and make enable the events you needed.

Regards,
Dhanavantha G Krishnan


RE: Hitting enter key aftrer seting value in webedit - DhanavanthaG - 03-12-2010

*********************
Hi,
'Send Keys', are very faster than other scripting logic, so before coming to the sendkeys we have to activate the particular object
For example:
Code:
Browser(BrName).Page(PgName).Frame(FrName).WebEdit(textboxName).Activate
then use the 'Enter' functionality SendKeys afterwards, even though if it's not working, just use the 'Enter' functionality SendKeys one more time, because sendkeys won't wait for screen/page loading, after using sendkeys method please use wait(2)

Note: To use the Fireevent method we have to activate the events before from "WebEvent Configuration Method" under the Tools menu
select the particular object and make enable the events you needed.

Regards,
Dhanavantha G Krishnan