![]() |
Failed to run test due to unknown error: Need help! - 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: Failed to run test due to unknown error: Need help! (/Thread-Failed-to-run-test-due-to-unknown-error-Need-help) |
Failed to run test due to unknown error: Need help! - Renu0113 - 09-26-2009 Hi, I have written the following function to calculate the loading time. Objective: Open Google Page Click on any link (say, Maps) Calculate time required for the Google Maps page to load Code: Public Function CheckLoadTime(ByVal LnkName,ByVal BroName,ByVal PagName) Now, when I run the test, GoogleMaps opens, but I get a error as "Failed to run test due to uknown error" and it points to Line(6): Code: Browser("Bro_Google").Page("Pag_Google").Link(LnkName).Click Can someone please tell me where I am going wrong?I know,perhaps my basics are not in place, but I am learning. Thanks, Joshi RE: Failed to run test due to unknown error: Need help! - Saket - 09-26-2009 I guess you are passing name of link to the Lnkname as parameter to the function. So you should use DP here to identify the link you need to click try this Code: Browser("Bro_Google").Page("Pag_Google").Link("name:=" & LnkName).Click RE: Failed to run test due to unknown error: Need help! - Renu0113 - 09-29-2009 Hi Saket, I tried your suggestion, but there is still an issue. The code is now: Code: Public Function CheckLoadTime(ByVal LnkName,ByVal BroName,ByVal PagTitle) What is happening is: Maps link is clicked..qtp quickly runs through the next steps, even the last step and then, i see that it stops at Step6 again which is Code: Browser("Bro_Google").Page("Pag_Google").Link("name:="&LnkName).Click Why doesnt it stop at msgbox and just get the output? I dont get this behavior. Either you/someone please help me! RE: Failed to run test due to unknown error: Need help! - Saket - 09-29-2009 I guess you are trying to get the page load time with this function. right? But what I am not able to understand here is why do you need to call the same function twice in your script. Code: Call CheckLoadTime("Maps","Google Maps","Google Maps") you can just get your output with a single statement only Code: msgbox CheckLoadTime("Maps","Google Maps","Google Maps") I just tried with your code and it works fine with a single statement. let me know if there is any issue Suggestion: use Services.StartTransaction and Services.EndTransaction to get the page load time see if this helps you. RE: Failed to run test due to unknown error: Need help! - basanth27 - 09-29-2009 Why not use like this, Code: Public Function CheckLoadTime(ByVal LnkName,ByVal BroName,ByVal PagName) |