• Type: Task
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.1.3
    • Fix Version/s: 2.2.2
    • Component/s: Quality Assurance
    • Security Level: Public (Public: Anyone can view)
    • Labels:
    • Rice Team:
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required


      Here's the pattern where only the first 3 vars need to be updated to test each page of the Kitchen Sink as KNS and KRAD.

      var viewId = "viewId=UifCompView";
      var page = "#UifCompView-Page2"
      var pageLoadedText = "Cancel";
      var baseUrl = "";
      var testUrl = baseUrl + ""+baseUrl+"kr-krad/uicomponents?"+viewId+"&methodToCall=start&readOnlyFields=field91"+page;
      var timeoutSeconds = 240; 
      var username = "loadtester" + test.getUserNum();
      //var username = "admin";
       * Test is the main control interface for Neustar Web Performance Management scripts. It is
       * exposed here as the global variable 'test'. This object is effectively the "starting
       * point", as it serves as the interface for interacting with web sites (via
       * test.openBrowser() and test.openHttpClient() as well as the mechanism for controlling
       * transactions and steps (via test.beginTransaction() and test.beginStep(String)).
       * For full documentation, see:
      // First: Decide if you want to use a real web browser (Real Browser Script)
      var webDriver = test.openBrowser();
      webDriver.manage().timeouts().implicitlyWait(timeoutSeconds, TimeUnit.SECONDS);
      // ... or if you want a simple HTTP traffic test script (Basic Script)
      var c = test.openHttpClient();
      // By default SSL Certificates are not validated.
      // If you turn SSL Certificates Validation on, trying to connect
      // to a Server that returns an invalid SSL Certificate will throw an exception.
      // To turn SSL Certificate validation ON, uncomment the following line:
      // c.setCheckValidSSL(true);
      // Blacklist requests made to sites like Google Analytics and DoubleClick.  See the
      // HttpClient.blacklistCommonUrls() documentation for a list of URLs currently blocked by
      // this function.
      // You can optionally enable Bandwidth limitation for your script.
      // Uncomment the following lines to simulate a business DSL line.
      test.setDownstreamKbps(1000);           // 1 Mbps (max 6500 Kbps RBU, 1000 Kbps VU)
      test.setUpstreamKbps(384);              // 384 Kbps (max 6500 Kbps RBU, 1000 Kbps VU)
      test.setLatency(50);                    // 50 ms latency
      // For load testing, you can get the unique user number (0 -> max users)...
      //var userNum = test.getUserNum();
      // ... or the transaction count for that specific user
      //var txCount = test.getTxCount();
      // This can be useful in load testing scripts for applying different actions for different
      // users or after a certain number of transactions.
      // Start a new transaction.  This is needed to start recording HTTP traffic and timings.
      // Transactions are grouped into "steps".  You can do work outside of a step, but it won't
      // be recorded in the reports and charts. To record timings, start a step.
      test.beginStep("Step 1 - " + testUrl);
      // Steps optionally also take a timeout.  The following will timeout if the step takes
      // more than 30 seconds.
      // test.beginStep("Description of Step 1", 30000);
      // At this point you can either control the browser using the webDriver API...
      // Navigate the browser to the given URL
      // Here is an example on how to check for text present on the body of the page
      var bodyText = webDriver.findElement(By.tagName("body")).getText();
      if (!bodyText.contains("not available for registration")) {
          // thrown exceptions will also cause the monitor to record an error
          throw "Expected content not found!";
      /* Here is how you use the HTTP client if you're creating a Basic Script
      var resp = c.get("", "not available for registration");
      if (!resp.isContentMatched()) {
          // Couldn't find 'not available for registration'
          throw "Expected content not found!";
      }"", "Could not log in", {
          username: 'bob',
          password: 'mypassw0rd'
      if (resp.isContentMatched()) {
          throw "Unable to log in!";
      var bodyText = webDriver.findElement(By.tagName("body")).getText();
      if (!bodyText.contains("Login") || !bodyText.contains("Username") ) {
          throw "Expected content Login or Username not found!";
      // End the step. You can begin additional steps after this call if you'd like.
      test.beginStep("Step 2 - __login_user");
      test.beginStep("Step 3 - input[type=\"submit\"]");
      var start = java.util.Calendar.getInstance().getTimeInMillis();
      webDriver.manage().timeouts().implicitlyWait(timeoutSeconds, TimeUnit.SECONDS);
      var containerFrame;
      if(webDriver.findElements(By.xpath("//iframe")).size() > 0) {
      containerFrame = webDriver.findElement(By.xpath("//iframe"));
      if(webDriver.findElements(By.xpath("//iframe")).size() > 0) {
      contentFrame = webDriver.findElement(By.xpath("//iframe"));
      bodyText = webDriver.findElement(By.tagName("body")).getText();
      if (!bodyText.contains(pageLoadedText)) {
          throw "Expected content " + pageLoadedText + " not found!";
      var time = java.util.Calendar.getInstance().getTimeInMillis() - start;
      test.log(viewId + " " + time + "ms.");
      test.beginStep("Step 4 - Logout");
      webDriver.findElement(By.xpath("//input[@name='imageField' and @value='Logout']")).click();
      bodyText = webDriver.findElement(By.tagName("body")).getText();
      if (!bodyText.contains("Login") || !bodyText.contains("Username") ) {
          throw "Expected content Login or Username not found!";
      // Finally, end the transaction.  Saving the transaction, it's steps and the total time the
      // transaction was executing.


          Issue Links


            eghm-kuali-m Erik Meade added a comment -

            Updated code to include use of test.getUserNum for loadtester user id.

            eghm-kuali-m Erik Meade added a comment - Updated code to include use of test.getUserNum for loadtester user id.
            jcoltrin Jessica Coltrin (Inactive) added a comment -

            moving to 2.2.2-QA

            jcoltrin Jessica Coltrin (Inactive) added a comment - moving to 2.2.2-QA
            vchauhan Viral Chauhan (Inactive) added a comment -


            vchauhan Viral Chauhan (Inactive) added a comment - Fixed


              • Assignee:
                vchauhan Viral Chauhan (Inactive)
                eghm-kuali-m Erik Meade
              • Votes:
                0 Vote for this issue
                0 Start watching this issue


                • Created: