Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to run script written in Javascript using QTP 9.0
#1
Solved: 11 Years, 4 Months ago
Hello Everyone,

In my web page, I have an Input field(button) with event (onclick) calling a javascript function.
This javascript checks if any mandatory field (like text input for name) is not filled.

My Problem : When I made a record, if I left blank mandatory field, and click on Button, the event is not recorded.
Remark : If I enter value in mandatory field, it’s OK.


//My input fields
Code:
<input type="text" runat="server" id="name">
<input type="button" name="submit" onclick="jcpAction();">

//My javascript

function cpAction()
{
   var success =true;
   var nameinput = document.getElementById('name');
   if(nameinput.value== '')
   {
      success = false;      
   }
   return success;
}

any suggestions??
Why QTP is not picking up above written Javascript?
Reply
#2
Solved: 11 Years, 4 Months ago
Insert the click yourself and see what happens. If that does not help then look at the below article

http://knowledgeinbox.com/articles/qtp/s...e-setting/
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to send/pass UFT Run Error Dialog as output value to main driver script lravi4u 0 593 11-05-2023, 03:55 PM
Last Post: lravi4u
  How do you Change Run mode mid script? Caleytown 6 7,234 03-25-2021, 08:27 AM
Last Post: RB26578
  How to run driver script to kick off scripts stored in QC? shipu 0 3,597 04-30-2014, 02:39 AM
Last Post: shipu
  Flight API does not run and QTP not recording the script Ruch 0 2,600 08-15-2013, 04:57 AM
Last Post: Ruch
Exclamation Getting run time error while executing the QTP script in command prompt. vishruth143 1 5,660 07-15-2013, 05:41 PM
Last Post: vinod123

Forum Jump:


Users browsing this thread: 1 Guest(s)