Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
cannot use the type method on object and submit is not working
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
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?
Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
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
Reply
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
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
Thanks,
SUpputuri
Reply
#4
Solved: 11 Years, 3 Months, 4 Weeks ago
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
Reply
#5
Solved: 11 Years, 3 Months, 4 Weeks ago
Got it working.

Thanks for all your replies, much appreciated!

Reply
#6
Solved: 11 Years, 3 Months, 4 Weeks ago
Jove1776, I am having the same problem in a web application. How did you get it to work?

Parke
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Different Type of Dropdown Selector zunebuggy 6 3,402 05-01-2018, 06:46 PM
Last Post: zunebuggy
  How to import .xlsx file type to QTP qtped 3 6,662 03-27-2014, 01:33 PM
Last Post: Ankur
  Object doesn't support this property or method: 'webedit' Divya Roopa 3 10,006 03-11-2014, 07:26 AM
Last Post: basanth27
  type mismatch error in QTP QAlearningQTP 1 7,122 02-04-2014, 08:14 AM
Last Post: QAlearningQTP
  QTP 11.52---Type mismatch error srinijg20 4 4,300 08-26-2013, 03:51 PM
Last Post: GregHicks

Forum Jump:


Users browsing this thread: 3 Guest(s)