We are new to Protractor and Jasmine. We are trying to automate E2E testing of Angular application using Protractor and Jasmine. As part of the test data input we would like the script to read the data from an excel file (*.xls, *.xlsx). But I am unable to find any reference to this information. I really appreciate if anyone can give the exact approach to read data from excel as an input to the automation script.
Cheers
Please note : Only reason I am posting a standard snippet is bcoz we are actually trying to get the input as excel for this specific script (as our learning curve). Appreciate all the help. Thank you.
Sample Code:
describe('Test Calculator', function() {
var firstNumber = element(by.model('first'));
var secondNumber = element(by.model('second'));
var goButton = element(by.id('gobutton'));
function ReadDataFromExcel() {
// Code to read first number & second number from Excel;
};
it('Testcase 1', function() {
browser.get('http://juliemr.github.io/protractor-demo/');
// ReadDataFromExcel()
// for each record in EXCEL; perform below operation;
// {
firstNumber.sendKeys(a);
secondNumber.sendKeys(b);
goButton.click();
// Always perform '+' operation
// }
});
});
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
--
[ { "someId": "signInButton", "sendSomeKeys": "j...@j.com" }, { "someId": "passwordButton", "sendSomeKeys": "password" }]
'use strict';
var testData = require('./path/to/json.json');
describe('your test', function() { testData.forEach( function (data) { it('should read from an external json', function(){ element(by.id(data.someId)).sendKeys(data.sendSomeKeys); }); });});
--
You received this message because you are subscribed to a topic in the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/szvTofhwp1M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
--BALAJI SINGH .Y
--
You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe@googlegroups.com.
and have your test use that instead of excel
For Test Data ex: +ve and -ve how we can you do using mysql etc..?
Thanks & Regards,Ranjith Samalla9440247045
On Thu, Apr 19, 2018 at 6:13 PM, Tito <yos...@gmail.com> wrote:
well you could try databases such as
mysql
postgres
sql server
and have your test use that instead of excel
--
You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscribe@googlegroups.com.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
--BALAJI SINGH .Y