I need help with making Protractor navigate to google.com and search for a term.
- After successfully loading the non-angular page of Google, I am struggling to figure out how to make Protractor press "enter" or click the search button. Any suggestions?
- Additionally, I'm having trouble finding resources on writing Protractor tests and understanding available functions. As a newbie in JavaScript and Angular, should I focus more on learning AngularJS concepts or Protractor concepts?
spec.js:
browser.waitForAngularEnabled(false);
describe('Enter Search Term', function() {
it('This test will fill in the text field on google.com', function() {
browser.get('www.google.com');
element(by.xpath('//*[@id="q"]')).sendKeys('What is Protractor?');
var query = element(by.xpath('//*[@id="q"]'));
expect(query = 'What is Protractor?');
browser.pause();
});
});
conf.js:
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['spec.js']
};