Alternative to window.opener

I want to  create an application testing tool (window 1) which will invoke methods in window 2 with various test values, but I don't want to have non application specific code in the window containing the application to be tested (window 2).  I'm using IE5.

What I have seen in the past is one window creating another and the created window using window.opener to refer back to the first window.  However, I don't want the tested window to contain any references to the testing window, but don't mind if the testing window has to be told "by hand" about the window to be tested.  
tweegaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tweegaAuthor Commented:
Edited text of question.
0
tweegaAuthor Commented:
Edited text of question.
0
PBallCommented:
I don't know of any other way to get a reference of another window without the parent - child relationship (opener property of the child).

If stress testing your web application is your goal, you might want to take a look at MS Web Application Test (formerly Homer) instead.  Downloadable free from Microsoft site.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

gpeeraerCommented:
If i understand correctly:

window1 creates window2 and thus window2 knows about window1 via window.opener

If you want to make this impossible set the opener property to the null value. After that the second window cannot reference the first.

thus in windows1 do

mynewwindow = windows.open(...)
mynewwindow.opener = null

hope this helps
0
tweegaAuthor Commented:
Many thanks for both comments.  I have been onto the Microsoft Site and downloaded 'Homer' - though I have not yet had a chance to run it or read its documentation yet.  Still, it sounds an interesting package.  Thanks again.

As for setting .opener to null - it wasn't quite what I was trying to do, although I appreciate your help all the same.    If you imagine that Window 1 has an input box into which one can type any characters, and that there is a method on the page that can validate the value, and another that can post it to the server.  I want to test that the system works by firing various random character strings at the box over the course of 24 hours (each time calling the relevant validate and post methods, and then waiting for a state variable to indicate the completion) to see how the system copes.  But I don't want to add code to Window 1 (i.e. code to test itself) that won't be in the release code.  I was sort of hoping with a rather wild and unthought-through optimism that one window might be able to communicate with another without some sort of parental link existing between the two.  Quite what I had in mind I'm not sure.  Anyway, I thought it was worth a fish.

It's my last day at the keyboard till the new year, so I'll hold out for any more comments till this pm and then close the question then.
0
gpeeraerCommented:
if you can distuinguish the completion of window1 by looking at the URL/address then you could write a script with an infinite loop which regurlarly sleeps and checks the URL/address of the other window.

window1 does not have to know about window2 and window2 can access all of the information in window1, when he needs to.

hope this helps

0
tweegaAuthor Commented:
Sounds spot on, but how does window2 get hold of the window1 object?
0
gpeeraerCommented:
in window2 do

window1 = window.open("applicationtotest.asp",...)
....
//  access from within window2 by referencing window1
window1.forms[0].inputname.value = "whatever you want"
window1.forms[0].submit(); // to submit the form in the other


Aroun this you can create an infinite loop which checks the window1.location once and a while as to see if you give input or not



0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tweegaAuthor Commented:
of course.  I was just in the process of starting to write to write to you again to say I had twigged what you meant.  I had hoped the solution would at least involve a polynomial equation, but the blindingly obvious will do even better.  Many thanks.

Merry Christmas. tweega.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.