Just gave the Quiz. Achieved 25/25. Thanks Raghav for easy and efficient teaching. Easy to grasp your words and speed. Keep it up. Have been following you since the past 2 years now.
@RaghavPal2 ай бұрын
so great to know this Rajendra.. keep learning n sharing
@DharmaTeja-o9pАй бұрын
just gave the quiz 2 from masterclass 2 achieved 25/25. thanks Raghav for efficient and understandable teaching
@RaghavPalАй бұрын
That's awesome Dharma.. I'm glad the lessons are working for you
@acreations8727 Жыл бұрын
23 of 25... This is wonderful. Thank you for being so clear.😀
@RaghavPal Жыл бұрын
Glad it was helpful
@whitenoisefocus7962 Жыл бұрын
10/10 on quiz 2! Who's the king of SDET training on KZbin? 🔥
@RaghavPal Жыл бұрын
Great score
@nehagoel6133Ай бұрын
Got 25/25, Thanks for the session. Really appreciate it.
@RaghavPal29 күн бұрын
Excellent Neha
@usano2055 Жыл бұрын
I got 25/25 , Really appreciate your work , Thanks for info...
@RaghavPal Жыл бұрын
Great score. All the best for next
@jaganbabum36676 ай бұрын
Hi Raghav,Thanks for your wonderful videos. Cypress Quiz 2 Total points 22/25
@RaghavPal6 ай бұрын
Great score Jagan.. keep learning
@sathyajammi1849Ай бұрын
Thanks for the very helpful video, I found it very useful.. just a note, "pretest" and "posttest" doesn't work when invoked with npm run test.. chatgpt recommended to use "npm run pretest && echo "Test" && npm run posttest".. This worked, FYI I'm on the latest version of Cypress v13.17, not sure if anything has changed from v10 the demo was created on.
@RaghavPalАй бұрын
Thanks for adding Sathya
@ahsaanhassan4822 ай бұрын
19 of 25. This is wonderfull.
@RaghavPal2 ай бұрын
great score Ahsaan
@Aj21093 Жыл бұрын
Scored 25/25 This shows how amazing are your sessions. :)
@RaghavPal Жыл бұрын
Thanks, Great score Anukriti
@MrH0bb02 жыл бұрын
Hi Raghav, cannot thank you enough for all the tutorials you have been providing for free. Could you also create a video on the feature due to which Cypress logs out after every IT-Block execution is completed. How could we overcome this problem? Should we be having only one IT-Block for one login? Is that an appropriate way to manage all the test cases?
@RaghavPal2 жыл бұрын
I will check on this
@deepak6256 Жыл бұрын
Raghav. Please share your view and create a video so it can be helpful for everyone. Thanks in advance
@digitally_ascended_conscio63042 жыл бұрын
Very good as always, cheers.
@RaghavPal2 жыл бұрын
Thanks
@3aadel2 жыл бұрын
Very good! many thanks
@RaghavPal2 жыл бұрын
Thank you too!
@abhijeet1940310 ай бұрын
Got 23/25 Screenshots problems were not clear to me. Rest was easy. Thanks for making such amazing content.
@RaghavPal10 ай бұрын
Most welcome Abhijeet
@ooozzzoo68852 жыл бұрын
Really appreciate your lessons, it helps a lot and it is so simple for understanding! :)
@RaghavPal2 жыл бұрын
You're very welcome!
@DILSHANDESILVAmanOfTheYear2 жыл бұрын
Clear and very easy to understand. waiting for the next session...
@RaghavPal2 жыл бұрын
4 Parts are published by now Dilshan
@ChristyCarpenterCrutchfield Жыл бұрын
23/25 You've become my "go to" instructor!
@RaghavPal Жыл бұрын
So happy and humbled to know this Christy
@pranjaldesai7421 Жыл бұрын
HI Raghav, nice video. Have one question. How should i run below scenario with different 'it' block 1. Login 2. Create Quote 3. Create Sales Order 4. Generate Invoice
@RaghavPal Жыл бұрын
Hi Pranjal You can run the scenario with different it blocks by creating a separate it block for each step of the scenario. Here's an example: describe('My Scenario', () => { beforeEach(() => { cy.visit('example.com') }) it('should log in', () => { cy.get('#username').type('myusername') cy.get('#password').type('mypassword') cy.get('#login').click() cy.url().should('include', '/dashboard') }) it('should create a quote', () => { cy.get('#new-quote').click() cy.get('#quote-form').should('be.visible') cy.get('#quote-name').type('My Quote') cy.get('#quote-description').type('Description of my quote') cy.get('#save-quote').click() cy.url().should('include', '/quotes') }) it('should create a sales order', () => { cy.get('#new-sales-order').click() cy.get('#sales-order-form').should('be.visible') cy.get('#sales-order-name').type('My Sales Order') cy.get('#sales-order-description').type('Description of my sales order') cy.get('#save-sales-order').click() cy.url().should('include', '/sales-orders') }) it('should generate an invoice', () => { cy.get('#invoices').click() cy.get('#generate-invoice').click() cy.get('#invoice-form').should('be.visible') cy.get('#invoice-name').type('My Invoice') cy.get('#invoice-description').type('Description of my invoice') cy.get('#generate-invoice-button').click() cy.url().should('include', '/invoices') }) }) In this example, each it block represents a step of the scenario: logging in, creating a quote, creating a sales order, and generating an invoice. The beforeEach block is used to navigate to the starting page before each it block. You can add additional assertions or interactions within each it block as needed.
@pranjaldesai7421 Жыл бұрын
@@RaghavPal thank you so much for reply. I don't want to do login every time. so don't want to use beforeEach
@khaledashraf10922 жыл бұрын
Really appreciated, what an amazing effort, i just wanted to ask what is the difference between cypress complete master class and cypress beginner tutorials?
@RaghavPal2 жыл бұрын
Hi Khaled, In Masterclass are complete tutorials done in 3-4 parts, whereas the beginner series is one video dedicated to one topic, Also Masterclass sessions are created with recent version of cypress
@saribshamim9876 Жыл бұрын
Great explanation ! My Quiz score: 24/25.
@RaghavPal Жыл бұрын
Excellent Sarib
@ScottDarrah6 ай бұрын
Thank you for these great videos, and useful to use the orangehrmlive site to test against. Completed first two sections, about to start this one. Learning a lot - thanks again!
@RaghavPal6 ай бұрын
Fantastic,. keep learning
@mehmetlalek35002 жыл бұрын
Very goed and easy to understand. Thank you Raghav 😃👍
@RaghavPal2 жыл бұрын
Most welcome
@newsukhkaur Жыл бұрын
hi Raghav, u r doing very well in all ur videos. Pl keep it up. i just want to know do u have any video for API testing with Cypress? If yes, then plz let me know.
@RaghavPal Жыл бұрын
Not yet Newsukh, I will plan
@JeromeCulcul Жыл бұрын
Hello Raghav. I have question , How do I enabled the videos files when I run the testing with ( npx cypress run). Thank you in advance
@RaghavPal Жыл бұрын
Jerome *Here are the steps to enable video recording for your Cypress tests when running them with `npx cypress run`:* *1. Configure `cypress.config.js`:* - *Add or modify the `video` property:* ```javascript module.exports = { // ... other configurations video: true, // Enable video recording for all specs }; // Alternatively, for selective recording: module.exports = { // ... video: { specs: [ 'tests/e2e/my-spec-file.js', // Record only this spec // ... add more specs as needed ], }, }; ``` *2. Run Cypress from the Command Line:* - *Use `npx cypress run`:* ```bash npx cypress run ``` *3. Access Recorded Videos:* - *Find videos in the `cypress/videos` directory:* - Each spec file will have its own subdirectory. - Videos are named based on the spec name and timestamp. *Additional Customization Options:* - *Disable on Failure:* ```javascript module.exports = { // ... video: { onlyOnFailure: false, // Record videos even for successful tests }, }; ``` - *Adjust Video Resolution:* ```javascript module.exports = { // ... video: { resolution: { width: 1280, // Set desired width height: 720, // Set desired height }, }, }; ``` *Important Notes:* - *Headless Mode:* Videos are not recorded in headless mode by default. Use `--headed` or `--headed --no-sandbox` flags with `npx cypress run` to enable them. - *CI/CD:* Configure video recording settings appropriately in your CI/CD pipeline. - *Video Size:* Adjust resolution or recording settings for large test suites to manage video file sizes.
@hafizsyedzainulabdin39002 жыл бұрын
Quiz Marks: 23/25 Thanks Sir Love and respect from Pakistan
@RaghavPal2 жыл бұрын
Great score Hafiz
@qamarstationwala75382 жыл бұрын
hi Raghav thanks for the amazing videos. Quick question... i see you are using classic function declarations instead of arrow functions. personally I like arrow functions more as there is less to type but this changes the context of "this", so I wasn't able to use them for the readfile demo as it requires this to have the right context. do you know of any workarounds or do i have to stick to classic functions?
@RaghavPal2 жыл бұрын
Hi Qamar, I will need to check on this, you can follow some examples online
@jay6750 Жыл бұрын
When you use ()=>{} to define functions in JavaScript, it changes how this works. So when you use this inside an ()=>{} function, it doesn't refer to the same thing as when you use this inside a function(){} function. In your code, you used ()=>{} to define the before and it functions. This means that when you try to use this inside the it function to access the test_data fixture, it doesn't work because this is not referring to the correct context. If you want to use the arrow function syntax ()=>{} instead of function(){}, you can use the get method to retrieve the fixture data using @test_data alias inside the test case. before(() => { cy.fixture('example.json').as('test_data') }) it('read files using fixture', () => { cy.fixture('example.json').then((data) => { cy.log(data.name) cy.log(data.email) cy.log(data.body) }) cy.get('@test_data').then((testData) => { cy.log(testData.name) }) })
@vidyeshthakare558610 ай бұрын
Thank you@@jay6750 . I was also stuck on same.
@mariaelenacarraleropena94219 ай бұрын
@@jay6750 Thanks, if i had saw your comment before, i didnt had all day traying to understand whay -this- doesnt work inside ()=>{} function
@whitenoisefocus7962 Жыл бұрын
24/25 on the above linked Quiz. Still 🔥!
@RaghavPal Жыл бұрын
Wow. amazing
@poojamraosmg21832 жыл бұрын
i scored 23/25,really helpful
@RaghavPal2 жыл бұрын
Great Pooja
@cola1917 Жыл бұрын
55:55 you use the before and as function. it seems borken. I have already check my code. now, I use the get with @ to reference the file_data, it works.
@RaghavPal Жыл бұрын
Thanks for adding here
@nirmalan172 жыл бұрын
So cool to learn and got 24/25 🙌🙏 I have been following you for other contents but for this cypress one I really got my hands dirty as when there is a need 😀 and helping me. In addition if I need to implement cypress with TS can I refer to your other playlists where you have in the channel ?
@RaghavPal2 жыл бұрын
Hi Nimmy, Great to know, I am yet to do Cypress with TS, you can find all links to tutorials here - automationstepbystep.com/
@nirmalan172 жыл бұрын
@@RaghavPal thanks for your kind response. Please let me know if you got any plans in near future to implement cypress with TS. 🤞
@RaghavPal2 жыл бұрын
I have plans, but not sure by when will I be able to start on it
@nirmalan172 жыл бұрын
@@RaghavPal ok got it 👍 hope you start that 🔜 looking forward for that series 🤩thanks for supporting as always. ✌️
@mairaghaffar38458 ай бұрын
my score 24/25 :)
@RaghavPal8 ай бұрын
Great Maira.. keep it up
@neerajguleria88772 жыл бұрын
Thanks a lot Raghav for creating the masterclass on Cypress. Would you be including allure reports in the reporting in the upcoming masterclasses?
@RaghavPal2 жыл бұрын
Hi Neeraj, not covered Allure reports with Cypress as of yet, In case I plan, will create a session
@deepak6256 Жыл бұрын
Raghav, please share If you have covered
@xXMrThomasXx7 ай бұрын
Quiz 10/10 nice :) Better than Quiz1 :) This is nice check my knowledge :) And I am back to the video but for now thx for your time and your hard work :)
@RaghavPal7 ай бұрын
Welcome back
@sathyajammi1849Ай бұрын
Could you please share the masterclass links for the pending ones (API Testing, Git, Jenkins, CI/CD, and others not covered by the 4 masterclass sessions). Thanks in advance.
@RaghavPalАй бұрын
Sathya Can check all videos here - automationstepbystep.com/
@miiftahl2 жыл бұрын
scored 23/25!
@RaghavPal2 жыл бұрын
Great
@rihaskh2 жыл бұрын
Hi Sir could u plz include looping concepts in next master class ? nd returning values from functions in POM classes
@RaghavPal2 жыл бұрын
Will try Rihas
@srgd46332 жыл бұрын
Hello Sir. I have an interview coming up on Cypress. If possible, may you please provide series of questions?
@RaghavPal2 жыл бұрын
I will plan on this, but can take some time, for now if you complete the 4 parts Masterclass of cypress, you can handle the interview
@vocationaldoor5733 Жыл бұрын
25/25 thanks sir for clear explanation
@RaghavPal Жыл бұрын
Very good
@vocationaldoor5733 Жыл бұрын
@@RaghavPal sir I am a 7 year experienced automation tester , need some guidance on career path
@RaghavPal Жыл бұрын
Sure, let me know the details and specifics
@Testflaps Жыл бұрын
@Raghav, as nobody else has responded...in English in the UK we pronounce cache like we say cash
@RaghavPal Жыл бұрын
thanks for letting me know Michael
@geethamaddirala Жыл бұрын
Hi sir at 3.13 time stamp Api Testing on wards where did you covered pls mentioned the links . i watched all masterclass 4 videos i dnt find . thanks
@RaghavPal Жыл бұрын
Have to create lecture on that, I will plan
@GauravBhardwaj-ug3mo2 жыл бұрын
23/25 quiz, thanks
@RaghavPal2 жыл бұрын
Well done
@JenVollkron2 жыл бұрын
Thank you very much for your amazing videos Raghav! They are explained in a way that everyone can learn. I have a question related to following. My web app uses a third party oauth2.0 authentification service. When normally using, I open my webapp, it navigates me to the authentification website and after login there, I get navigated back to my app. How can I simulate a login with cypress properly and continue testing my webapp?
@RaghavPal2 жыл бұрын
Hi, this can help docs.cypress.io/guides/end-to-end-testing/google-authentication
@ZChattah Жыл бұрын
The topics/contents mentioned in the start are not all in this playlist, or am I missing something here? I wanted to do the Cypress BDD and so on, where can I find these?
@RaghavPal Жыл бұрын
Yes, I had to add more lectures, will do as I get time
@samanthasajeevgomez87352 жыл бұрын
Hi Raghav, your tutorials are useful. thank you for that. I have doubt regarding the command line running. for me its only few options are shown in command line when running 'cypress run [options]'. Just the options for version and help is shown. Can you help me with this?
@RaghavPal2 жыл бұрын
Hi Samantha, hope you are using the right command on the right folder, Can check more in documentation
@syedarbaz37812 жыл бұрын
At 52:45 , I am not able to see data name and email in console , after using fixture ...though its running fine
@RaghavPal2 жыл бұрын
Hi Syed, first you will have to click (pin) the step in the command log (left side) and then goto console
@shilupg2 жыл бұрын
Hi Raghav, can we add the object locators I. example.json file and can we use it in the test script for identifying the object and actions
@RaghavPal2 жыл бұрын
Yes, we can
@dougm1189 ай бұрын
I have a test which exits non-gracefully in the GUI and it hangs the CLI when the test is run manually. Cypress is having trouble with an iFrame. Any recommendations beside CTRL-C at the command line or in the GUI to troubleshoot?
@RaghavPal9 ай бұрын
Doug I'll provide some recommendations to help you out: 1. JavaScript Redirects in the App: - One common issue with s is that the tested application might perform a JavaScript redirect via `window.top.location`. This can break out of the that Cypress placed it in. - Check if your app has any code that performs such redirects. You might need to disable this code during testing or ensure that it doesn't run when Cypress interacts with the 2. Cross-Domain Access: - Browsers adhere to a strict same-origin policy, which restricts access between s when their origin policies do not match. - To enable cross-domain access, consider setting the `chromeWebSecurity` property to `false` in your `cypress.config.js` file and then re-run your tests 3. React Iframe Compatibility in Headless Mode: - If you're running Cypress in headless mode, be aware that React s are not fully supported in the Electron browser. - Try setting the browser to Chrome explicitly using the `--browser chrome` command in your `package.json` file Remember to investigate the specific behavior of your , inspect the application code, and consider these recommendations.
@dougm1189 ай бұрын
@@RaghavPal Unfortunately I do not have access to source code for option #1, I am a QA engineer, not a developer, and unless there is a dynamic way to disable that in the browser (React front end); I tried option 2 and 3 but same results. The GUI seem to die and sends me back to the Cypress window showing my tests with no status and the CLI hangs. When I watch the UI preview, it seems to click the link but then it crashes. The operation should exit out of the iFrame and put the user back at the sign in page. I got this solution from the internet ```const getIframeDocument = () => { return cy .get('[name="mainContent"]') // Cypress yields jQuery element, which has the real // DOM element under property "0". // From the real DOM element we can get // the "document" element, it is stored in "contentDocument" property // Cypress "its" command can access deep properties using dot notation // on.cypress.io/its .its('0.contentDocument').should('exist') } const getIframeBody = () => { // get the document return getIframeDocument() // automatically retries until body is loaded .its('body').should('not.be.undefined') // wraps "body" DOM element to allow // chaining more Cypress commands, like ".find(...)" .then(cy.wrap) } describe('my tests', () => { ... it('successful login', () => { ... // limited success ; Cypress seems to crash here getIframeBody().find("a[href='/account/login']").click()
@dougm1189 ай бұрын
cache /kaSH/
@RaghavPal9 ай бұрын
okay, if it's working for you.. can go with it
@ushaparasuraman91275 ай бұрын
@Raghav, I don't see the video folder for my project that created for this cypress class. I tried refreshing, the project but still don't see it. I see the screenshots folder though. Appreciate your help with this
@RaghavPal5 ай бұрын
Usha By default, Cypress records videos of your test runs and saves them in a videos folder within your project's root directory. However, it's possible that the folder might not be visible due to a few reasons. Here are some potential solutions to help you locate the video folder: 1. Check the cypress.json file Open your cypress.json file and look for the video configuration. Make sure that video is set to true and that the videoFolder is set to the correct path. For example: { "video": true, "videoFolder": "cypress/videos" } If the videoFolder is set to a different path, navigate to that location to find your video files. 2. Check the project root directory Ensure that you're looking in the correct location. The videos folder should be located in the root directory of your project, alongside the cypress folder. 3. Refresh the project directory Try refreshing the project directory in your code editor or IDE. Sometimes, the file system might not update immediately, and a refresh can help. 4. Run the tests again Rerun your Cypress tests to see if the video folder is created. If the tests are successful, the video folder should be generated. 5. Check for errors Verify that there are no errors in your test runs that might prevent the video folder from being created. Check the Cypress logs for any issues. -
@SanthoshkumarS-mo5ub2 жыл бұрын
Hello Raghav sir , your videos are very helpful thankyou for all the effort you are putting . Is there anyone we can read data from the excel sheet without converting it to Jason in cypress ? Thankyou in advance for Your reply.
@RaghavPal2 жыл бұрын
will need to check some examples online for this
@dth28819 ай бұрын
Could you please help to train about API, SQL, CI/CD with cypress?
@RaghavPal9 ай бұрын
Sure, Let's dive into each topic: 1. API (Application Programming Interface): - APIs allow different software applications to communicate with each other. They define a set of rules and protocols for interaction. - Types of APIs: - RESTful APIs: These are widely used for web services. They follow the principles of Representational State Transfer (REST) and use HTTP methods (GET, POST, PUT, DELETE) to perform actions on resources. - GraphQL APIs: These provide more flexibility by allowing clients to request only the data they need. - How to Learn: - Explore API documentation for popular services (e.g., Twitter, GitHub, Google Maps). Try making API requests using tools like Postman or cURL. - Learn about authentication (OAuth, API keys), request/response formats (JSON, XML), and status codes (200, 404, etc.). 2. SQL (Structured Query Language): - SQL is used to manage and manipulate relational databases. It allows you to create, retrieve, update, and delete data. - Basic SQL Commands: - `SELECT`: Retrieve data from a table. - `INSERT`: Add new records. - `UPDATE`: Modify existing records. - `DELETE`: Remove records. - Database Systems: - MySQL, PostgreSQL, SQLite, SQL Server, Oracle are popular SQL database systems. - How to Learn: - Set up a local database (e.g., MySQL) and practice writing SQL queries. - Take online courses or read tutorials on SQL fundamentals. 3. CI/CD (Continuous Integration/Continuous Deployment): - CI/CD automates the process of building, testing, and deploying code changes. - Continuous Integration (CI): - Developers merge their code into a shared repository frequently. - Automated tests run on every code commit to catch issues early. - Continuous Deployment (CD): - After passing CI, code is automatically deployed to production. - CD pipelines ensure consistent and reliable deployments. - Tools: - GitLab, Jenkins, Travis CI, CircleCI, GitHub Actions. - How to Learn: - Set up a simple CI/CD pipeline for a sample project. - Understand YAML configuration files for defining CI/CD workflows. 4. Cypress: - Cypress is an end-to-end testing framework for web applications. - Features: - Automatic reload of tests during development. - Time-travel debugging. - Interactive debugging. - Running in CI: - Cypress can be integrated into your CI/CD pipeline. - Run Cypress tests automatically after code changes. - View test results within your CI provider's UI. - How to Learn: - Explore the official Cypress documentation. - Practice writing Cypress tests for web applications. Remember, hands-on practice is essential for mastering these topics
@akhilagarwal-xq4pz2 ай бұрын
In last section of last video command was taken from imported code not from current file due to that both of my test1 and 2 are passing. for this what should i do
@RaghavPal2 ай бұрын
Akhil, pls give me more context or give timestamp from the video
@akhilagarwal-xq4pz2 ай бұрын
Cypress Complete Beginners Masterclass 2 | Step by Step where we creat test1 and test 2 and giving user name and password correct and incorrect but my both the test passing
@RaghavPal2 ай бұрын
just check the app in case its a demo app.. and then check your script again. you can print the values to check what values are getting entered
@shankardas4886 Жыл бұрын
24/25 score but I didn't find the screenshot related information on these video
@RaghavPal Жыл бұрын
Great score Shankar, let me know what exactly you need. It may be present in next videos or I will send you a text answer for that
@dougm1189 ай бұрын
When I use %npx cypress run I do not get a screenshots or video folder automated created. I googled and had to set video:true, and screenshotOnRunFailure: true, in my cypress.config.js file as well as %npm install screenshot (although I am not sure if this is needed).
@RaghavPal9 ай бұрын
Let's address the issue with Cypress not automatically creating the screenshots and video folders during test runs. 1. Screenshots: - By default, Cypress captures screenshots automatically when a test fails during `cypress run`. However, screenshots are not automatically taken during `cypress open`. - To enable automatic screenshots on failure, ensure that you have set `screenshotOnRunFailure` to `true` in your `cypress.config.js` file: ```javascript // cypress.config.js module.exports = { // Other configuration options... screenshotOnRunFailure: true, }; ``` - Screenshots are stored in the `screenshotsFolder`, which is set to `cypress/screenshots` by default. If you want to change the folder location, you can specify a different path. 2. Videos: - Video recording is disabled by default but can be enabled by setting `video` to `true` in your configuration: ```javascript // cypress.config.js module.exports = { // Other configuration options... video: true, }; ``` - Videos are recorded for each spec file during `cypress run`. However, videos are not recorded during `cypress open`. - Videos are stored in the `videosFolder`, which is set to `cypress/videos` by default. 3. Additional Notes: - If you're using the `--record` flag while running tests (e.g., in a CI environment), videos are processed, compressed, and uploaded to Cypress Cloud after each spec file runs (whether successful or not). - If you don't want to clear your screenshots or videos folder before each run, you can set `trashAssetsBeforeRuns` to `false`. Remember to adjust your configuration settings as needed, and your screenshots and videos should be automatically generated during test runs
@victorebong9960 Жыл бұрын
I have been searching for your tutorial on Cypress cucumber but I can't find it. Can you please do a video on this?
@RaghavPal Жыл бұрын
I will plan on this Victor
@arunkamath76785 ай бұрын
Hi Raghav Sir, I hope this message finds you well. I have been following your videos to learn automation testing for my organization, and they have been immensely helpful. However, I am currently stuck on automating an Azure login process that involves three steps: entering an email address on the first page, typing a password on the second page, and completing Multi-Factor Authentication on the third page. Would you be able to provide guidance or assistance with this issue? Your expertise would be greatly appreciated.
@RaghavPal5 ай бұрын
Arun Automating the Azure login process with email, password, and Multi-Factor Authentication (MFA) can be challenging, but it's possible using Selenium or other automation tools. Here are some general concepts and approaches to help you achieve this: Use Selenium WebDriver: You can use Selenium WebDriver to automate the Azure login process. You'll need to choose a programming language (e.g., Python, Java, C#) and a WebDriver (e.g., ChromeDriver, GeckoDriver) to interact with the Azure login pages. Handle the email and password pages: Use Selenium to navigate to the Azure login page, enter the email address, and click the "Next" button. Then, enter the password and click the "Sign in" button. Handle the MFA page: After entering the password, you'll be redirected to the MFA page. You can use Selenium to interact with the MFA page, but you'll need to handle the MFA code generation and entry. One approach is to use an authenticator app like Google Authenticator or Microsoft Authenticator to generate the MFA code. Here's an example Python code using Selenium WebDriver to automate the Azure login process: python from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC # Set up the WebDriver driver = webdriver.Chrome() # Replace with your preferred WebDriver # Navigate to the Azure login page driver.get("login.microsoftonline.com/") # Enter the email address email_input = WebDriverWait(driver, 10).until( EC.presence_of_element_located((By.ID, "i0116")) ) email_input.send_keys("your_email@example.com") # Click the "Next" button next_button = driver.find_element_by_id("idSIButton9") next_button.click() # Enter the password password_input = WebDriverWait(driver, 10).until( EC.presence_of_element_located((By.ID, "passwordInput")) ) password_input.send_keys("your_password") # Click the "Sign in" button sign_in_button = driver.find_element_by_id("submitButton") sign_in_button.click() # Handle the MFA page mfa_code_input = WebDriverWait(driver, 10).until( EC.presence_of_element_located((By.ID, "idTxtBx_SAOTCC_OTC")) ) # Generate the MFA code using an authenticator app mfa_code = generate_mfa_code() # Implement your MFA code generation logic here # Enter the MFA code mfa_code_input.send_keys(mfa_code) # Click the "Verify" button verify_button = driver.find_element_by_id("idSubmit_SAOTCC_Continue") verify_button.click() # Close the WebDriver driver.quit() Note that you'll need to implement the generate_mfa_code() function to generate the MFA code using an authenticator app. You can use libraries like otplib to generate the MFA code. Remember to handle errors and exceptions properly, and make sure to follow Azure's terms of service and security guidelines when automating the login process. Also, consider using a more secure approach like Azure's MSAL (Microsoft Authentication Library) to handle authentication and authorization. MSAL provides a more secure and efficient way to authenticate with Azure services -
@khadijayamin16932 жыл бұрын
Hi, I have a question how I can enter empty string in mandatory field as .type() requires an argument? Can you help me to handle this situation ? Thanks
@RaghavPal2 жыл бұрын
just give an empty quote ' '
@khadijayamin16932 жыл бұрын
@@RaghavPal Thanks Sir for your reply. I tried and I get this error "cy.type() cannot accept an empty string. You need to actually type something."
@RaghavPal2 жыл бұрын
Try cy.get(#id).type('{backspace}')
@3aadel2 жыл бұрын
Hi Raghav, Many thanks ! Could you please show us how to deal with second Tab or child window with a dynamic url? (Can't switch to this tab or child window) in Cypress Thank you for the great job ❤😊
@RaghavPal2 жыл бұрын
Hi Adel, I believe as of now Cypress does not support multiple tabs/windows
@billykidd53139 ай бұрын
I got 23 out of 25. Things are getting abit complexed, Maybe relate how we might use these examples in a testing world. Thanks
@RaghavPal9 ай бұрын
Sure Billy, i will take a note of this
@KrishnaKumar-wy1mt2 жыл бұрын
Hello Rahul. Thank you very much for your brilliant tutorials. They are super useful. I am following step by step seeing your videos. But I am stuck here when I try to run the cypress tests from CLI. I get this following error. I searched in Google and I couldn't find a solution. 1) An uncaught error was detected outside of a test 0 passing (382ms) 1 failing 1) An uncaught error was detected outside of a test: ReferenceError: The following error originated from your test code, not from Cypress. > process is not defined When Cypress detects uncaught errors originating from your test code it will automatically fail the current test. Cypress could not associate this error to any specific test. We dynamically generated a new test to display this failure. Can you please help? I tried to run a test from Cypress and seeing this error ReferenceError The following error originated from your test code, not from Cypress. > process is not defined When Cypress detects uncaught errors originating from your test code it will automatically fail the current test. Cypress could not associate this error to any specific test. We dynamically generated a new test to display this failure. node_modules/ci-info/index.js:5:1 3 | const vendors = require('./vendors.json') 4 | > 5 | const env = process.env | ^ 6 | 7 | // Used for testing only 8 | Object.defineProperty(exports, '_vendors', { Everything was working perfectly fine yesterday. I started to see the error when run the tests from CLI.
@RaghavPal2 жыл бұрын
is this added automatically const env = process.env if yes, try to remove and check If you see any statement added by itself can remove and check
@KrishnaKumar-wy1mt2 жыл бұрын
@@RaghavPal Thank you for your quick reply, Rahul. I tried that too, but gave me different errors. Then I commented "import cypress from 'cypress'" under e2e.js then it started to work now. I don't how it got added.
@RaghavPal2 жыл бұрын
ok, sometimes when you use some field or function it tries to import from the relevant library or you may have selected unknowingly, thats ok
@KrishnaKumar-wy1mt2 жыл бұрын
Scored 23/25
@RaghavPal2 жыл бұрын
well done
@pradeeppatel-yo5ce Жыл бұрын
21 of 25
@RaghavPal Жыл бұрын
Great Pradeep
@pavithramugundhan27312 жыл бұрын
Hi raghav , thanks lot for masterclass , could please help me , how to attach screenshots to cucumber html report for passed as well as for failed scenarios in cypress version 10
@RaghavPal2 жыл бұрын
Hi Pavithra, can check this library - www.npmjs.com/package/cypress-cucumber-attach-screenshots-to-failed-steps
@pavithramugundhan27312 жыл бұрын
@@RaghavPal it’s done before cypress 10 ,but it’s not working now
@RaghavPal2 жыл бұрын
if you want to use BDD Cucumber with Cypress for now you have to use Cypress before ver 10, can use this command: npm install cypress@9.7.0
@emmanuelpenarodriguez98212 жыл бұрын
Hi, Raghav. I cannot run multiple commands in one single line if I include the config command either. Any idea?
@RaghavPal2 жыл бұрын
Hi Emmanuel, what part of the video is this related to, will need more details
@emmanuelpenarodriguez98212 жыл бұрын
@@RaghavPal Hi, this is at minute 23:30 in the step 4.
@RaghavPal2 жыл бұрын
Do you see any practical run in the video, can refer to cypress documentation
@gokulrao89842 жыл бұрын
While running CLI command npx cypress run -s.\cypress\E2E\pom.cy.js -b chrome, i am getting an error Can't run because no spec files were found. We searched for specs matching this glob pattern: I thought it was to do with the folder structure and i tried all possible options, it didnt work. Can i add screenshot of the folder structure
@gokulrao89842 жыл бұрын
Solution to above: I added a line to cypressconfig.js - specpattern: "cypress/E2E/*.cy.js" - please check the names of the folders as for me it worked when i changed e2e to E2E (as this was my folder name)
@RaghavPal2 жыл бұрын
Thanks for adding Gokul
@pranjaldesai7421 Жыл бұрын
How to check element is exist or not on DOM ?
@RaghavPal Жыл бұрын
Hi Pranjal In Cypress, you can use the get command followed by the should command to check if an element exists on the DOM. Cypress automatically retries the assertion until it passes or times out. Here's an example in Cypress: // Check if element exists cy.get('.my-element').should('exist'); // Check if element does not exist cy.get('.my-element').should('not.exist'); In the above example, get('.my-element') is used to select the element based on a CSS selector. Then, you can use the should command with the assertion 'exist' to check if the element exists on the DOM. Conversely, you can use 'not.exist' to check if the element does not exist. Cypress's built-in assertions and fluent chaining make it easy to write expressive and readable tests for element existence.
@pranjaldesai7421 Жыл бұрын
@@RaghavPal Thanks for your reply. I tried below cy.get(':nth-child(3) > .row > .col-md-3 > ls-select.ng-star-inserted > .ls-select > .mat-form-field > .mat-form-field-wrapper > .mat-form-field-flex > .mat-form-field-infix').then(($e2) =>{ if($e2.length){ cy.get(':nth-child(3) > .row > .col-md-3 > ls-select.ng-star-inserted > .ls-select > .mat-form-field > .mat-form-field-wrapper > .mat-form-field-flex > .mat-form-field-infix').click() }else { cy.log('not available'); } }) but it is not working. Can you please give example ?
@RaghavPal Жыл бұрын
Pranjal In Cypress, you can use the `.should()` command to check if an element exists in the DOM. Here's an example: //javascript cy.get('.my-element').should('exist').then(($element) => { // Element exists, perform actions here cy.log('Element exists'); }); In the above example, replace `.my-element` with the selector of the element you want to check for existence. The `.should('exist')` assertion ensures that the element exists in the DOM. If the element exists, the test will continue and you can perform further actions or assertions inside the `.then()` block. In the example, the log message "Element exists" is printed. If the element does not exist, the test will fail and display an error message
@RahulItapure Жыл бұрын
I want to know how to handle redirect urls in cypress
@RaghavPal Жыл бұрын
Hi Rahul, Handling redirect URLs in Cypress is quite straightforward. Here are a few steps to follow: Use the cy.request() command to make an HTTP request and follow redirects. The followRedirect option is set to true by default, which means that the request will automatically follow any redirect URLs. Use the cy.location() command to verify the URL after the redirect. This command can be used to get the URL of the current page and assert that it matches the expected URL. Here's an example test that demonstrates how to handle redirect URLs: describe('Redirect tests', () => { it('should follow redirect URL', () => { cy.request('GET', 'example.com/redirect') .then((response) => { // Verify that the response was successful expect(response.status).to.eq(200); // Verify that the redirect URL was followed cy.location('href').should('eq', 'example.com/destination'); }); }); }); In this example, we use the cy.request() command to make a GET request to a URL that redirects to another URL. We then use the then() function to verify that the response was successful and use the cy.location() command to verify that the redirect URL was followed and that the current URL matches the expected URL. Note that this is just a basic example and may need to be adapted for your specific use case.
@satyanarayanas67692 жыл бұрын
22 out of 25
@RaghavPal2 жыл бұрын
Great, all the best for next
@AbdulgaffarSanni Жыл бұрын
Thank you so much for your help this is really helpful. I have a basic question how can cy.get(".bg-\[\#0072cf\] >") be represented in my code knowing cypress cannot identify '\'
@RaghavPal Жыл бұрын
Abdul Since Cypress cannot directly handle the backslash character (`\`) within CSS selectors, you can use escape sequences to represent it within your code. The escape sequence for the backslash is `\\`. Here's the modified selector that correctly escapes the backslash: ```javascript cy.get(".bg\\[\\#0072cf\] >") ``` By using the escape sequence, you inform Cypress to interpret the backslash as an actual part of the selector and not as a special character. This ensures that Cypress correctly identifies the element with the specified class attribute.
@AbdulgaffarSanni Жыл бұрын
Thank you so much. This works fine@@RaghavPal
@SarveshNellor5 ай бұрын
for Me video recording not showing while running in cmd
@RaghavPal5 ай бұрын
will need more details.. steps, logs...
@ChrisPTY5072 жыл бұрын
How many parts will this master class have?
@RaghavPal2 жыл бұрын
As of now I have created 4 parts and all of them are published
@ChrisPTY5072 жыл бұрын
@@RaghavPal ok thanks!
@gowreeswaribongu2257 Жыл бұрын
24/25
@RaghavPal Жыл бұрын
Great score
@rajasekhar93712 жыл бұрын
22 marks I got out of 25
@RaghavPal2 жыл бұрын
well done
@rajasekhar93712 жыл бұрын
Hi Raghav, first of all thanks for creating masterclass on cypress. I need to get some values like transaction ID from splunk...it is a kind of paragraph in splunk...from that string I need to separate transaction id...plz help me to get that value from splunk....
@RaghavPal2 жыл бұрын
Hi Raja, I have not tried that, will need to take online help
@hazimabdoh63032 жыл бұрын
the same like we pronounces cash
@RaghavPal2 жыл бұрын
ok
@abcefg7045 Жыл бұрын
20/ 25 with 3 silly mistakes😅
@RaghavPal Жыл бұрын
Great, try for next
@abcefg7045 Жыл бұрын
@@RaghavPal hii please make a video for integrating Cypress with report portal
@RaghavPal Жыл бұрын
I will plan
@oluwolebadmus6374 Жыл бұрын
Hi Raghav, great lecture. While running the RW_demo[dot]cy[dot]js: ```it('read files using fixture', function(){ cy.fixture('example.json').then(('data') => { cy.log(data.email) }) ``` Error: "Binding invalid left-hand side in function parameter list." I keep getting that compilation error that originates from the ".then(('data') =>" part. I read somewhere that it could be due to outdated TSC. We haven't even discussed in this video. Can you pls help?
@oluwolebadmus6374 Жыл бұрын
i figured it ....I erroneously put data inside inverted comas i.e. 'data'.
@RaghavPal Жыл бұрын
Great. all the best for next Martins
@vighneshmane208011 ай бұрын
at 55:55 with this : before(() => { cy.fixture("example").as("test_data"); }); it("Read files using Fixture", () => { cy.fixture("example").then((data) => { cy.log(data.name); cy.log(data.email); }); cy.log(this.test_data.name); }); I have got this error: Cannot read properties of undefined (reading 'test_data') cypress/e2e/readwritefiles.cy.js:10:15 8 | cy.log(data.email); 9 | }); > 10 | cy.log(this.test_data.name); | ^ 11 | }); 12 | Can someone help if there is anything wrong here?
@RaghavPal11 ай бұрын
Vighnesh The error "Cannot read properties of undefined (reading 'test_data')" is happening because you're trying to access `this.test_data` before it's fully available within the test case. Here's a breakdown of the issue and the solution: 1. Asynchronous Nature of Fixture Loading: - Cypress loads fixtures asynchronously, meaning it takes some time to fetch and process the data. - The `this.test_data` property won't be populated instantly when the test starts. 2. `cy.fixture("example").then(...)` vs. Direct Access: - Using `cy.fixture("example").then(...)` ensures you access the fixture data only after it's loaded successfully. - Trying to access `this.test_data` directly outside of a `.then()` block might lead to the error because the data might not be ready yet. Solution: 1. Access Fixture Data Within `.then()`: - Move the code that uses `this.test_data` inside the `.then()` block after loading the fixture: ```javascript before(() => { cy.fixture("example").as("test_data"); }); it("Read files using Fixture", () => { cy.fixture("example").then((data) => { cy.log(data.name); cy.log(data.email); // Access test_data here after it's loaded: cy.log(this.test_data.name); }); }); ``` 2. Remove Redundant Fixture Loading: - Since you've already loaded the fixture in the `before` hook, there's no need to load it again inside the test. Corrected Code: ```javascript before(() => { cy.fixture("example").as("test_data"); }); it("Read files using Fixture", () => { cy.then(() => { const data = this.test_data; cy.log(data.name); cy.log(data.email); }); }); ``` Remember: - Always access fixture data within `.then()` blocks or after ensuring it's loaded. - Avoid redundant fixture loading to improve test efficiency. ..
@digarkarki5628 Жыл бұрын
thanks for the video but i am getting an error while using cy.log(this.test_data.name) which we are using in 55:33 and the error i am getting is TEST BODY TypeError Cannot read properties of undefined (reading 'test_data') cypress/e2e/readwritefilesdemo.cy.js:9:21 7 | cy.log(data.name); 8 | cy.log(data.body); > 9 | cy.log(this.test_data.name) | ^ 10 | }) 11 | })
@digarkarki5628 Жыл бұрын
got the issue i were using arrow function instead of function keyword now it is working but why can't we use arrow function instead of function keyword here?
@RaghavPal Жыл бұрын
Good. will cover this in JS tutorial. Can continue for now
@nicolasma74242 жыл бұрын
Hi Raghav, at 55'53, you add the following line "cy.log(this.blabla.name);" But it's not working for me. I get the following error message: "Cannot read properties of undefined (reading 'test_data')". I'm looking into it but I can't find where the issue comes from. Do you have a repo from your code somewhere ?
@RaghavPal2 жыл бұрын
Hi Nicolas, I believe there is some error or syntax issue, Pls check the code again, Also check the top of your code, in case any unnecessary libraries are imported
@nicolasma74242 жыл бұрын
@@RaghavPal I found where the issue comes from. This is my code: it('read files using fixtures', () => { cy.log(this.test_data.name); }) And this is yours: it('read files using fixtures', function () { cy.log(this.test_data.name); }) Can you please explain the difference between "function ()" and "() =>" ? I thought they were the exact same things... how come one is working and not the other ?
@RaghavPal2 жыл бұрын
I will check on this and explain
@tranhabaongoc2 жыл бұрын
@@nicolasma7424 confirm the above is true: I can run with 'function() ...' but not '() => {...}'. It's a mystery.
@nicolasma74242 жыл бұрын
@@tranhabaongoc Yeah that's weird. I can't explain it either and would be very curious to know what's going on under the hood here.
@Sarveshnellor-b1z5 ай бұрын
it('readfile demo',()=>{ cy.fix auto suggestion not showing can please help
@RaghavPal5 ай бұрын
Sarvesh Let's break this down step by step: Step 1: Check if you have the correct Cypress version Make sure you're running the latest version of Cypress. You can check by running `npx cypress --version` in your terminal. If you're not on the latest version, update Cypress using `npm install cypress@latest` or `yarn add cypress@latest`. Step 2: Verify that you have the correct syntax The correct syntax for reading a file in Cypress is `cy.readFile()`, not `cy.fix`. `cy.fix` is not a valid Cypress command. `cy.readFile()` is used to read the contents of a file. Here's an example of how you can use `cy.readFile()`: ```javascript it('read file demo', () => { cy.readFile('path/to/your/file.txt').then((fileContent) => { // do something with the file content }) }) ``` Step 3: Check your IDE settings If you're using an Integrated Development Environment (IDE) like Visual Studio Code, IntelliJ, or Sublime Text, make sure that your IDE is configured to provide auto-suggestions for Cypress commands. For example, in Visual Studio Code, you can install the Cypress extension and then restart your IDE. This should enable auto-suggestions for Cypress commands. Step 4: Check for any typos or incorrect imports Double-check that you've imported Cypress correctly at the top of your test file: ```javascript import { cy } from 'cypress' ``` Also, verify that you haven't accidentally typed `cy.fix` instead of `cy.readFile()`. --
@maaddhubabbu6767 Жыл бұрын
before(function() { cy.fixture("example.json").as('test_data') }) it("should be able to read and write files", () => { cy.fixture("example.json").then((data) => { cy.log(data.name); cy.log(data.email) }) cy.log(this.test_data.name); }) Facing error while trying to access cy.log(this.test_data.name); tried to find solution but could not. Is there anything wrong with code.
@RaghavPal Жыл бұрын
The error you are getting is because you are trying to access the `test_data` object before it has been initialized. The `before()` hook is executed before all of the tests in a suite, so the `test_data` object is not yet initialized when your `it()` test is executed. To fix this error, you need to move the `cy.fixture("example.json").as('test_data')` line into the `it()` test. This will ensure that the `test_data` object is initialized before you try to access it. Here is a corrected version of your code: ```javascript it("should be able to read and write files", () => { // Fixture the test data cy.fixture("example.json").as("test_data"); // Log the name and email from the test data cy.log(this.test_data.name); cy.log(this.test_data.email); }); ``` Now, when you run your test, you should see the name and email from the `example.json` file logged to the console. I hope this helps
@maaddhubabbu6767 Жыл бұрын
Thank you for the quick response @@RaghavPal
@mariuszpodgorski66952 жыл бұрын
What are benefits of using methods in classes that contains only one step for example click()? Except of course code is clean but we are wasting time for making method. If I write it like this: cy.get(LoginPage.new_user_signup_text).should('have.text', 'New User Signup!'); I have all informations and I think it is self explained to. Time is money. I saw lot of tutorials that people are making one step methods but I never got the answer. In selenium, java it is even cleaner click(UserPanelPage.pencilIconButton); Can you answer me this question please.
@RaghavPal2 жыл бұрын
Hi Mariusz, you can club multiple actions and can also create custom commands and add multiple steps in one command