Share
Go down
abhayshankar
Posts : 6
Join date : 2012-02-13
Age : 31
Location : Bangalore

user-extensions.js file is needed

on Wed Feb 22, 2012 8:35 pm
I am doing data driven testing using selenium IDE.for that i want user-extensions.js file.
Someone please help me to get that file.
faramka
Professional
Professional
Posts : 143
Join date : 2011-09-15
Location : Poland

Re: user-extensions.js file is needed

on Wed Feb 22, 2012 8:42 pm
abhayshankar
Posts : 6
Join date : 2012-02-13
Age : 31
Location : Bangalore

Re: user-extensions.js file is needed

on Thu Feb 23, 2012 12:51 pm
Hi,thanks for reply.Now i am getting this error.---->
Failed to load user-extensions.js!
files=/home/abhay/Desktop/S-IDE/datadriven_v0.2/user-extensions.js
lineNumber=64
error=SyntaxError: syntax error
zlos7ar
Amateur
Amateur
Posts : 41
Join date : 2012-01-13
Age : 30
Location : Germany

Re: user-extensions.js file is needed

on Thu Feb 23, 2012 7:50 pm
the file has an error on line 64 you have to fix it or create a new post on the forum and paste the broken code there and maybe someone can help you then Smile
abhayshankar
Posts : 6
Join date : 2012-02-13
Age : 31
Location : Bangalore

Re: user-extensions.js file is needed

on Thu Feb 23, 2012 8:35 pm
XML.serialize = function(node) {

if (typeof XMLSerializer != "undefined")

return (new XMLSerializer()).serializeToString(node) ;

else if (node.xml) return node.xml;

else throw "XML.serialize is not supported or can't serialize " + node;

}


function xmlTestData() {

this.xmlDoc = null;

this.testdata = null;

this.testRepeatCount= 0;

this.dataFilePath="file:///home/abhay/Desktop/S-IDE/datadriven_v0.2/TestData.xml";

this.index = null;

}



http://xmlTestData.prototype.load = function(xmlloc) {

loader = new IDEIncludeCommand();

var xmlHttpReq = loader.getIncludeDocumentBySynchronRequest(xmlloc);

this.xmlDoc = xmlHttpReq.responseXML;


this.index = 0;

this.testdata = this.xmlDoc.getElementsByTagName("test");


if (this.testdata == null || this.testdata.length == 0) {

throw new Error("Test data couldn't be loaded or test data was empty.");

}

}


xmlTestData.prototype.EOF = function() {

if (this.index != null && this.index < this.testdata.length) return false;

return true;

}


xmlTestData.prototype.more = function() {

return !this.EOF();

}


xmlTestData.prototype.next = function() {

if (this.EOF()) {

LOG.error("No test data.");

return;

}


LOG.info(XML.serialize(this.testdata[this.index])); // Log should anything go wrong while testing with this data.


if (this.testdata[this.index].attributes.length != this.testdata[0].attributes.length) {

LOG.error("Inconsistent attribute length in test data.");

return;

}


for (i=0; i
if (null == this.testdata[0].getAttribute(this.testdata[this.index].attributes[i].nodeName)) {

LOG.error("Inconsistent attribute names in test data.");

return;

}


selenium.doStore(this.testdata[this.index].attributes[i].nodeValue, this.testdata[this.index].attributes[i].nodeName);

}


this.index++;

}


Selenium.prototype.testdata = null;


Selenium.prototype.doLoadTestData = function(xmlloc) {

testdata = new xmlTestData();

testdata.load(xmlloc);

};


Selenium.prototype.doNextTestData = function() {

testdata.next();

};
Sponsored content

Re: user-extensions.js file is needed

Back to top
Permissions in this forum:
You cannot reply to topics in this forum