Micro Focus QTP (UFT) Forums
cannot use the type method on object and submit is not working - 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: cannot use the type method on object and submit is not working (/Thread-cannot-use-the-type-method-on-object-and-submit-is-not-working)



cannot use the type method on object and submit is not working - jove1776 - 01-14-2011

Hi folks I have some difficulties with a WebEdit element that i am trying to set and then submit.

I tried:

Code:
Browser("web").Page("webpage").Frame("mainFrame").WebEdit("Number").Set filename
Browser("web").Page("webpage").Frame("mainFrame").WebEdit("Number").Submit

It just isnt working and worse the method type is not a property of the object:

Code:
Object doesn't support this property or method: 'Browser(...).Page(...).Frame(...).WebEdit(...).type'

Line (25): "Browser("web").Page("webpage").Frame("mainFrame").WebEdit("Number").type micReturn".
When I do it manually on the screen and put the number in the field and press return it works, with QTP the submit hangs the app.

Any ideas?


RE: cannot use the type method on object and submit is not working - cdesserich - 01-14-2011

I've never used the Submit sub on a WebEdit. Isn't there a submit button somewhere on the page that you can click? If not then you can send the "enter" key to the browser. The Type sub doesn't work on web controls. You have to get the Window object of the browser to use Type:

Code:
Window("hwnd:=" & Browser("web").GetROProperty("hwnd")).Activate
Window("hwnd:=" & Browser("web").GetROProperty("hwnd")).Type micReturn



RE: cannot use the type method on object and submit is not working - supputuri - 01-15-2011

Hi,

Type method is designed for window based apps, so you will get the error when you try to use that method for web apps.
Can you please let me know why do you want to type the value rather than set and the same with the other method i.e submit.




Thanks,
Sridhar


RE: cannot use the type method on object and submit is not working - mvuyy001 - 01-16-2011

Hi,
Try this .....
Code:
Browser("web").Page("webpage").Frame("mainFrame").WebEdit("Number").Set filename
Set oWSc = CreateObject("Wscript.Shell")
Browser("web").Page("webpage").Frame("mainFrame").WebEdit("Number").Click
oWSc.SendKeys "{ENTER}"
Set oWSc = Nothing

Hope this helps
MV


RE: cannot use the type method on object and submit is not working - jove1776 - 01-17-2011

Got it working.

Thanks for all your replies, much appreciated!




RE: cannot use the type method on object and submit is not working - Parke - 01-27-2015

Jove1776, I am having the same problem in a web application. How did you get it to work?

Parke