Micro Focus QTP (UFT) Forums
convert .Click to <enter> - 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: convert .Click to <enter> (/Thread-convert-Click-to-enter)



convert .Click to <enter> - Bsmith - 03-23-2011

Code:
Browser("Lawson portal").Page("Lawson portal").WebEdit("WebEdit").Click

This is not firing correctly. The Click is not really correct for this action, how can I convert this into an <enter> command. I tried changing .Click to .Submit, but that didn't work


RE: convert .Click to <enter> - basanth27 - 03-23-2011

What about webedit().set "" ? Does that not help? If you are adamant on using keyboard simulation then you may want to read about devicereplay and Sendkeys.
Oh..i almost forgot. Would you try the below code and see if that works?
Code:
Settings.webpackage("Replaytype") = 2
Browser("Lawson portal").Page("Lawson portal").Webedit("webedit").click
Settings.webpackage("Replaytype") = 1



RE: convert .Click to <enter> - Bsmith - 03-24-2011

So far, neither of those ideas is working. I get an error trying the replaytype and the .Set "" just sits there. Can I input a pause? As weird as that sounds, I think it's blowing over the input and the cursor needs to be in the input box for it to work. There is not 'submit' button to map to.

Thanks


RE: convert .Click to <enter> - tdevick - 03-24-2011

Use "Set" instead of "Click":

Code:
Browser("Lawson portal").Page("Lawson portal").Webedit("webedit").Set "some text to enter in the  edit box"



RE: convert .Click to <enter> - basanth27 - 03-24-2011

My bad,
Please try this,
Code:
Setting.WebPackage("ReplayType") = 2
Browser("Lawson portal").Page("Lawson portal").Webedit("webedit").click
Setting.WebPackage("ReplayType") = 1



RE: convert .Click to <enter> - tdevick - 03-24-2011

>>>the cursor needs to be in the input box for it to work.

There is a QTP setting for that.Tools->Options->Windows Applications->Advanced->Run Settings->Edit Box->Click edit box before inserting text

Maybe that will help?


RE: convert .Click to <enter> - Bsmith - 03-24-2011

Still no joy. I think the only way this will work is using SendKey of the enter key. Can I script that and then call it in a QTP action? if so, how would I do that?


RE: convert .Click to <enter> - basanth27 - 03-25-2011

But it wasnt windows app..was it?


RE: convert .Click to <enter> - Bsmith - 03-25-2011

Success!
Had to use SendKeys:
Code:
Set WshShell = CreateObject("WScript.Shell")
    WshShell.SendKeys "{ENTER}"