Issue Details (XML | Word | Printable)

Key: SEL-42
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Darrell DeBoer
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Selenium

click + wait doesn't wait on meta refresh

Created: 07/Mar/05 08:22 AM   Updated: 16/Oct/06 02:07 AM
Component/s: Waiting
Affects Version/s: None
Fix Version/s: None

Environment: IE6 and Mozilla 1.7.3
Issue Links:
Relationship
 


 Description  « Hide

A "click" doesn't wait for a 0 time meta fresh to complete. This is likely because the browser actually finishes the page load before starting on the new one. My workaround was to change the meta refresh to a javascript one:

<meta http-equiv="refresh" content="0;URL=TargetPage.html">

changes to:

<script>window.location.href = "TargetPage.html";</SCRIPT>



Sort Order: Ascending order - Click to sort in descending order

I added a function to detect if refresh is present and the check to ensure that a page refresh was not triggered when you landed on a temporary page.

What is left: have better detection if you are visiting a page that autorefreshes itself.

modified selenium-executionloop.js:

line 85:
// Record the result so that we can continue the execution using window.setTimeout()
this.lastCommandResult = result;
if (result.processState == SELENIUM_PROCESS_WAIT) {
this.waitForCondition = function() { return selenium.browserbot.isNewPageLoaded() && selenium.browserbot.getCurrentPage().hasRefresh()==false; };
}

The method that is used:

PageBot.prototype.hasRefresh = function() {
// Create the text to search for

// Loop through all elements, looking for ones that have a value === our expected value
//<META HTTP-EQUIV="REFRESH" CONTENT="0;URL=show
var allElements = this.currentDocument.getElementsByTagName("meta");
if (allElements == null)
return false;

for (var i = 0; i < allElements.length; i++) { var testElement = allElements[i]; var he = testElement.httpEquiv; if (he == null || he.toLowerCase() != "refresh") continue; //assuming there is only 1 refresh element. so if you get past here //then return true or false (don't continue loop) //there are 2 types of refresh: a)refresh to current page // b) refresh to another page. Ensure this is type b. /* var cont=testElement.content.toString(); if (cont==null) return false; var ui = cont.toLowerCase().indexOf("url="); if (ui<0) return false; ui+=4; var si = cont.indexOf(";",ui); alert("cont="+cont); if (si<0) redurl=cont.substring(ui); else redurl=cont.substring(ui,si); //make absolute, truncate at ? //if the 2 urls are different, then true, hold off, wait for refresh return (currentDocument.URL != redurl); */ return true; }
return false;
};

Good Luck,
Keenan