[richfaces-planning-issues] [JBoss JIRA] Commented: (RFPL-493) richfaces-selenium - implement guards for http/xhr/no request types

Lukas Fryc (JIRA) jira-events at lists.jboss.org
Wed Apr 7 07:06:38 EDT 2010


    [ https://jira.jboss.org/jira/browse/RFPL-493?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12524199#action_12524199 ] 

Lukas Fryc commented on RFPL-493:
---------------------------------

Code snipper for creating proxy for ActiveXObject (Internet Explorer):

var _ActiveXObject = ActiveXObject;

var ActiveXObject = function(type, location) {
  var realActiveXObject = (location) ? new _ActiveXObject(type, location) : new _ActiveXObject(type);

  type = type.toLowerCase();
  if (type == "msxml2.xmlhttp" || type == "microsoft.xmlhttp") {
    var proxy = {
   	  activeXObject : realActiveXObject,
      responseText: "",
      responseXml: null,
      readyState: 0,
      status: 0,
      statusText: 0,
      onReadyStateChange: null
    };
    proxy.activeXObject.onReadyStateChange = function() {
		proxy.readyState = proxy.activeXObject.readyState;
		if (proxy.readyState == 4) {
			proxy.responseText = proxy.activeXObject.responseText;
			proxy.responseXml  = proxy.activeXObject.responseXml;
			proxy.status       = proxy.activeXObject.status;
			proxy.statusText   = proxy.activeXObject.statusText;
		}
	 if (proxy.onReadyStateChange) proxy.onReadyStateChange();
      };
    proxy.abort = function() {
	    return this.activeXObject.abort();
    };
    proxy.getAllResponseHeaders = function() {
	    return this.activeXObject.getAllResponseHeaders();
    };
    proxy.getResponseHeader = function(name) {
	    return this.activeXObject.getResponseHeader(name);
    };
    proxy.open = function(method, url, asyncFlag, userName, password) {
    	//this.activeXObject.onReadyStateChange = this._onReadyStateChange;
    	return this.activeXObject.open(method, url, asyncFlag, userName, password);
    };
    proxy.send = function(content) {
    	return this.activeXObject.send(content);
    };
    proxy.setRequestHeader = function(name, value) {
		return this.activeXObject.setRequestHeader(name, value);
    };
  }
  else {
    var proxy = realActiveXObject;
  }

  return proxy;
}

> richfaces-selenium - implement guards for http/xhr/no request types
> -------------------------------------------------------------------
>
>                 Key: RFPL-493
>                 URL: https://jira.jboss.org/jira/browse/RFPL-493
>             Project: RichFaces Planning
>          Issue Type: Sub-task
>          Components: QA
>            Reporter: Lukas Fryc
>            Assignee: Lukas Fryc
>             Fix For: 4.0.0.ALPHA2
>
>
> Task desc in following email:
> Hi,
> I'm trying to implement to our richfaces-selenium library new requirement:
> guarding what type of request will be actually done when triggering action like selenium.{click,fireEvent,type,...}.
> I identified 3 types of request used in LiveDemo:
> - XHR request
> - regular HTTP request
> - no request
> Advice needed in following:
> a) Is following access to guard XHR/HTTP requests right?
> - set the global variable like _richfaces_selenium_guard_xhr = true;
> - if it will equal undefined after triggering action, HTTP request was done, otherwise it was XHR (or no request!)
> b) how to guard that no request will be done (client-side actions) and distinguish such request from XHR?
> c) how to call regular HTTP request in API? Proposal:
> guardAjaxRequest(selenium).click(...) - XHR
> guardHttpRequest(selenium).click(...) - regular HTTP (no XHR)
> guardNoRequest(selenium).click(...) - no request 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the richfaces-planning-issues mailing list