views:

39

answers:

3

I need to set a window.id on the target of an HTML form. The motivation is for Selenium automation tests. How would I access this window?

A: 

Add it inline with the <form> tag:

<form id="myId">
</form>
Jim Fell
isn't that just the form element? I didn't think that id would apply to the target (in this case a new window) of the form.
stevebot
A: 

I'm not sure this is the best answer but you could try passing the id you want through a in the form and then on the new page grab the value and set window.id accordingly.

Aaron Hathaway
+1  A: 

In other words, you have a new window already created and you want to set the target of your form to that new window? Instead of creating your new window with _blank, name it something. Then set the target of your form to it.

Brad