Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I searched online, but couldn't find anything about how to stop page loading over a browser using selenium web-driver.

Any idea for the same?

share|improve this question
    
Can you explain what you mean by 'stop page loading' ? –  Phil Kirkham Feb 4 '13 at 18:51
    
he wants the page to stop loading... –  squeemish Feb 4 '13 at 19:13
add comment

4 Answers

This might be useful.

driver.findElement(By.tagName("body")).sendKeys("Keys.ESCAPE");

OR

JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("return window.stop");
share|improve this answer
add comment

Here is a function you may call to set the page load timeout you need.

share|improve this answer
add comment

If you want to simulate the browser's STOP button, this post should help you out http://stackoverflow.com/questions/5453423/how-to-stop-the-page-loading-in-firefox-programaticaly

share|improve this answer
    
yeah! I have gone through that post earlier,but couldn't understand how to really write it... as that was shorthand code. can you help me on that? –  CodeLover Feb 5 '13 at 18:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.