What is Protractor? How to write a test using Protractor Framework?

0
0

What is Protractor?

Protractor is an open-source automation testing framework it is written using NodeJS. It can offer combined end-to-end testing for web applications built using AngularJS. It can support both Non-Angular and Angular applications. It is used to test advanced HTML attributes, Protractor is widely preferred for testing AngualrJS. 

It leveraged the power of various technologies such as Selenium Webdriver, NodeJS, Jasmine, Cucumber, Mocha, etc. It offers a strong automation test it suite the capability of performing Cross Browser Testing for Web applications.   

How to write a test using Protractor Framework?

The Protractor is set up, to perform the test, one needs a spec file and a configuration file. The spec file is the actual test script, the configuration file specifies the details of the test such as to find the test file which the browser and framework to be used for running them along with other configurations. The configuration is not defined in the configuration file Protractor uses the defaults. 

The Scenario to be automated: 

Enter the search query "BrowserStack" in the search box.

Launch Google.com on the browser

Check out whether the title of the resulting page is "BrowserStack-Google Search" 

Config file for the Test

Specs file for this test scenario is saved as conf.js

exports.config = {

framework: 'jasmine',

capabilities: {

browserName: 'chrome',

},

specs: ['ProtractorTestScript.js']

};

Specs file for the Test

Specs file for this test scenario is saved as ProtractorTestScript.js

describe('Google\'s Search Functionality', function() {

it('can find search results', function() {

browser.driver.get('https://google.com/');

element(by.name('q')).sendKeys('BrowserStack');

element(by.name('btnG')).click();

//title of the launched webpage is expected to be BrowserStack - Google Search

expect(browser.getTitle()).toEqual('BrowserStack - Google Search');

});

});

Protractor is a well-known open-source end-to-end testing framework for Angular and AngularJS applications. It was developed by a team in Google on the top of WebDriver. Are you looking for a Protractor Online Course? Walk into FITA Academy is one of the best educational institutions to learn Protractor Online Training.

البحث
الأقسام
إقرأ المزيد
Health
Veterinary Dental Equipment Market Value Chain, Key Factor, Major Region Analysis and Forecasts Till 2027
Veterinary Dental (Dentistry) Equipment Market Research Report: By Product (Equipment, Hand...
بواسطة Diksha Pote 2021-07-09 06:08:08 0 0
Literature
beste lagene fra hver konferanse
fotballdrakter beste lagene fra hver konferanse   Major League Soccer presenterte sin...
بواسطة Gob Beits 2021-06-19 05:33:28 0 0
Literature
Air Jordan 8 Basketball Shoes Would you like its design?
Breakthrough concept art color AJ8 generationNew Jordans Release 2021 , The 8th generation of...
بواسطة Liza Zuwita 2021-05-20 05:10:17 0 0
Health
What Are The Different Ways To Treat Ear Infections?
You may panic as a parent, but nearly every child comes down with earaches. It is common among...
بواسطة Med Guard 2024-11-22 08:55:54 0 0
أخرى
사이트 검색엔진 어드바이저 작업 사이트 본문분석 확실한 서치랭커입니다. 전문적인 백링크 리스트 ★ How To Boost Your Multilevel Marketing Method
백링크 관련 어휘링크 주스 (Link juice): 이 용어는 특정 웹사이트나 페이지로 향하는 하이퍼링크 또는 백링크의 가치를 언급할 때 사용됩니다. 어떤 웹사이트나...
بواسطة Hovgaard Rossen 2021-09-15 15:42:02 0 0