Forum Discussion
smccafferty
12 years agoOccasional Contributor
You sir are a gentleman and a scholar.
Right.
The reason it's not working is the line:
localCourseID = setCourseID["Execute"]();
is trying to set localCourseID to a type of [object] (ie the setCourseID["Execute"]() object)
So it would never work...
My mistake was thinking that my original code would return an integer as a result of my query.
here's my problem in a nutshell.
I'm testing a website attached to a database.
On the website I create content / courses. They are assigned a new courseID (an integer) automatically.
That id is then used in the construction of the web pages used in the site to view/edit that content.
Therefore, everytime I run a test that creates said content, the url to edit or view that content is incremented and testcomplete has problems finding the pages it's meant to.
I was going to query the courseID from the database, store that returned value in a project variable and reconstruct the url for editing / viewing the course during the test run.
I wanted to avoid having to reset the database at the beginning of every test (although it would have to be done at some stage!)
Any advise for this problem gratefully received and thanks so much for your help so far.
Right.
The reason it's not working is the line:
localCourseID = setCourseID["Execute"]();
is trying to set localCourseID to a type of [object] (ie the setCourseID["Execute"]() object)
So it would never work...
My mistake was thinking that my original code would return an integer as a result of my query.
here's my problem in a nutshell.
I'm testing a website attached to a database.
On the website I create content / courses. They are assigned a new courseID (an integer) automatically.
That id is then used in the construction of the web pages used in the site to view/edit that content.
Therefore, everytime I run a test that creates said content, the url to edit or view that content is incremented and testcomplete has problems finding the pages it's meant to.
I was going to query the courseID from the database, store that returned value in a project variable and reconstruct the url for editing / viewing the course during the test run.
I wanted to avoid having to reset the database at the beginning of every test (although it would have to be done at some stage!)
Any advise for this problem gratefully received and thanks so much for your help so far.