This is the continuation of previous post involving advanced concepts of Data-driven tests using Selenium IDE. It helps you while giving a Demo or to do a primary check over the tests again & again. Selenium IDE have an additional feature called user-extensions that gives support to data-driven tests.
Selenium IDE [Data Driven]
1| Download the javaScript files, datadriven.js | goto_sel_ide.js | user-extensions.js from link
2| Open Notepad
3| Copy & Paste following tags and replace the keywords highlighted in Orange with your text.
<testdata>
<test phrase="seleniumworks.com"/>
<test phrase="fire & safety"/>
<test phrase="selenium"/>
<test phrase="Prashanth Sams"/>
</testdata>
4| Save it as a .xml file. e.g., googlesearches.xml
5| Open Selenium IDE.
6| Click Option > Options...
7| Click on Browse under 'Selenium Core extensions (user-extensions.js)'
8| Select all the 3 .js files downloaded earlier [datadriven.js | goto_sel_ide.js | user-extensions.js]
9| Click Ok
10| Restart Selenium IDE
11| Now, Record the script and edit them in Selenium IDE for proper looping.
loadTestData | file://c:/googlesearches.xml | |
while | !testdata.EOF() | |
nextTestData | ||
open | http://www.google.co.uk | |
type | q | ${phrase} |
click | btnG | |
endWhile |
12| Run the Test case
Prashanth,
ReplyDeleteHow to associate the xml file path to user extensions..? i think that information missing over here.
Thanks
Balaji
Aniket,
ReplyDeleteAfter adding extensions and restartnig the IDE it is showing the following Error
Failed to load user-extensions.js!
files=D:\Automation Data\Import Export\User Extensions\goto_sel_ide.js, D:\Automation Data\Import Export\User Extensions\datadriven.js, D:\Automation Data\Import Export\User Extensions\user-extensions.js
lineNumber=37
error=ReferenceError: XML is not defined
please give solution
thanks in advance
Add:
Deletevar XML = {};
before the script starts. It works just fine after that..
What do you mean by saying "Add: var XML = {}; before the script starts."
DeleteI have the same problem. If you can tell me more detailly,
it will help me a lot.
Type "var XML = {} ; " in the line before the error line in your user-extensions.js file
ReplyDeleteI have loaded all the above js files into selenium IDE. and also created a xml with the data given. After that I created the below test in IDE
ReplyDeleteloadTestData file://C:/test.xml
while !testdata.EOF()
echo ${phrase}
endWhile
While I run it, it goes for infinite loop i.e. it doesn't stop. And also instead of printing the real data it is printing "echo: ${phrase}".
Please help on this.
I'm having this issue too, except for the looping. It randomly decides to use the value listed in the file, and othertimes not. Very frustrating. It may be related to what text editor you use.
Deletewhat does the command click btnG do.
ReplyDeleteIt clicks the search button on google.
DeleteVery usefull, it works perfectly ! instead of installing goto_sel_ide.js as an extension you can use the FlowControl plugin
ReplyDeleteFollowing error coming after all the step you have suggested.
ReplyDelete[error] Unexpected Exception: Error: Error while fetching url 'file://E:/Selenium/Salesforce/Studentinfo' details: [Exception... "Failure" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://selenium-ide/content/tools.js -> file:///E:/Selenium/Salesforce/Modified_JS/user-extensions.js?1439609307028 :: IDEIncludeCommand.prototype.getIncludeDocumentBySynchronRequest :: line 83" data: no].
while i run .it's issue:
ReplyDelete[error] Unexpected Exception: Error: A element could not be loaded, or was empty..
Please help me
Hi,
ReplyDeleteWhen starting the IDE again, I get the following error:
"Failed to load user-extensions.js: SyntaxError: expected expression, got '<'"
I googled around but didn't find the answer.
Thanks for any help on this.
error: Unknown command: 'loadTestData
ReplyDeleteI'm getting this error why?? running through command line linux
I obtain such error :
ReplyDelete[error] Unexpected Exception: TypeError: activeBlockStack(...).top(...) is undefined.
Do you know what is the problem?
Hi Prashanth,
ReplyDeleteRequest you to update the scripts,
I am getting the below error message after restarting the IDE:
Failed to load user-extensions.js: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsILocalFile.initWithPath]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://selenium-ide/content/file-utils.js :: FileUtils.getFile :: line 32" data: no]
Thanks for splitting your comprehension with us. It’s really useful to me & I hope it helps the people who in need of this vital information. Selenium Training in Chennai
ReplyDeleteI am using .csv file and it works fine on my PC. For other PC's it is not working because of .csv file path. So, How can I write relative path in selenium IDE so that my test suite will run in all PC'S?
ReplyDeleteGood one about selenium IDE.Thank you.keep update software testing training with job guarantee
ReplyDeleteselenium training in chennai
selenium training in velachery
You are doing a great job. You inspire me to write for other. Thank you very much. I would like to appreciate your work for good accuracy and got informative knowledge from here... Java Training in Chennai | Pega Training in Chennai
ReplyDeletesimply superb ,mind blowing, I will share your blog to my friends also
ReplyDeleteselenium Online Training
Thanks for sharing this blog post,Nice written skill selenium Online Training Bangalore
ReplyDeleteThanks for the great blog! keep posting.
ReplyDeleteJAVA Training in Chennai
Java classes in chennai
core Java training in chennai
Selenium Training in Chennai
Selenium Training
Big Data Training in Chennai
Appreciating the persistence you put into your blog and detailed information you provide.
ReplyDeleteSelenium Training in chennai | selenium
off white
ReplyDeletegolden goose shoes
curry 7
curry 7 sour patch
kd 12
kd shoes
bape hoodie
yeezy boost 350 v2
golden goose
kd shoes
goyard outlet
ReplyDeletefear of god essentials
golden goose outlet