Ask a Question

Getting error "Object doesn't support this property or method" for method that's been executed befor

kmathur
Occasional Contributor

Getting error "Object doesn't support this property or method" for method that's been executed befor

Hi 

 

Here is what I am having issue with. 

I have written a method called "openInViewer" which is in the same script. The method is called after every scenario so like times. It execute fine for the first time but from then on it throws error as "Object doesn't support this property or method" for that method. 

Here is a sample code 

 

// works fine 

exportService("KML",resultFile);
openInViewer(resultFile);

 

//Next line 

exportService("Shapefile",resultFile);
publishFSFromFile(itemURL,"Shapefile",resultFile);
openInViewer(resultFile); //Fails with the error

 

Thanks in advance for suggestions. 

 

7 REPLIES 7
tristaanogre
Community Hero

Re: Getting error "Object doesn't support this property or method" for method that's been

We need to know a bit more about what's going on inside "openInViewer".  I'm guessing here, but I'm thinking that your error reported is being reported inside openInViewer and not in the other code, correct?  So... in order to help you debug openInViewer, we need to see that code.

 

 


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
Marsha_R
Community Hero

Re: Getting error "Object doesn't support this property or method" for method that's been

Well, your "works fine" example is not exactly like your "Next line" example, so we know there is something different happening.

 

If you try commenting out the "publishFSFromFile" line and run the "Next line" example, does it work without giving the error?


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
kmathur
Occasional Contributor

Re: Getting error "Object doesn't support this property or method" for method that's been

Hi 

 

So the original code is using publishFSFromFile method 5 times (I am using it to test different file types). The openInViewer() works fine for the first time and failing after that. I can re order the methods but it always works fine for the first time and then failing. 

So here is the complete code 

 

exportService("Shapefile",resultFile);
publishFSFromFile(itemURL,"Shapefile",resultFile);
openInViewer(resultFile);

 

exportService("CSV file",resultFile);
publishFSFromFile(itemURL,"CSV",resultFile)
openInViewer(resultFile);

 

exportService("FGDB",resultFile);
publishFSFromFile(itemURL,"FGDB",resultFile)
openInViewer(resultFile);

 

exportService("GeoJson",resultFile);
publishFSFromFile(itemURL,"GeoJSON",resultFile)
openInViewer(resultFile);

 

So the code works fine for "Shapefile" and fails after that. If I bring "CSV file" part before that, I will execute perfectly for that and fails for "Shapefile" 

 

 

kmathur
Occasional Contributor

Re: Getting error "Object doesn't support this property or method" for method that's been

Hi 

 

Thanks for the reply. There is nothing wrong in the OpenInViewer code as it executes fine for the first time. 

tristaanogre
Community Hero

Re: Getting error "Object doesn't support this property or method" for method that's been

So, again... what is going in on openInViewer?  What is going on in your publishFSFromFile? All we can see is the methods your executing...  the problem is probably something within one of those two methods or even both in some way... without the code, we can't help debug it.


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
tristaanogre
Community Hero

Re: Getting error "Object doesn't support this property or method" for method that's been


@kmathur wrote:

Hi 

 

Thanks for the reply. There is nothing wrong in the OpenInViewer code as it executes fine for the first time. 


I think you're missing the point....  the point is that there is a method or property being called in OpenInViewer that is failing... We don't know what that is because we don't have the code.  While it executes fine the first time, obviously something that is going on in your test process is causing it to fail in subsequent times.  Without the code, all we can do is say, "Yup... that's an error."

 

So...  screenshots of the "Additional Info" panel in the error log for the error message, full text of the message from the error log, code from openInViewer and the publish method, and any indication as to what line within openInViewer is generating the error.  The problem is not in TC... it's in your code... so we need your code and any relevant information to figure out what's wrong.


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
Marsha_R
Community Hero

Re: Getting error "Object doesn't support this property or method" for method that's been

Yes, what @tristaanogre said.  All we can go by is what you post and right now it seems to be a moving target.  Post all the details at once and we can help better.   

 

p.s.  It might still be openInViewer but we don't have enough details to tell yet.


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
cancel
Showing results for 
Search instead for 
Did you mean: