Button wont enable - 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: Button wont enable (/Thread-Button-wont-enable) |
Button wont enable - mv8167 - 10-28-2010 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 RE: Button wont enable - KVK - 10-29-2010 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:- - Vinod RE: Button wont enable - mv8167 - 10-29-2010 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 RE: Button wont enable - rajeshwar - 10-30-2010 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.. RE: Button wont enable - mv8167 - 11-19-2010 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" but the Type micTab threw an error. Any other ideas? RE: Button wont enable - manishbhalshankar - 12-01-2010 Change: Code: Browser("WisdomLogin").Page("Wisdom DEV_4").Frame("MainWindow_2").WebEdit("MasterPage$ContentPlaceHolderS").Set "0141" Code: Browser("WisdomLogin").Page("Wisdom DEV_4").Frame("MainWindow_2").WebEdit("MasterPage$ContentPlaceHolderS").Type "0141" RE: Button wont enable - cdesserich - 12-02-2010 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" RE: Button wont enable - AkhilaArvind - 12-16-2010 Hi, In oder to Enter/Type the value in WebEdit Code: If Browser("BrowserName").Page("PageName").WebEdit("WebEditName").Exist Then Akhila RE: Button wont enable - bharathreddi - 12-11-2012 (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... ****************************************** this solution is working fine. thanks alot RE: Button wont enable - Ankesh - 12-11-2012 try using the below code Code: Browser().Page().Frame().WebEdit().Object.value="<Your Text>" Code: Browser().Page().Frame().WebEdit().Object.text="<Your Text>" Ankesh |