Рет қаралды 1,676
00:00 Intro
01:15 Scenario 1:
You're automating a login feature for a web application
How will you handle dynamic elements like Captcha or OTP fields in your automation script?
Answer:
To handle dynamic elements like Captcha or OTP fields, I would consider the following solutions:
We can request the development team to disable Captcha and OTP in the test environment to make automation feasible
Add a hook to allow tests to bypass the CAPTCHA
We can work closely with the development team to set a predefined OTP for the test environment
________________________________________________
03:45 Scenario 2:
During test automation, you encounter an element that doesn't have unique attributes. How would you locate and interact with such an element?
Answer:
Use XPath with the contains() function
Use CSS selectors with the contains() function
Use the element's text content
Use the element's position
Use a combination of the above methods
Discuss with Developers
________________________________________________
05:43 Scenario 3:
You're testing an e-commerce website, and you need to automate a scenario where a user adds multiple products to their cart. How would you design and execute this test case efficiently?
Answer:
To efficiently automate adding multiple products to a cart:
Create a test data set with various products to add
Use a loop in your automation script to iterate through the products in the data set.
For each product, navigate to the product page, click the "Add to Cart" button, and verify the item is added
Repeat the loop for each product
After all products are added, go to the shopping cart page to verify the correct items are listed
Ensure the test environment is reset between test iterations to avoid interference
________________________________________________
07:30 Scenario 4:
In an agile development environment, how do you ensure that your automation scripts remain up-to-date as the application evolves with frequent changes?
Answer:
To keep automation scripts up-to-date in an agile environment:
Collaborate: communication with developers & testers to stay informed about changes
Version Control: Store automation scripts in VCS like Git to track changes and easily roll back if needed
Continuous Integration: Integrate automation into the CI/CD pipeline to run tests automatically with each code change
Regular Maintenance: Schedule regular script reviews and updates to align with the evolving application
Use Page Object Model: Implement a Page Object Model to separate UI elements from test logic, making updates more manageable
Automated Test Data Generation: Automate the creation of test data or use data generation tools to adapt to changes
Use Dynamic Locators: Employ dynamic locators that can adapt to UI changes, such as relative XPath or CSS selectors
Monitor Logs: Keep an eye on test execution logs for failures caused by changes, and update scripts accordingly
________________________________________________
12:50 Outro
Every Like & Subscription gives me great motivation to keep working for you
You can support my mission for education by sharing this knowledge and helping as many people as you can
If my work has helped you, consider helping any animal near you, in any way you can
Never Stop Learning
Raghav Pal
All Free Tutorials 🟢 AutomationStepByStep.com/
---