Protractor Beginner Tutorial 9 | POM in Protractor

  Рет қаралды 28,478

Automation Step by Step

Automation Step by Step

Күн бұрын

Пікірлер: 94
@venuaella887
@venuaella887 4 жыл бұрын
Hi Raghav, your Protractor video tutorials are amazing and simply superb, easily understandable. I started Protractor automation in my work by watching your videos and everything is working as expected, now I am confident....thank you very much for your community help.
@RaghavPal
@RaghavPal 4 жыл бұрын
So happy to know this Ven
@shwethabv5062
@shwethabv5062 3 жыл бұрын
Thank you for the tutorial, very helpful.
@RaghavPal
@RaghavPal 3 жыл бұрын
You are welcome Shwetha
@TorpiS70
@TorpiS70 3 жыл бұрын
Hi Raghav. Thanks for this tutorial. Very helpful!
@RaghavPal
@RaghavPal 3 жыл бұрын
Most welcome Ralph
@Gulbski
@Gulbski 3 жыл бұрын
You're a life saver
@RaghavPal
@RaghavPal 3 жыл бұрын
Thanks Trishtan
@akshayjadhav6922
@akshayjadhav6922 5 жыл бұрын
Thanks for the tutorial.
@RaghavPal
@RaghavPal 5 жыл бұрын
You're welcome Akshay
@pramodgurlhosur5215
@pramodgurlhosur5215 3 жыл бұрын
Very helpful. Thank you
@RaghavPal
@RaghavPal 3 жыл бұрын
You're welcome Pramod
@TalkingTomFunvideoz
@TalkingTomFunvideoz 5 жыл бұрын
Excellent video it is very useful. Please do one video in real time flow of the project work and environment.
@RaghavPal
@RaghavPal 5 жыл бұрын
Sure Lakshmisiva
@mv8167
@mv8167 3 жыл бұрын
Thank you for creating these wonderful tutorials. I enjoy your Udemy courses also. I copy/pasted your Protractor #9 homepage.js file from GitHub. The first line is what you have: 1) at the start of the file: let homepage = function () { However, Protractor recommends: class homepage { constructor() { 2) at the end of the file: module.exports = new homepage; However, Protractor recommends: export default new homepage(); What is correct? (or is there a different issue?)
@RaghavPal
@RaghavPal 3 жыл бұрын
I will check
@AnantBhatdba
@AnantBhatdba 4 жыл бұрын
I have few questions here - 1. How do we run more than 1 .specs file without specifying each in config.js ? 2. How do we run only 1 test when there are more than 1 test in .specs file ? 3. How can we do the line by line debugging when there is a complex code ?
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Anant, You can do like this //All spec file execution specs: [‘e2e/*spec.js’], //Specific spec file execution specs: ["1_Login.js", "2_Add_Client.js", "3_Update_Client.js" ],
@davidmurza9938
@davidmurza9938 2 жыл бұрын
module.exports = new homepage(); FINALY!
@RaghavPal
@RaghavPal 2 жыл бұрын
Great, all the best
@diaszhumagaliyev8484
@diaszhumagaliyev8484 4 жыл бұрын
Hi! I am getting an error saying no specs found. Checked everything and rewatched the video but didnt find any mistakes PS C:\Selenium\wefox> protractor ./conf/conf.js [14:22:03] I/launcher - Running 1 instances of WebDriver [14:22:03] I/direct - Using ChromeDriver directly... DevTools listening on ws://127.0.0.1:54691/devtools/browser/7b5e487e-c6a0-4b60-8abd-24e540c80b88 Started No specs found Finished in 0.002 seconds [14:22:06] I/launcher - 0 instance(s) of WebDriver still running [14:22:06] I/launcher - chrome #01 passed PS C:\Selenium\wefox>
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Dias, pls check if this helps - stackoverflow.com/questions/30616093/angular-protractor-no-specs-found stackoverflow.com/questions/46500133/angular-protractor-how-to-ensure-that-no-specs-found-error-does-not-happen/46515759#46515759
@xoda345
@xoda345 3 жыл бұрын
Why are you keeping the 'expect' in page class? Shouldn't the assertion be put into test class? That is the main idea of Page Object framework. Please Correct me if I am wrong.
@RaghavPal
@RaghavPal 3 жыл бұрын
Hi Swarup, going by book, yes, in POM the page class should only have object locators and action on objects
@tejkumarkempaiah4906
@tejkumarkempaiah4906 3 жыл бұрын
Thanks for the video Raghav, can you please create a video on reading data from JSON as part of data driven testing.
@RaghavPal
@RaghavPal 3 жыл бұрын
Hi Tej, I will plan on this
@tejkumarkempaiah4906
@tejkumarkempaiah4906 3 жыл бұрын
@@RaghavPal Thank you
@jouniryynanen7081
@jouniryynanen7081 4 жыл бұрын
Why didn't you put the url to the page object? Like if the url changes, you need to go to every test to change it? You could get the homepage with just homepage.get()? Excellent video series.
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Jouni, url and other env/server dependent parameters are generally setup in a separate config file. But if you like can set that in POM
@garrinchadossantos6381
@garrinchadossantos6381 3 жыл бұрын
Hello Raghav! Thank you for your tutorial videos ! By the way are you planning to do some lessons about how to use if-else condition in Protractor? :)
@RaghavPal
@RaghavPal 3 жыл бұрын
Hi, check this stackoverflow.com/questions/44362880/protractor-if-else-with-expectcondition
@sumitsaha9782
@sumitsaha9782 2 жыл бұрын
Hi Raghav, Thanks for the tutorial. It works fine. Just a question. Every time VSCode is asking us to convert the scripts into "ES Module" which changes the syntax completely and then protractor scripts fails to run. Do we really need to convert or is it ok to keep the scripts AS IS ?
@RaghavPal
@RaghavPal 2 жыл бұрын
Hi Sumit, not very sure on this, will need to check online
@tinacummins3542
@tinacummins3542 4 жыл бұрын
Thank you so much for your tutorials, it helped me to set up Protractor from not knowing where to start with the instruction at work to use it for automated testing. I'm having issues with debugging, can you please help me with steps on how to set it up? I've tried a lot of things, but can't get debugging to work, not even this project that I've created with your guidance.
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Tina, I can help if you have a specific issue with logs.
@tinacummins3542
@tinacummins3542 4 жыл бұрын
@@RaghavPal Thanks. I have this code in my launch.json file: "program": "${workspaceFolder}\\conf\\conf.js" It's stepping into the conf file, but not going into the: exports.config = { code, so it doesn't call the spec file: specs: ['../tests/calculator.js']
@RaghavPal
@RaghavPal 4 жыл бұрын
try providing the complete path of your test file
@SahilCycleCyclops
@SahilCycleCyclops 4 жыл бұрын
Dear Raghav, a big thanks to you for this awesome knowledge. I have a task to execute this framework on the latest Safari browser but the support for window is no longer available, can you please help with some pointers?
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Sahil, I will check, Also keep looking online
@deborahdcarlo8948
@deborahdcarlo8948 4 жыл бұрын
Hi, do you have any example of how to implement inheritance of a BasePage?
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Deborah, I am not sure if I have covered that in the next videos. Will need to check
@ananasdota8227
@ananasdota8227 3 жыл бұрын
Hey Raghav, I have a question about the line "output = element(by.cssContainingText('.ng-binding', result));" This seems to already check if there is an element with the CORRECT answer, which would make the expect statement redundant. How is this used in practice? And is it possible to pull the value of an element regardless of what the value may be?
@RaghavPal
@RaghavPal 3 жыл бұрын
Hi, you can use a combination of strategies to find a value or object. I will create a session on this
@mv8167
@mv8167 3 жыл бұрын
Is Format Selection still available in v19? Can we change the background test to different colors? thx
@RaghavPal
@RaghavPal 3 жыл бұрын
I will need to check Mike
@harijeff1
@harijeff1 3 жыл бұрын
Hi Raghav , I am having multiple pages in my Application , can you help me on how to handle tab switching ?
@RaghavPal
@RaghavPal 3 жыл бұрын
Hi Hari, will plan a session for now check this stackoverflow.com/questions/26798020/protractor-switch-to-previous-tab chercher.tech/protractor/handle-browser-windows-protractor
@harijeff1
@harijeff1 3 жыл бұрын
@@RaghavPal Thank you so much Raghav The second link helped me to handle the tab switching :)
@shilpamittal2598
@shilpamittal2598 4 жыл бұрын
Hi Raghav, While executing the code I am getting the error : PS F:\ProtractorDemo\conf> protractor conf.js [16:30:11] E/configParser - Error code: 105 [16:30:11] E/configParser - Error message: failed loading configuration file conf.js [16:30:11] E/configParser - Error: Cannot find module 'F:ProtractorDemoconf ode_modulesprotractor-jasmine2-screenshot-reporter' Require stack: - F:\ProtractorDemo\conf\conf.js
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Shilpa, just check this path does not seem correct F:ProtractorDemocon
@mallikvenna3932
@mallikvenna3932 4 жыл бұрын
Many many thanks for your great videos :) I have a query here, can you pls suggest me. Here is the code: var AngularHomepage = function() { var nameInput = element(by.model('yourName')); var greeting = element(by.binding('yourName')); this.get= }; The color of the above variable 'AngularHomepage' changes from yellow to green after writing the last line ie, this.get= Anything I am missing?
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Mallik are you getting any error? If not can proceed with this.
@mallikvenna3932
@mallikvenna3932 4 жыл бұрын
@@RaghavPal Hi Raghav, It doesn't show the errors. I am able to proceed. Thank you.
@amirsikandar4444
@amirsikandar4444 4 жыл бұрын
Hi Raghav, Can we access the variable directly from other pages or we have to create a function then only we can access? Ex: AngularHomepage.nameInput or AngularHomepage.greeting
@ShwetaSharma-ld6nu
@ShwetaSharma-ld6nu 3 жыл бұрын
Hi Raghav, I am getting this error while executing this scenario Failed: homepage.get is not a function
@RaghavPal
@RaghavPal 3 жыл бұрын
Hi Shweta, this will help stackoverflow.com/questions/42985803/protractor-page-object-failed-is-not-a-function/42987041 stackoverflow.com/questions/49935992/not-a-function-error-in-protractor-pom
@ShwetaSharma-ld6nu
@ShwetaSharma-ld6nu 3 жыл бұрын
@@RaghavPal Thanks its working now
@pandudamera7211
@pandudamera7211 5 жыл бұрын
How read data Excel file by protractor in POM. Please make one video brother.
@RaghavPal
@RaghavPal 5 жыл бұрын
I will try on that Pandu
@pandudamera7211
@pandudamera7211 5 жыл бұрын
Pls do me favour sir
@ravisaikota5789
@ravisaikota5789 3 жыл бұрын
Hi Raghav i have a task where i have perform a test for non angular and angular pages. Can you please let me know to work on this? Non angular is the login page and angular is my application.
@RaghavPal
@RaghavPal 3 жыл бұрын
Hi Ravisai, you can use Protractor for both. For non-angular pages you can set browser.ignoreSynchronization = true stackoverflow.com/questions/20927652/how-to-use-protractor-on-non-angularjs-website
@ravisaikota5789
@ravisaikota5789 3 жыл бұрын
Can i get your email address?
@ravisaikota5789
@ravisaikota5789 3 жыл бұрын
how to test Angular material?? any idea?
@RaghavPal
@RaghavPal 3 жыл бұрын
Protractor will work for Angular and as mentioned above if you want to test a non-angular webpage can put browser.ignoreSynchronization = true Pls check some examples online
@rolancruz4568
@rolancruz4568 3 жыл бұрын
Hello, How do you fix an Error: 'xxxxxx' is not a function? and Type Error: Cannot save property of 'xxxxx' of undefined
@RaghavPal
@RaghavPal 3 жыл бұрын
Hi Rolan, most probably you may have to import or create a new instance of some class to use its functions, Check this stackoverflow.com/questions/49935992/not-a-function-error-in-protractor-pom
@rolancruz4568
@rolancruz4568 3 жыл бұрын
@@RaghavPal Thank you!
@lakshmisirisha2138
@lakshmisirisha2138 4 жыл бұрын
Hi Raghav, i followed same procedure that you said but i am getting this error (Error: Error while waiting for Protractor to sync with the page: "both angularJS testability and angular testability are undefined. This could be either because this is a non-angular page or because your test involves client-side navigation, which can interfere with Protractor's bootstrapping. See git.io/v4gXM for details"). could you please suggest why i am getting this. thanks
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Lakshmi, Looks like you are dealing with a non-angular application. In Protractor by default wait angular page is loaded is enabled. If you work with non angular you should add await browser.waitForAngularEnabled(false); Check this - stackoverflow.com/questions/54977422/protractor-error-while-waiting-for-protractor-to-sync-with-the-page-both-angu Let me know if you face any issues
@testingtrail
@testingtrail 5 жыл бұрын
Awesome Raghav, just one recommendation, it is better to have assertion / verification outside the POM. (stackoverflow.com/questions/11126806/page-object-model-why-not-include-assertions-in-page-methods) and one question, why we cannot use 'class HomePage...' instead of 'let homePage = ... ' in homepage.js ? Thanks Raghav.
@RaghavPal
@RaghavPal 5 жыл бұрын
Thanks for the information Jorge, I will check this. I did not try with class
@avichakraborty4163
@avichakraborty4163 3 жыл бұрын
Sir I am getting below issue - E/launcher - Error: ReferenceError: modules is not defined
@RaghavPal
@RaghavPal 3 жыл бұрын
Hi Avi, pls check these user comments: It looks like you are using WebStorm's inbuilt Protractor runner configuration to run your tests. Please try running your project from command line , or by creating a NodeJS runner configuration in WebStorm instead of Protractor type. I have confirmed this issue and got solved with a NodeJS run/Debug configuration in WebStorm. github.com/abhishekswain/jasmine2-protractor-utils/issues/25 github.com/abhishekswain/jasmine2-protractor-utils/issues/19
@avichakraborty4163
@avichakraborty4163 3 жыл бұрын
@@RaghavPal hi Raghav, thanks for the response. I have already used a different approach and got it resolved. It was a small error from my side.
@RaghavPal
@RaghavPal 3 жыл бұрын
If you like can share to help others
@pratikkkothari3198
@pratikkkothari3198 3 жыл бұрын
how to use Expectedconditions methods here?
@RaghavPal
@RaghavPal 3 жыл бұрын
I will need to check the video again Pratik, pls try some online help
@pratikkkothari3198
@pratikkkothari3198 3 жыл бұрын
We need to import protractor and then import expected condition using dot operator of first import
@Balavenkateshnadiminti
@Balavenkateshnadiminti 4 жыл бұрын
Hi 19:39:53] E/launcher - Error: ReferenceError: model is not defined am getting this error, doesn't know how to proceed further... please help.
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Bala, can you check the logs for more details
@zishukumar6533
@zishukumar6533 4 жыл бұрын
How can we automate 2FA in Protractor.
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Zishu, there is no in-built feature in protractor to handle 2FA. You will have to have a way using scripts to capture the code from email or mobile or DB and proceed
@zishukumar6533
@zishukumar6533 4 жыл бұрын
Getting error: Process exited with error code 1. please help
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Zishu, It can be some configuration or type. Pls check this stackoverflow.com/questions/54084109/how-to-fix-error-process-exited-with-error-code-1-in-protractor?rq=1 stackoverflow.com/questions/40131147/process-exited-with-error-code-1
@zishukumar6533
@zishukumar6533 4 жыл бұрын
@@RaghavPal Thank you so much.
@jahidulIslam-pb4hn
@jahidulIslam-pb4hn 4 жыл бұрын
add this line-> browser.waitForAngularEnabled(false); before of this line -> homepage.get('juliemr.github.io/protractor-demo/');
@abbinenivenkatesh6450
@abbinenivenkatesh6450 4 жыл бұрын
hiii sir this video at the time of 6 minutes 35 seconds to nearly 9 minutes it is not clear
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Abbineni, pls let me know what exactly is not clear
@cvreddy369
@cvreddy369 4 жыл бұрын
Hi, Will you give detail online training on protractor? If yes please let me know your mailId. Thanks In advance.
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Venkatesh, as of now no training on Protractor is planned, you can check all tutorials here - automationstepbystep.com/
@anumanthe7871
@anumanthe7871 5 жыл бұрын
Hi Raghav. I tried and getting the below error. "Error: Error while waiting for Protractor to sync with the page: "both angularJS testability and angular testability are undefined. This could be either because this is a non-angular page or because your test involves client-side navigation, which can interfere with Protractor's bootstrapping. See git.io/v4gXM for details" Can you please help?
@RaghavPal
@RaghavPal 5 жыл бұрын
Hi Anumanth, Have you tried to use browser.driver.get instead of browser.get Some useful links i found: stackoverflow.com/questions/20059943/running-into-error-while-waiting-for-protractor-to-sync-with-the-page-with-basic stackoverflow.com/questions/23634648/getting-error-error-while-waiting-for-protractor-to-sync-with-the-page/23881721 github.com/angular/protractor/issues/4336
@bencysebastian5875
@bencysebastian5875 4 жыл бұрын
How did u solve this..i'm also getting the same error.?
Protractor Beginner Tutorial 10 | How to take screenshots in Protractor
7:33
Automation Step by Step
Рет қаралды 17 М.
Selenium Framework for Beginners 8 | How to implement POM in Selenium Java
17:38
Automation Step by Step
Рет қаралды 83 М.
How To Get Married:   #short
00:22
Jin and Hattie
Рет қаралды 26 МЛН
🍉😋 #shorts
00:24
Денис Кукояка
Рет қаралды 3,7 МЛН
小天使和小丑太会演了!#小丑#天使#家庭#搞笑
00:25
家庭搞笑日记
Рет қаралды 40 МЛН
Protractor Beginner Tutorial 14 | How to run Protractor tests from Jenkins
15:11
Automation Step by Step
Рет қаралды 13 М.
Cypress Complete Beginners Masterclass 1 | Step by Step | Raghav Pal |
1:20:54
Automation Step by Step
Рет қаралды 203 М.
Part-19: Page Object Model (POM) in Protractor
32:20
SDET- QA
Рет қаралды 8 М.
Protractor Beginner Tutorial 7 | How to create first test case in protractor
26:34
Automation Step by Step
Рет қаралды 60 М.
Protractor Beginner Tutorial 8 | Protractor How to find element locators
15:16
Automation Step by Step
Рет қаралды 34 М.
What is RabbitMQ?
10:10
IBM Technology
Рет қаралды 322 М.
How To Get Married:   #short
00:22
Jin and Hattie
Рет қаралды 26 МЛН