Window.close and self.close dont work when Played, works when double clicked

Hi, this test:

open |
runScript |"")
pause | 2000 
runScript | window.close("")
runScript | window.close("")
runScript | self.close("")

doesnt work on firefox when using “Play” option
If i double click on any of the last 3 commands they will successfully close the current tab (window)
But the “Play” will just mark them green and move on, without actually closing the window.

Test done in Firefox

Any idea why is this happening, and how can i make it work ?

anyone ? i coudl really use some help here

I can open and close a window like this

open || |
openWindow | | winID |
selectWindow | winID | |
pause | 2000 | |
close | | |

or like this

open | | |
runScript | document.myWindow ="") | |
pause | 2000 | |
runScript | document.myWindow.close() | |

Note that there is a security feature of JavaScript that means only windows that have been opened with JavaScript can be closed by JavaScript.

Also note the first method only seems to work with new tabs. If it is run again on the same tab an error occurs

[error] TypeError: Cannot read property 'root' of undefined

Thanks, somewhat this works but not really…

First solution doesnt work at all,

 [info] Executing: | openWindow | | winID |

 [error] 'open' called on an object that does not implement interface Window.

The second solution works, but im unable to read the content of the newly created window.
I try to do :

 storeText | //body |AllText_1

between lines 3&4 but what happens is the body of the page BEFORE is stored in the variable, not from the newly created window :frowning:

So the problem is :

open | | |
runScript | document.myWindow ="") | |
pause | 2000 | |
storeText | //body |AllText_1
runScript | document.myWindow.close() | |

And the Variable AllText_1 contains the text from, while it should’ve grabbed it from

Anything we can do about that ?
thx !

There does seem to be a problem. I thought my examples were working but it was only because I was using the same URL for open and openWindow, but if I use different URLs then only the text from the first window is stored.
I tried using document.myWindow.focus() and openWindowAndWait and all sorts of combinations, but nothing worked.
I’m probably missing something here so I’ll have to go back to the drawing board :confused: