Skip to content

Instantly share code, notes, and snippets.

@n1k0
Created March 16, 2013 13:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save n1k0/5176302 to your computer and use it in GitHub Desktop.
Save n1k0/5176302 to your computer and use it in GitHub Desktop.
<b>iframe</b>
<title>My page</title>
<iframe src="frame.html"></iframe>
<script>
setTimeout(function() {
document.getElementsByTagName('iframe')[0]
.setAttribute('name', 'myFrame');
console.log('set');
}, 1000);
</script>
;(function() {
'use strict';
casper.start('page.html', function() {
this.test.assertTitle('My page');
this.wait(3000);
});
casper.then(function() {
// this will fail when 'name' attribute is added using js
casper.withFrame('myFrame', function() {
this.debugPage();
});
});
casper.run(function() {
this.test.done();
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment