Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Button wont enable
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
Using QTP 9.5

On my web page, when a type a number into a text box a button becomes enabled. When I use QTP it shoves the number into the text box fine, but the button stays disabled. I added a Submit call after placing the number in the text box but the button still stays disabled.

I have tried pulling the number from a excel sheet and hard coded into the script.

Does anyoneou know of a way to enter the number so that the button will enable?

Lorena
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi Lorena,

Use Type Method to set the value in the text box or After setting value in text box use a mictab which will enable the button, below is the code


Code:
'method 1:-

WebEdit("name:=xy").Type "abcd"

'method 2:-

WebEdit("name:=xy").set "abcd"
WebEdit("name:=xy").Type "micTab"


- Vinod
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago Big Grin 
Vinod,

Thx for taking the time to write me.

Now I am lost on how to change your descrbed methos for my need.

What is name:=xy, is this the name of the image or location of the image?

thx

Lorena
Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,

Please view the Source of your web page and see if any Events are fired, which enables the button after you enter value in WebEdit.

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"

Rajeshwar..
Reply
#5
Solved: 11 Years, 3 Months, 3 Weeks ago
From the page Source, I could not find any Event that foires off to enable the button. I did try:


Code:
Browser("WisdomLogin").Page("Wisdom DEV_4").Frame("MainWindow_2").WebEdit("MasterPage$ContentPlaceHolderS").Set "0141"
Browser("WisdomLogin").Page("Wisdom DEV_4").Frame("MainWindow_2").WebEdit("MasterPage$ContentPlaceHolderS").Type "micTab"
Browser("WisdomLogin").Page("Wisdom DEV_4").Frame("MainWindow_2").WebButton("Validate").Click

but the Type micTab threw an error.

Any other ideas?
Reply
#6
Solved: 11 Years, 3 Months, 3 Weeks ago
Change:
Code:
Browser("WisdomLogin").Page("Wisdom DEV_4").Frame("MainWindow_2").WebEdit("MasterPage$ContentPlaceHolderS").Set "0141"
To:
Code:
Browser("WisdomLogin").Page("Wisdom DEV_4").Frame("MainWindow_2").WebEdit("MasterPage$ContentPlaceHolderS").Type "0141"
Reply
#7
Solved: 11 Years, 3 Months, 3 Weeks ago
WebEdits don't support the Type function, only window objects, like WinEdits. That's why the .Type micTab line was throwing an error. Lorena, there are several ways that web applications implement the functionality you describe. You can 1. try setting the value in the WebEdit, then trying to find the event that does the processing that unlocks the button, or you can 2. get focus on the WebEdit and send the Type command to the Browser window. Option 1 is probably easier and more reliable, the problem being that without seeing the application code, I can't know for sure what event processes the unlocking of the button. However, it would have to be onkeypress, onkeydown, onkeyup, or onchange I would think. So try the below code, and you can comment out the FireEvent lines until you find the event that does the processing. Hope this helps, let me know if it does...

Code:
Browser("WisdomLogin").Page("Wisdom DEV_4").Frame("MainWindow_2").WebEdit("MasterPage$ContentPlaceHolderS").Set "0141"
Browser("WisdomLogin").Page("Wisdom DEV_4").Frame("MainWindow_2").WebEdit("MasterPage$ContentPlaceHolderS").FireEvent "onkeypress"
Browser("WisdomLogin").Page("Wisdom DEV_4").Frame("MainWindow_2").WebEdit("MasterPage$ContentPlaceHolderS").FireEvent "onkeydown"
Browser("WisdomLogin").Page("Wisdom DEV_4").Frame("MainWindow_2").WebEdit("MasterPage$ContentPlaceHolderS").FireEvent "onkeyup"
Browser("WisdomLogin").Page("Wisdom DEV_4").Frame("MainWindow_2").WebEdit("MasterPage$ContentPlaceHolderS").FireEvent "onchange"
Reply
#8
Solved: 11 Years, 3 Months, 3 Weeks ago Smile 
Hi,
In oder to Enter/Type the value in WebEdit
Code:
If Browser("BrowserName").Page("PageName").WebEdit("WebEditName").Exist  Then
Browser("BrowserName").Page("PageName").WebEdit("WebEditName").Click
Set WshShell = CreateObject("WScript.Shell")
wait 2                
WshShell.SendKeys "Abcd"
This should work...Try out

Akhila
Reply
#9
Solved: 11 Years, 3 Months, 3 Weeks ago
(12-02-2010, 11:51 AM)cdesserich Wrote: WebEdits don't support the Type function, only window objects, like WinEdits. That's why the .Type micTab line was throwing an error. Lorena, there are several ways that web applications implement the functionality you describe. You can 1. try setting the value in the WebEdit, then trying to find the event that does the processing that unlocks the button, or you can 2. get focus on the WebEdit and send the Type command to the Browser window. Option 1 is probably easier and more reliable, the problem being that without seeing the application code, I can't know for sure what event processes the unlocking of the button. However, it would have to be onkeypress, onkeydown, onkeyup, or onchange I would think. So try the below code, and you can comment out the FireEvent lines until you find the event that does the processing. Hope this helps, let me know if it does...

Code:
Browser("WisdomLogin").Page("Wisdom DEV_4").Frame("MainWindow_2").WebEdit("MasterPage$ContentPlaceHolderS").Set "0141"
Browser("WisdomLogin").Page("Wisdom DEV_4").Frame("MainWindow_2").WebEdit("MasterPage$ContentPlaceHolderS").FireEvent "onkeypress"
Browser("WisdomLogin").Page("Wisdom DEV_4").Frame("MainWindow_2").WebEdit("MasterPage$ContentPlaceHolderS").FireEvent "onkeydown"
Browser("WisdomLogin").Page("Wisdom DEV_4").Frame("MainWindow_2").WebEdit("MasterPage$ContentPlaceHolderS").FireEvent "onkeyup"
Browser("WisdomLogin").Page("Wisdom DEV_4").Frame("MainWindow_2").WebEdit("MasterPage$ContentPlaceHolderS").FireEvent "onchange"

******************************************
this solution is working fine.
thanks alot
Reply
#10
Solved: 11 Years, 3 Months, 3 Weeks ago
try using the below code

Code:
Browser().Page().Frame().WebEdit().Object.value="<Your Text>"
OR
Code:
Browser().Page().Frame().WebEdit().Object.text="<Your Text>"
Regards,
Ankesh
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Enable Hyperlink without opening the Excel Sathiya 11 7,112 05-31-2012, 04:41 PM
Last Post: Sathiya
Cool how to re-enable Keyword tab dol_fin 2 4,859 03-05-2012, 11:23 AM
Last Post: Saajo87
  Enable to record script for web application shailesh 3 5,186 07-01-2011, 12:38 PM
Last Post: shailesh
  how to enable webedit satishkumarm 9 10,238 05-27-2011, 01:30 PM
Last Post: satishkumarm
  How to enable web add-in in QTP Pallaviv 2 4,734 10-03-2009, 04:14 AM
Last Post: Pallaviv

Forum Jump:


Users browsing this thread: 1 Guest(s)