JavaScript error
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2017
04:08 AM
11-15-2017
04:08 AM
JavaScript error
Hi ,
I am getting a javascript error using the below code.
Code:
var Page = Sys.Browser("chrome").Page("*");
function InviteSupplier()
{
Page.FindChildByXPath("//span[contains(text(),'Invitation to Join')]").Click();
}
Error:
TypeError Cannot read property 'Click' of null Error location: Unit: "V1 product codes\V1 product codes\Script\Function_Library" Line: 44 Column: 73.
TypeError
Cannot read property 'Click' of null
Error location:
Unit: "V1 product codes\V1 product codes\Script\Function_Library"
Line: 44 Column: 73.
Cannot read property 'Click' of null
Error location:
Unit: "V1 product codes\V1 product codes\Script\Function_Library"
Line: 44 Column: 73.
2 REPLIES 2
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2017
04:16 AM
11-15-2017
04:16 AM
Hi nitinn,
Looks like something is wrong with your xpath, TestComplete doesn't find the element and FindChildByXPath method returns null.
Gennadiy Alpaev
Software Testing Automation Tips - my new book
TestComplete Cookbook is published!
About Community Experts
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2017
05:24 AM
11-15-2017
05:24 AM
It's always a good idea that, when using any Find method, that, before you use the result you check to see if you actually found something.
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
