views:

123

answers:

1

I have TestGen4Web script for automating testing on a web-based user interface that has a popup window (hey i didn't write that ui..). In order to write a complete test script that branches the flow based on the some presence of some content in the popup window, I need to write a simple if condition that does something like if document.getElementById("xyz").value - that will run on the popup window and not the parent window.

Any ideas on how to accomplish this? currently, the condition fails because it runs on the parent window.

Also, how to extract some text from the dom and spit it out to a file at the end of the test?

A: 

Talked with the author of TestGen4Web. He concluded this was a bug and will be fixed in the next release. Here is the email with the temporary workaround fix:

I have a fix for your problem - which I will add in the next release. Until then, you can use this patch.

Under your profile's extensions/{3c20433a-61bc-42fe-831d-415860e17283}/chrome/recorder/cont ent/ directory,

  1. find recorder.js under the extension installation directory.
  2. in recorder.js, find the method named

Recorder.prototype.fixAction = function(action) {

  1. just before the return method, add the following 2 lines.

newAction.winref = this.fixDatasetsAndVariables(newAction.winref); newAction.pagerefreshed = this.fixDatasetsAndVariables(newAction.pagerefreshed);

  1. restart firefox, and run your test.

Hope that solves your problem. Let me know if there are more issues with the fix.


  1. outside your loop initalize a loop count variable initialize it to "1" ('count', in the attached example) 2. replace all "tg4wnamed1" with "tg4wnamed${count}"


  2. outside your loop initalize a loop count variable initialize it to "1" ('count', in the attached example) 2. replace all "tg4wnamed1" with "tg4wnamed${count}"

GotoError