kroe761
11 years agoContributor
Getting "object doesn't support this property or method" - doesn't make sense?
I am writing web tests using JScript and have several files. At the top of the main test I am running, I include //USEUNIT plus the file I am importing. The file I am importing is basically just a mapping script consisting of various buttons, fields, etc for a particular page. The test I am running checks an internal tab on a CRM page, checks the value, submits, and then clicks the same tab and see if any changes are made. When I click the tab the first time, it works, but COPYING the code for the when I click it the second time, I get the MS JScript error "object doesn't support this property or method." How can tihs be? Basically, it's this
//USEUNIT my_mapping
function testing()
{
// code..
obj = my_mapping.object()
obj.Click()
// more code...
obj = my_mapping.object() //<-here is where I get the error
obj.Click()
// more code...
}
If my code just didn't work, or the object couldn't be found, then it would fail in the object() method, but why is TC saying my_mapping doesn't support the object() method when it just worked prviously?
Also, when I copy the code out of the function and use it by itself instead of calling the my_mapping.object() method, it works with no problems, so it's not my code, at least not that I can tell.
Addiotinally, if I copy the function to the main file, and run it that way (like, instead of my_mapping.object() I would just call object() ) it works with no problems.
This is really weird. Thanks!
//USEUNIT my_mapping
function testing()
{
// code..
obj = my_mapping.object()
obj.Click()
// more code...
obj = my_mapping.object() //<-here is where I get the error
obj.Click()
// more code...
}
If my code just didn't work, or the object couldn't be found, then it would fail in the object() method, but why is TC saying my_mapping doesn't support the object() method when it just worked prviously?
Also, when I copy the code out of the function and use it by itself instead of calling the my_mapping.object() method, it works with no problems, so it's not my code, at least not that I can tell.
Addiotinally, if I copy the function to the main file, and run it that way (like, instead of my_mapping.object() I would just call object() ) it works with no problems.
This is really weird. Thanks!