Forum Discussion

Ruby1's avatar
Ruby1
New Contributor
2 years ago

JavaScript runtime error. Unspecified error

Am Entering the authorization number in a page and on click of search button, it lands in another page.(Result page)

In result page am trying to get the text of the element 'auth number'. 

and i got JavaScript runtime error. Unspecified error ..

this error is inconsistent, it does  not occur all times

 

 

 

var Wait = require("Wait");

 

var browser = Sys.Browser();
var page = browser.Page("*");

//Page objects
fetchAuthNo = page.FindChildByXPath("//input[@id='authorizationNumber']");
fetchSubmissionStatus = page.FindChildByXPath("//input[@id='submissionStatus']");

function VerifySearchResult(){
Delay(500);
Log.Message(fetchAuthNo.Text);
aqObject.CompareProperty(fetchAuthNo.Text,0,"0010PA22092200001",true,2);
Log.Message(fetchSubmissionStatus.Text);
aqObject.CompareProperty(fetchSubmissionStatus.Text,0,"COMPLETED",true,2);

}

1 Reply

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    Since it works some times and not others, I would try checking for the page to exist before you do the FindChild. It sounds like the page isn't completely loading before the check is done so the child can't always be found.