Forum Discussion
veronica_glynn
11 years agoContributor
Hi there .. It sounds like I may be having a similiar problem with my JavaScript / framework scripts/files. A quick synoposis, we create online tests for students so that the Instructor may use them electronically as they see fit. Of course that is a very high level view, but I need to be able to edit questions within a test bank. Our ID's are dynamic. Actually everything in our system is dynamic, so my developer wrote me a couple lines of javaScript to help pull out the info I will need. My issue is trying to implement this in my scripts? I would appreciate any help.
I have 2 functions. Do I create a .js file and place it in my TestComplete folder?
Do I need to attach it to my Project? I keep reading that we call the function that is located on the 'Page' but this function does not appear within our script. It is an 'on the fly' item.
I am really lost. So any help offered would be mucho appreciated!
Example and what I 'think' I need to do (I am using VB )
editQuestion = Call Aliases.browser.pageCogneroTestGenerator.contentDocument.Script.function GetIDOfRightPaneElement(whichIndex)
{
var jArray = jQuery(".questionContentItem");
if (jArray.length > whichIndex)
{
return jArray[whichIndex].id;
}
else
{
return null;
}
}
I pretty much know that isn't correct. I just don't know what in the heck I need to do with it.
1. Do I create the .js file with my 2 javaScript functions and then reference it within my TestComplete Script?
2. If so, how do I do that? I could not find any 'helper' code that showed me how to correctly reference these items.
Thanks much and sorry for hijacking this forum issue.. :-)
I have 2 functions. Do I create a .js file and place it in my TestComplete folder?
Do I need to attach it to my Project? I keep reading that we call the function that is located on the 'Page' but this function does not appear within our script. It is an 'on the fly' item.
I am really lost. So any help offered would be mucho appreciated!
Example and what I 'think' I need to do (I am using VB )
editQuestion = Call Aliases.browser.pageCogneroTestGenerator.contentDocument.Script.function GetIDOfRightPaneElement(whichIndex)
{
var jArray = jQuery(".questionContentItem");
if (jArray.length > whichIndex)
{
return jArray[whichIndex].id;
}
else
{
return null;
}
}
I pretty much know that isn't correct. I just don't know what in the heck I need to do with it.
1. Do I create the .js file with my 2 javaScript functions and then reference it within my TestComplete Script?
2. If so, how do I do that? I could not find any 'helper' code that showed me how to correctly reference these items.
Thanks much and sorry for hijacking this forum issue.. :-)
Related Content
Recent Discussions
- 2 days agoMW_Didata