Interviews Questions : 1 Scenario Based Question from Real Interviews
- Get link
- X
- Other Apps
1. Behavioral question
Questions Answers 1. Tell me about yourself? Starting with my name I’m John. I have 8 years of working as a Software tester currently I am working in Bank of America in regards to the Bill tracker application. Bill tracker application helps the customer to track all their bills and subscription in one place, they also get reminder alerts. (Then jump on achievement and daily activities)
Achievement
Texas Capital Bank had no proper automation process prior to helping them to build a proper automation process - I created the selenium page object framework where all QAs can use it - trained others on how to use this framework - Documented on how to use the framework -Implemented Git hub and Jenkins -Implemented parallelly execution of testcase.
Daily activities -Checking Daily Jenkins Executions -Investigate the Jenkins test failures
-convert manual to automation testcases
-Check PR request of other Automation engineers in GitHub
-Agile ceremony meetings
-Assist or help other automation engineers
2. Why are you leaving your job? Currently, my job is a contract job. So, I am looking for a more permanent position. Also, I am trying to advance my career. 3. Why do you interest in this company? I did some research about this company and figured out that the company is great. I get the impression of a great place to work, and I would love to be on the team. 5. What do you do on a daily basis? So on a daily basis, I started my day with a daily standup meeting and explain my progress. I got the documentation from Team Lead. Then, I would read the documentation. Implementing the code, executing the code, making report. And obviously I found the bug and let my team lead know and also put in the Jira so developer can also see that. We have weekly meetings to our dev team and discuss about the bugs/errors I find out. Basically, that’s all. 6. What motivates you? I love what I am doing, I want to grow my career as a QA, which actually motivates me. 7. What do you like in QA? I always had passion for tech and I like working with smart people, I like to break things down, and I like to improve the user’s experience. 8. What do you dislike in QA? What I dislike is the amount of necessary attention to detail. It creates pressure because if you miss any single point, it affects the whole software. 9. If we contact your manager/colleagues, what they tell you about you? I believe I met the teams’ expectation, so I think they will provide positive feedback about me.
I do have good relationship with my co-workers, so I hope they will provide positive feedback about me.
10. What makes you better other than other candidates / Why should we hire you? Of course. I know you are looking for someone who is experienced, love to work what he is doing. And, I am excited to bring my skills and expertise to this roles. And, I think I would be an excellent match for this role. I have created multiple selenium framework from scratch and implemented many new technologies such as Sauce labs, Zephyr and Zapi 11. How big is your team? - 3 Developers, 2 QA(one mannual one automation), 1 tech lead, one BA, One project manager, one product owner, 1 scrum master 12. Tell us about a conflict that you had with co-workers. 13. What are your top 3 skills? 1. I am a team player.
2. Open minded.
3. On time delivery the task that I am assigned to.
14. What are your weaknesses? Sometimes, I spend more time understanding the details, and I have trouble delivering on-time. However, I have improved over time. 15. Could you describe QA process you have? 1. I get the documentation from my tech lead in Jira.
2. I read the requirements.
3. I create test cases.
4. I execute test cases in the correct QA (development/staging) environment and save them into a proper collection so I can reuse them. Then, also did the cross-browser testing using browser-stack.
5. Made the test cases execution report.
16. What does quality assurance mean to you? Delivering the best possible experience for our customers. 17. How do you deal with conflicts? In case I ever have to deal with this, I would try to take the person aside and discuss the issue first. I listen actively to make sure I understand the other person’s point of view, and I work with the person to develop a solution together. 18. What can you bring to the company? I can bring my experience and help deliver a quality product for our customers, I’m hard working and very detail-oriented. I can bring great performance and results to the team in order to create a great user experience for our customers. I have created multiple selenium framework from scratch and implemented many new technologies such as Sauce labs, Zephyr and Zapi. I have also helped train lot of individuals and created lot training and explanation document. 19. What type of project are you working now? Enterprise resource planning (ERP) software system for club management. 21. What are your goals in 5 years? I see myself implementing new technologies and expand the automation test coverage to include more testcases. Making a documented process about automated testing. 22. You are going into a battle, and have 2 choices like 2 different fights in the battle and you have to choose 1 fight. In 1 fight you have to fight with a Duck (size is like horse). Other fight is, you have to fight with 100 horses with size of Duck. Which one you want to face. How would you handle that you choose. There is no wrong or right answer. but best answer is 100 horses size of ducks. 23. Tell your experience about what are the hurdles you faced with Java or Selenium. Java is easy to handle and has a lot of resources. But programs like C#, and python have easier of accessing collection libraries. 24. Any work come with hurdles. So, do you feel any problems with that? Absolutely! No job is without its challenges, but I believe it's all about having the right mindset when facing those hurdles. Staying calm under pressure, collaborating closely with my colleagues, and coming up with innovative solutions helped me navigate through those tough periods successfully.
Questions | Answers |
1. Tell me about yourself? | Starting with my name I’m John. I have 8 years of working as a Software tester currently I am working in Bank of America in regards to the Bill tracker application. Bill tracker application helps the customer to track all their bills and subscription in one place, they also get reminder alerts. (Then jump on achievement and daily activities) Achievement Texas Capital Bank had no proper automation process prior to helping them to build a proper automation process - I created the selenium page object framework where all QAs can use it - trained others on how to use this framework - Documented on how to use the framework -Implemented Git hub and Jenkins -Implemented parallelly execution of testcase. Daily activities -Checking Daily Jenkins Executions -Investigate the Jenkins test failures -convert manual to automation testcases -Check PR request of other Automation engineers in GitHub -Agile ceremony meetings -Assist or help other automation engineers |
2. Why are you leaving your job? | Currently, my job is a contract job. So, I am looking for a more permanent position. Also, I am trying to advance my career. |
3. Why do you interest in this company? | I did some research about this company and figured out that the company is great. I get the impression of a great place to work, and I would love to be on the team. |
5. What do you do on a daily basis? | So on a daily basis, I started my day with a daily standup meeting and explain my progress. I got the documentation from Team Lead. Then, I would read the documentation. Implementing the code, executing the code, making report. And obviously I found the bug and let my team lead know and also put in the Jira so developer can also see that. We have weekly meetings to our dev team and discuss about the bugs/errors I find out. Basically, that’s all. |
6. What motivates you? | I love what I am doing, I want to grow my career as a QA, which actually motivates me. |
7. What do you like in QA? | I always had passion for tech and I like working with smart people, I like to break things down, and I like to improve the user’s experience. |
8. What do you dislike in QA? | What I dislike is the amount of necessary attention to detail. It creates pressure because if you miss any single point, it affects the whole software. |
9. If we contact your manager/colleagues, what they tell you about you? | I believe I met the teams’ expectation, so I think they will provide positive feedback about me. I do have good relationship with my co-workers, so I hope they will provide positive feedback about me. |
10. What makes you better other than other candidates / Why should we hire you? | Of course. I know you are looking for someone who is experienced, love to work what he is doing. And, I am excited to bring my skills and expertise to this roles. And, I think I would be an excellent match for this role. I have created multiple selenium framework from scratch and implemented many new technologies such as Sauce labs, Zephyr and Zapi |
11. How big is your team? | - 3 Developers, 2 QA(one mannual one automation), 1 tech lead, one BA, One project manager, one product owner, 1 scrum master |
12. Tell us about a conflict that you had with co-workers. | |
13. What are your top 3 skills? | 1. I am a team player. 2. Open minded. 3. On time delivery the task that I am assigned to. |
14. What are your weaknesses? | Sometimes, I spend more time understanding the details, and I have trouble delivering on-time. However, I have improved over time. |
15. Could you describe QA process you have? | 1. I get the documentation from my tech lead in Jira. 2. I read the requirements. 3. I create test cases. 4. I execute test cases in the correct QA (development/staging) environment and save them into a proper collection so I can reuse them. Then, also did the cross-browser testing using browser-stack. 5. Made the test cases execution report. |
16. What does quality assurance mean to you? | Delivering the best possible experience for our customers. |
17. How do you deal with conflicts? | In case I ever have to deal with this, I would try to take the person aside and discuss the issue first. I listen actively to make sure I understand the other person’s point of view, and I work with the person to develop a solution together. |
18. What can you bring to the company? | I can bring my experience and help deliver a quality product for our customers, I’m hard working and very detail-oriented. I can bring great performance and results to the team in order to create a great user experience for our customers. I have created multiple selenium framework from scratch and implemented many new technologies such as Sauce labs, Zephyr and Zapi. I have also helped train lot of individuals and created lot training and explanation document. |
19. What type of project are you working now? | Enterprise resource planning (ERP) software system for club management. |
21. What are your goals in 5 years? | I see myself implementing new technologies and expand the automation test coverage to include more testcases. Making a documented process about automated testing. |
22. You are going into a battle, and have 2 choices like 2 different fights in the battle and you have to choose 1 fight. In 1 fight you have to fight with a Duck (size is like horse). Other fight is, you have to fight with 100 horses with size of Duck. Which one you want to face. How would you handle that you choose. | There is no wrong or right answer. but best answer is 100 horses size of ducks. |
23. Tell your experience about what are the hurdles you faced with Java or Selenium. | Java is easy to handle and has a lot of resources. But programs like C#, and python have easier of accessing collection libraries. |
24. Any work come with hurdles. So, do you feel any problems with that? | Absolutely! No job is without its challenges, but I believe it's all about having the right mindset when facing those hurdles. Staying calm under pressure, collaborating closely with my colleagues, and coming up with innovative solutions helped me navigate through those tough periods successfully. |
2. Project base
Project 1
Questions Answers 1. What software are you currently testing? https://docs.google.com/document/d/1js3oFsV8SNLbfcGUZLhhT_aT1Y_xexTsYXmxX3ii6JA/edit 2. Can you tell me more what is User doing with the application? There are 2 types of users. One is client and other one is clients client. Client is using for day-to-day activities because it’s a club management software. Like Account Receiver module like any financial task done by club management staff. Other module is Hotel. If anyone books hotel then bill of the client is generated by the software. Since it’s a ERP, so its does whole operation of the club from every aspect. Even parking or checking the parking is also done thru this software. 3. How long are your sprints? 2 weeks. 4. Do you deploy production in every 2 weeks / what’s the release cycle. There are 2 types of release. One is hotfix and other one normal release. Hot fixes needs to be released as soon as possible. QA Engineer found a bug when executing the test case in Jenkins., so we have to fix, test and deployed. There are no timeline for that. They can be done 1 day or 2 day depending on the work. Other one regular release and that are done after every sprints. 5. Did you do automation within the sprint? No we usually automated testcases from previous sprints 6. How much time do you spend manual and automation testing? From myside I am not doing manual testing. My full focus is Automation.
For whole QA side, we have dedicated resources for each area. We have 8 resources for Automation and 40 resources for manual. 7. What percentage of manual and automation coverage is your current project? ->>(75% automation and 25% manual.) We just automate the core functions. So 25% automation, 75% manual. 8. How do you approach like what type of test you need to automate? - writing end to end test caes 9. What is the process of your framework? Requirements Analysis: Before starting any testing, QA engineers need to understand the requirements of the application. They need to analyze functional specifications, user stories, and acceptance criteria.
Test Planning: Once requirements are understood, a test plan is created. This includes the scope of testing, objectives, resources, schedule, risk assessment, and deliverables.
Setting up the Environment: This involves setting up the test environment. This could be a local setup or a dedicated test environment that mimics production.
Design and Set up a Test Framework: Depending on the project, QA engineers might have to set up or update an existing test framework. This can be a Data-Driven Framework, Keyword Driven Framework, Page Object Model, or Hybrid. This step includes deciding on the tools, languages, and libraries to be used.
Test Data Preparation: Depending on the test cases, QA engineers create or generate test data which will be used while executing test cases.
Writing Test Cases and Scripts: Write automated test scripts using the chosen test framework. This involves coding test cases based on the requirements and using the test data prepared.
Code Review: The test scripts are usually reviewed by peers or a senior QA engineer to ensure the code meets the standards and is optimized.
Test Execution: Execute the test scripts. This could be done on a local machine or in a CI/CD environment.
Result Analysis and Reporting: After the test execution, results are analyzed. Any bugs or issues are documented and reported back to the development team.
Bug Tracking: If any bugs are identified, they are logged into a bug tracking tool (e.g., JIRA) and communicated to the development team.
Retesting and Regression: Once the bugs are fixed, the QA team does retesting to ensure the bugs are fixed and also regression testing to make sure new code changes have not affected existing functionality.
Feedback Loops: Continuously communicate with developers, product owners, and other stakeholders, ensuring that there is feedback at each stage of testing.
Documentation: Update test case documentation and make sure all the test steps, expected results, and actual results are documented for future reference.
Release and Deployment Support: In case of release, QA may be involved in verifying the deployment process, and sanity testing post-deployment.
Review and Retrospective: After the release, there’s usually a review or retrospective to discuss what went well and what needs improvement for the next iteration.
Maintaining Test Cases and Framework: As the application grows, QA needs to maintain the test cases and the framework, updating them as necessary. 11. how many pages your framework has. (approx.) There are lot of pages but approximately right now we are around 100+ pages. 12. Have you use cloud based system like lambda-test, saucelabs, browserstack. I used browserstack for different version of the MS edge and for recording as well 13. Have you do cross-browser testing at all? No. Because we only use MS Edge. 16. In 2 weeks, how many hours allocated to a given sprint for testing? They are divided at like they have 10 working days that they're next two weeks with the holidays. So seven days are for development and three days for testing. If the developer gives the builder early. We start testing. Sometimes there are multiple multiple tasks, so if divided like this like 2 days for development and one day for testing, then two days for development and one day for testing. It isn't necessary that there are seven days has to be in consecutive days. 19. I want to know what your requirement contains? Can you explain one example of something related to your project case? What kind of steps you'll see? It basically contains complete business model. First thing, we need the the flow. Basically working flow of the process.Then the other thing we will be needing is a mock up. Basically we need to have a UI. We need have a UI for what we have been developing a back end. Apart from that, you would need some diagrams. Some software uses this and some software doesn't. One of the most common is state transition diagram. That defines all of the all the possible state in a process. So these are things that we we would be requiring before testing and developing. 20. If you encounter a requirement that is presented as a user story, where should it be documented, considering that the expected format for this requirement is a user story? In Agile development, requirements in the form of user stories are typically documented in a Product Backlog. The Product Backlog is a prioritized list of everything that is known to be needed in the product. Each user story will usually have a standard structure and contain the type of user, what they want, and why. User stories are meant to be short and to the point, and they are used as a basis for defining the features and functionalities of the application. 21. Lets say, a weird error comes up. Then what would you do? 1. Reproduce the Error: Try to reproduce the error consistently by following exact same set of actions that caused it initially.
2. Document the Error.
3. Analyze the Error: for what reason the error generates.
4. Notify Relevant Team Members 22. Who write your test cases? Basically our manual testing or BA's teams writes the test cases. Sometimes, we the write test cases as a team as well. 25. How you are maintaining your test data or XPath, or test results, reports? It may vary based on team's preference but typically: Cloud, external data storage, Page Object models. Or some combination of tools available. Generally it's Excel or some sort of database. 26. Can I ask you what are the most amount of tests you have? What type of tests do you think you have the most of? (Like functional, api, sanity etc) Function are the most common. The ones I tend to be more involved with are Sanity and regression. 27. What system are you using? Windows or Unix? Windows 28. What sort of things you are preparing for the release like what sort of tests you are running order wise? As an automation eningeer you are running the Jenkins regression before the release 29. In your project, what are the challenges you faced? my current project had lot of bugs and application was not stable in the begginging. 31. who made the automation framework . I am part of the automation building and maintaining team 32. Your agile team, do you create test plans? no 33. Do you run a a regression at the end of each Sprint? we run regression test via Jenkins , every single night and also during release as well 34. How do you identify the test cases that you believe should be added to the regression suite? all testcases are part of regression suite 35. Tell me about your SQL experience like how do you use it? To me it's mostly a translation experience. What I mean is usually people want an excel document or want me to take SQL and make it a little more digestible. (Charts, percentages, demographics) 39. Do you have access to the code developers code? no 40. Like what kind of documentation did you prepare ? created the framework explanation document, automation process documentation with selenium, JIRA and Jenkins. Tools documentation and how each testing tool works. Training document for new commers. 42. What sort of information you provide for developer to debug alongside with screenshot? We provide step by step on how to recreate the bug 43. What tool do use you for micro service level validations? API Postman: It's a popular tool for API testing. It provides features for sending HTTP requests to REST endpoints and viewing responses. 44. How do you parameterize a test plan in JMeter? So since parameterization is the process of executing the same test scripts with multiple data sets. In Jmeter you can do this using a CSV Data set config or User Defined Variables. 46. Since you are in a Agile team? Can you explain the process A to Z? Project Initiation: The project is initiated with high-level scope and goals. In Agile, you don’t need a fully detailed long-term plan, but you need a general direction.
Roles and Responsibilities: Define the team structure. Agile teams are usually cross-functional and include roles such as Product Owner, Scrum Master, and Team Members.
Product Backlog Creation: The Product Owner creates a product backlog which is a prioritized list of features, bug fixes, and all changes to be made to the product.
Sprint Planning: The team holds a sprint planning meeting to decide on the set of features from the product backlog that will be worked on during the next sprint (usually 2-4 weeks).
Daily Stand-up: Each day of the sprint, a short stand-up meeting is held, usually 15 minutes, where team members discuss what they completed yesterday, what they will work on today, and identify any blockers.
Development and Testing: The development team works on the tasks decided in the sprint planning. Agile promotes a testing approach that runs in parallel, so QA members should be involved early and continuously.
Backlog Grooming/Refinement: During the sprint, the product backlog is also continuously updated and prioritized to ensure that the team is always working on the most valuable features.
Sprint Review: At the end of the sprint, a review is held to demonstrate the functionality created during the sprint. It’s a time for feedback from stakeholders and for the team to see what they accomplished.
Sprint Retrospective: After the sprint review, the team holds a retrospective to discuss what went well, what could be improved, and what will be done differently in the next sprint.
Release Planning and Deployment: Depending on the project, a release might include the features from one or more sprints. The team needs to plan the release and coordinate the deployment.
Feedback and Adaptation: After the release, the team collects feedback from end-users and any data that can be useful for improving the product.
Next Sprint Planning: The process is iterative, so after one sprint ends, the next begins 48. Have you used Excel sheets in the automation? Yes, often. 49. On the DB side, so are you writing SQL queries on daily basis or sometimes you are? Sometimes are, generally with me they just want it to look more professional or presentable. 50. When you are testing an application, how do you handle the process when the data is coming from different sources, such as login data and password data? Data necessarily needs to be managed depending on the data sources. Login data might be stored in a database while passwords might be stored in configuration files. Generally the data is stored in a centralized data repository (such as excel sheets). The short answer is different data might go to the same place ultimately but needs to be organized appropriate to the company's wants. 51. You run the test in the night. And you get the report in the morning. Then what do you do? Review it, check for and log the defects. Update the Test execution status (ie what passeed and failed). You share the results and if necessary discuss results at meeting if a plan for additional testing is needed.
Questions | Answers |
1. What software are you currently testing? | https://docs.google.com/document/d/1js3oFsV8SNLbfcGUZLhhT_aT1Y_xexTsYXmxX3ii6JA/edit |
2. Can you tell me more what is User doing with the application? | There are 2 types of users. One is client and other one is clients client. Client is using for day-to-day activities because it’s a club management software. Like Account Receiver module like any financial task done by club management staff. Other module is Hotel. If anyone books hotel then bill of the client is generated by the software. Since it’s a ERP, so its does whole operation of the club from every aspect. Even parking or checking the parking is also done thru this software. |
3. How long are your sprints? | 2 weeks. |
4. Do you deploy production in every 2 weeks / what’s the release cycle. | There are 2 types of release. One is hotfix and other one normal release. Hot fixes needs to be released as soon as possible. QA Engineer found a bug when executing the test case in Jenkins., so we have to fix, test and deployed. There are no timeline for that. They can be done 1 day or 2 day depending on the work. Other one regular release and that are done after every sprints. |
5. Did you do automation within the sprint? | No we usually automated testcases from previous sprints |
6. How much time do you spend manual and automation testing? | From myside I am not doing manual testing. My full focus is Automation. For whole QA side, we have dedicated resources for each area. We have 8 resources for Automation and 40 resources for manual. |
7. What percentage of manual and automation coverage is your current project? ->>(75% automation and 25% manual.) | We just automate the core functions. So 25% automation, 75% manual. |
8. How do you approach like what type of test you need to automate? | - writing end to end test caes |
9. What is the process of your framework? | Requirements Analysis: Before starting any testing, QA engineers need to understand the requirements of the application. They need to analyze functional specifications, user stories, and acceptance criteria. Test Planning: Once requirements are understood, a test plan is created. This includes the scope of testing, objectives, resources, schedule, risk assessment, and deliverables. Setting up the Environment: This involves setting up the test environment. This could be a local setup or a dedicated test environment that mimics production. Design and Set up a Test Framework: Depending on the project, QA engineers might have to set up or update an existing test framework. This can be a Data-Driven Framework, Keyword Driven Framework, Page Object Model, or Hybrid. This step includes deciding on the tools, languages, and libraries to be used. Test Data Preparation: Depending on the test cases, QA engineers create or generate test data which will be used while executing test cases. Writing Test Cases and Scripts: Write automated test scripts using the chosen test framework. This involves coding test cases based on the requirements and using the test data prepared. Code Review: The test scripts are usually reviewed by peers or a senior QA engineer to ensure the code meets the standards and is optimized. Test Execution: Execute the test scripts. This could be done on a local machine or in a CI/CD environment. Result Analysis and Reporting: After the test execution, results are analyzed. Any bugs or issues are documented and reported back to the development team. Bug Tracking: If any bugs are identified, they are logged into a bug tracking tool (e.g., JIRA) and communicated to the development team. Retesting and Regression: Once the bugs are fixed, the QA team does retesting to ensure the bugs are fixed and also regression testing to make sure new code changes have not affected existing functionality. Feedback Loops: Continuously communicate with developers, product owners, and other stakeholders, ensuring that there is feedback at each stage of testing. Documentation: Update test case documentation and make sure all the test steps, expected results, and actual results are documented for future reference. Release and Deployment Support: In case of release, QA may be involved in verifying the deployment process, and sanity testing post-deployment. Review and Retrospective: After the release, there’s usually a review or retrospective to discuss what went well and what needs improvement for the next iteration. Maintaining Test Cases and Framework: As the application grows, QA needs to maintain the test cases and the framework, updating them as necessary. |
11. how many pages your framework has. (approx.) | There are lot of pages but approximately right now we are around 100+ pages. |
12. Have you use cloud based system like lambda-test, saucelabs, browserstack. | I used browserstack for different version of the MS edge and for recording as well |
13. Have you do cross-browser testing at all? | No. Because we only use MS Edge. |
16. In 2 weeks, how many hours allocated to a given sprint for testing? | They are divided at like they have 10 working days that they're next two weeks with the holidays. So seven days are for development and three days for testing. If the developer gives the builder early. We start testing. Sometimes there are multiple multiple tasks, so if divided like this like 2 days for development and one day for testing, then two days for development and one day for testing. It isn't necessary that there are seven days has to be in consecutive days. |
19. I want to know what your requirement contains? Can you explain one example of something related to your project case? What kind of steps you'll see? | It basically contains complete business model. First thing, we need the the flow. Basically working flow of the process.Then the other thing we will be needing is a mock up. Basically we need to have a UI. We need have a UI for what we have been developing a back end. Apart from that, you would need some diagrams. Some software uses this and some software doesn't. One of the most common is state transition diagram. That defines all of the all the possible state in a process. So these are things that we we would be requiring before testing and developing. |
20. If you encounter a requirement that is presented as a user story, where should it be documented, considering that the expected format for this requirement is a user story? | In Agile development, requirements in the form of user stories are typically documented in a Product Backlog. The Product Backlog is a prioritized list of everything that is known to be needed in the product. Each user story will usually have a standard structure and contain the type of user, what they want, and why. User stories are meant to be short and to the point, and they are used as a basis for defining the features and functionalities of the application. |
21. Lets say, a weird error comes up. Then what would you do? | 1. Reproduce the Error: Try to reproduce the error consistently by following exact same set of actions that caused it initially. 2. Document the Error. 3. Analyze the Error: for what reason the error generates. 4. Notify Relevant Team Members |
22. Who write your test cases? | Basically our manual testing or BA's teams writes the test cases. Sometimes, we the write test cases as a team as well. |
25. How you are maintaining your test data or XPath, or test results, reports? | It may vary based on team's preference but typically: Cloud, external data storage, Page Object models. Or some combination of tools available. Generally it's Excel or some sort of database. |
26. Can I ask you what are the most amount of tests you have? What type of tests do you think you have the most of? (Like functional, api, sanity etc) | Function are the most common. The ones I tend to be more involved with are Sanity and regression. |
27. What system are you using? Windows or Unix? | Windows |
28. What sort of things you are preparing for the release like what sort of tests you are running order wise? | As an automation eningeer you are running the Jenkins regression before the release |
29. In your project, what are the challenges you faced? | my current project had lot of bugs and application was not stable in the begginging. |
31. who made the automation framework . | I am part of the automation building and maintaining team |
32. Your agile team, do you create test plans? | no |
33. Do you run a a regression at the end of each Sprint? | we run regression test via Jenkins , every single night and also during release as well |
34. How do you identify the test cases that you believe should be added to the regression suite? | all testcases are part of regression suite |
35. Tell me about your SQL experience like how do you use it? | To me it's mostly a translation experience. What I mean is usually people want an excel document or want me to take SQL and make it a little more digestible. (Charts, percentages, demographics) |
39. Do you have access to the code developers code? | no |
40. Like what kind of documentation did you prepare ? | created the framework explanation document, automation process documentation with selenium, JIRA and Jenkins. Tools documentation and how each testing tool works. Training document for new commers. |
42. What sort of information you provide for developer to debug alongside with screenshot? | We provide step by step on how to recreate the bug |
43. What tool do use you for micro service level validations? API | Postman: It's a popular tool for API testing. It provides features for sending HTTP requests to REST endpoints and viewing responses. |
44. How do you parameterize a test plan in JMeter? | So since parameterization is the process of executing the same test scripts with multiple data sets. In Jmeter you can do this using a CSV Data set config or User Defined Variables. |
46. Since you are in a Agile team? Can you explain the process A to Z? | Project Initiation: The project is initiated with high-level scope and goals. In Agile, you don’t need a fully detailed long-term plan, but you need a general direction. Roles and Responsibilities: Define the team structure. Agile teams are usually cross-functional and include roles such as Product Owner, Scrum Master, and Team Members. Product Backlog Creation: The Product Owner creates a product backlog which is a prioritized list of features, bug fixes, and all changes to be made to the product. Sprint Planning: The team holds a sprint planning meeting to decide on the set of features from the product backlog that will be worked on during the next sprint (usually 2-4 weeks). Daily Stand-up: Each day of the sprint, a short stand-up meeting is held, usually 15 minutes, where team members discuss what they completed yesterday, what they will work on today, and identify any blockers. Development and Testing: The development team works on the tasks decided in the sprint planning. Agile promotes a testing approach that runs in parallel, so QA members should be involved early and continuously. Backlog Grooming/Refinement: During the sprint, the product backlog is also continuously updated and prioritized to ensure that the team is always working on the most valuable features. Sprint Review: At the end of the sprint, a review is held to demonstrate the functionality created during the sprint. It’s a time for feedback from stakeholders and for the team to see what they accomplished. Sprint Retrospective: After the sprint review, the team holds a retrospective to discuss what went well, what could be improved, and what will be done differently in the next sprint. Release Planning and Deployment: Depending on the project, a release might include the features from one or more sprints. The team needs to plan the release and coordinate the deployment. Feedback and Adaptation: After the release, the team collects feedback from end-users and any data that can be useful for improving the product. Next Sprint Planning: The process is iterative, so after one sprint ends, the next begins |
48. Have you used Excel sheets in the automation? | Yes, often. |
49. On the DB side, so are you writing SQL queries on daily basis or sometimes you are? | Sometimes are, generally with me they just want it to look more professional or presentable. |
50. When you are testing an application, how do you handle the process when the data is coming from different sources, such as login data and password data? | Data necessarily needs to be managed depending on the data sources. Login data might be stored in a database while passwords might be stored in configuration files. Generally the data is stored in a centralized data repository (such as excel sheets). The short answer is different data might go to the same place ultimately but needs to be organized appropriate to the company's wants. |
51. You run the test in the night. And you get the report in the morning. Then what do you do? | Review it, check for and log the defects. Update the Test execution status (ie what passeed and failed). You share the results and if necessary discuss results at meeting if a plan for additional testing is needed. |
Project 2
Questions Answers 1. What team management methodology did you use? Agile Scrum Methodology. Scrum is subset of Agile. 2. What is Agile methodology? Agile methodology is where we can deliver the product faster to our client more frequently and we get the feedback from the customer which helps us to improving the software quality. It promotes team collabaration and continuous delivery. Agile methodologies include Scrum, Kanban, Extreme Programming (XP). 4. Do you ever write test plans or involved writing test plans?
And,
Do you have experience in Automation testing? Yes. 7. Can you please explain your overall project structure? Yes, The project is called ERP (enterprise resource planning) for club management. In the project, we use BDD selenium. We use Java programming language with Page Object Model Concept. We use jenkins for continuous test and make report. We use github for store our code and repositories. 8. What TEST MANAGEMENT TOOL do you use in your project?
Or,
Which bug-tracking tool that you use? Jira 9. Can you explain the steps while you raise a bug? 1. Log in to JIRA and navigate to the project.
2. Click on the "Create" button in the top navigation bar to create a new issue.
3. In the "Issue Type" field, select "Bug".
4. Fill in the details of the bug.
5. Assign the bug to the appropriate team or individual.
6. Set the priority.
7. Add any relevant labels or tags to the bug to help categorize.
8. Click on the "Create" button to create the bug.
9. Once the bug is created, it will be added to the project's issue tracker. 10. In hook file, before or before-class which one will execute first? In a hook file, the @BeforeClass annotation will execute before the @Before annotation. Because @BeforeClass annotation is applied to a class, while the @Before annotation is applied to a method. 11. As default dry-run is always false, what happens if I put dry-run true, what message I will get? If you set the dryrun parameter to true, the program will not actually execute any actions but instead will simulate them and return a message indicating what actions would have been taken.
Here is an example of the message you may get when setting dryrun to true:
{
"dryrun": true,
"message": "The program would perform the following actions: [action 1, action 2, action 3]"
} 12. I have 10 feature files. But I want to run 3, how can I do that? I will put the tags like @sanity, @smoke, @regression and this will run those 3 features file except others.
cucumber --tags @smoke @sanity @regression 13. How can run only 2 test cases at the same time? (Also known as Parallelization) In Jenkins, in build with parameters section, if we put ThreadCount 2. This will run 2 test cases at sametime or parallaly. 14. What is Extent report and annual report? Extent Reports is an open-source reporting library useful for test automation. These reports are HTML documents that contains results. It shows logs, snapshots, and other customized details.
Annual reports are a type of report that is used to summarize the activities and performance of a company or organization for a given year. They are typically published once a year. 15. Test case 0, 2, 4. Which one will execute first? Test case 0 will execute first and one after like 2,4. 16. What is the framework you use for your automation project?
Or,
Can you explain what kind of framework you worked on? Data driven framework. and rest assued framework 18. Explain your sprint system both Development and TEST?
Or,
How about your experience on sprint? -Daily stand up , - Checking regression, Checking Pull requests. Doing Tasks that were assigned to you in the sprint planining 20. Are you mainly developing scripts in automation or executing test cases only? -I played a huge part developing the automation framework ,i also write new automation test cases. The executes in scheduled time 21. How do you extract more logs about the bugs that I put it on JIRA,, like how I can see where the test actually failed?? Would you do that generally? I create cucumber use Allure reporting that shows the logs about the bugs
Using Log4j, and also the report like Allure, cucumber report and extent report shows 22. What are the meetings happens on your Agile project? Sprint Planning (before sprint):
Tester decides how many hours (Effort Estimation) it should take to finish testing the test cases.
Tester contributes to the prioritizing process
Sprint:
Test execution is performed, bugs/issues/defects (it all means the same) are reported in Jira, Issues can be analyzed during the stand-up meeting. Defects are retested as soon as it is resolved (fixed) and deployed for testing
Deployed / Deployment = changes/new code (the fix) is ready to be tested. It is the responsibility of the deployment team to move the changes from DEV (Development) to QA.
Sprint Retrospective:
Tester will figure out what went wrong and what went right in the current sprint
Tester identifies lessons learned and best practices
Meetings during Sprint (“Ceremonies”):
Sprint planning meeting where the team answers two basic questions:
What work can get done in this sprint and how will it be done?
Attendees: Development, Product Manager (scrum master), Product owner (usually the Product Manager)
When: At the beginning of a sprint
Duration: Usually an hour
Purpose: Product owner will have a prioritized product backlog. They discuss each item with the development team, and the group collectively estimates the effort involved. The development team will then make a sprint forecast outlining how much work the team can complete from the product backlog.
That body of work then becomes the sprint backlog.
Daily Stand-up(in some companies it’s not daily for QA and in some they don’t have it at all)
Attendees: development team, scrum master, product owner
When: Once per day, typically in the morning.
Duration: Around 15 minutes.
Purpose: Quickly inform everyone of what's going on across the team. It's not a detailed status meeting. The tone should be light and fun, but informative.
Have each team member answer the following questions:
What will I work on today?
What did I complete yesterday? (just in case that others are telling it too)
Am I blocked by anything? (just if you are, in most cases you want to discuss issues after the meeting 1 on 1 with the relevant people to not waste time of others)
Sprint Review-->
Attendees: development team, scrum master, product owner
Optional: project stakeholders
When: At the end of a sprint
Duration: 30-60 minutes.
Purpose: A sprint review is about demonstrating the work of the entire team: designers, developers, and the product owner. Team members gather around a desk for informal demos and describe the work they’ve done for that iteration. It’s a time to ask questions, try new features, and give feedback (usually not by QA)
Team answer the following questions:
What We're Doing Awesome
What We Could Be Doing Better
What Outside the Team Needs to Change
Feedback of Team Members
Other meetings
QA team meetings
Meetings for all company employees (celebrations, COVID updates, happy hour…)
Trainings, lunch and learn, free to join meetings (“Women in tech” etc) 23. Are you doing Cross-browser testing? Yes. In selenium we define webdriver for that. 24. As you are working in an Agile environment, what ceremonies are you attending? Agile ceremonies are meetings where a development team comes together to keep each other updated on their project's details. At the same time, other Scrum ceremonies, such as the sprint retrospective, helps the scrum team look back on their work and find ways of improving for future sprints.
The agile ceremonies list includes:
1. Sprint Planning
2. Daily Stand-Up
3. Sprint Review
4. Sprint Retrospective 25. As you’re in scrum team, who are the members in your team? QA team (team lead), development team (team lead, software developer manager), product manager 26. What is your approach in defect life cycle? Defect Identification: The first step is to identify the defect by observing any deviation from the expected behavior or from the requirements. This can be done through testing or by customer feedback.
Defect Logging: Once a defect is identified, it needs to be logged into a tracking system or tool with as much information as possible about the defect, such as the steps to reproduce it, screenshots or logs, and the severity of the defect.
Defect Prioritization: After the defect is logged, it is prioritized based on its severity, impact on the system, and the urgency of the issue.
Defect Assigning: Once the defect is prioritized, it is assigned to the relevant team or individual for investigation and resolution.
Defect Fixing: The assigned team or individual works to reproduce the defect, identify the root cause, and develop a fix for the issue.
Defect Verification: After the fix is developed, it needs to be tested to ensure that it resolves the issue and does not create any new problems.
Defect Closing: Once the fix is verified, the defect is closed, and the resolution is documented in the tracking system or tool.
Defect Reporting: Regular reports are generated to keep the stakeholders informed about the status of defects, their severity, the progress in resolving them, and any emerging patterns or trends. 27. If you can’t deliver on-time, what is the communication process you follow? I may open communications with my team-lead first, then follow-up to the manager, I may apologize for the inconvenience and explain what are the reasons you didn't finish on time, then, I may propose a new date where I know I'll be able to deliver on time. 28. If you are put on extra work on your regular work, how do you prioritize first? I will make a list of all my tasks. And then start doing up by urgencies. 30. How you will participate in root/impact cause analysis and what is the next step? 1. Define the event
2. Find causes
3. Finding the root cause
4. Find solutions (this is next step after finding the root cause)
5. Take action
6. Verify solution effectiveness
https://evocon.com/articles/perform-root-cause-analysis/#:~:text=Define%20the%20event,Verify%20solution%20effectiveness 31. When do we stop testing? we never stop testing. we are running all the testcases every single day thru jenkins. we are executing and verifying failures every single day 32. How do you know when the product is ready to be released? When all the minimum requirements and functionalities are satisfied. 33. What is sign off? In QA, sign-off is declaring that testing is complete and that the software is ready to be released. 34. What do MannualQA Engineers do before release? Mannual tester- Make sure features that are going to be released for this sprint. Mannual testers tests those features and make sure they are working properly.. What do Automation Engineer does before release Automation engineer executes the regression suite thru jenkins to make sure all the test cases are working with the current features 35. What do QA Automation Engineers do after release? Autiomation engineers makes autiomation testcase for that feature that was released. 36. How many test cases did you execute on average per day? in our current company we execute 1500 test cases a day thru Jenkins regression execution. 38. In a sprint, how many test cases you can write? In a sprint i can script 4 end to end or functinal testcaes 39. What are the points should be considered while writing test cases? 1. Test cases should be based on the requirements.
2. Clear and concise
3. Maintainable and traceble. 40. What type of testing are you doing (like smoke, sanity, database, api, regression, re-testing, load, stress.. etc.) 1) regression, 2) End to End test executions.3) Smoke test 4) Sanity test 42. Why we put monochrome=true most of the time and what will happen if i put monochrome=false? Most of the time, monochrome is set to true to make it easier to read the test output.
If we set monochrome to false, the output of the test will be displayed in color and make the report harder to read. 44. Have you deal any defects which are rejected by development team?
Questions | Answers |
1. What team management methodology did you use? | Agile Scrum Methodology. Scrum is subset of Agile. |
2. What is Agile methodology? | Agile methodology is where we can deliver the product faster to our client more frequently and we get the feedback from the customer which helps us to improving the software quality. It promotes team collabaration and continuous delivery. Agile methodologies include Scrum, Kanban, Extreme Programming (XP). |
4. Do you ever write test plans or involved writing test plans? And, Do you have experience in Automation testing? | Yes. |
7. Can you please explain your overall project structure? | Yes, The project is called ERP (enterprise resource planning) for club management. In the project, we use BDD selenium. We use Java programming language with Page Object Model Concept. We use jenkins for continuous test and make report. We use github for store our code and repositories. |
8. What TEST MANAGEMENT TOOL do you use in your project? Or, Which bug-tracking tool that you use? | Jira |
9. Can you explain the steps while you raise a bug? | 1. Log in to JIRA and navigate to the project. 2. Click on the "Create" button in the top navigation bar to create a new issue. 3. In the "Issue Type" field, select "Bug". 4. Fill in the details of the bug. 5. Assign the bug to the appropriate team or individual. 6. Set the priority. 7. Add any relevant labels or tags to the bug to help categorize. 8. Click on the "Create" button to create the bug. 9. Once the bug is created, it will be added to the project's issue tracker. |
10. In hook file, before or before-class which one will execute first? | In a hook file, the @BeforeClass annotation will execute before the @Before annotation. Because @BeforeClass annotation is applied to a class, while the @Before annotation is applied to a method. |
11. As default dry-run is always false, what happens if I put dry-run true, what message I will get? | If you set the dryrun parameter to true, the program will not actually execute any actions but instead will simulate them and return a message indicating what actions would have been taken. Here is an example of the message you may get when setting dryrun to true: { "dryrun": true, "message": "The program would perform the following actions: [action 1, action 2, action 3]" } |
12. I have 10 feature files. But I want to run 3, how can I do that? | I will put the tags like @sanity, @smoke, @regression and this will run those 3 features file except others. cucumber --tags @smoke @sanity @regression |
13. How can run only 2 test cases at the same time? (Also known as Parallelization) | In Jenkins, in build with parameters section, if we put ThreadCount 2. This will run 2 test cases at sametime or parallaly. |
14. What is Extent report and annual report? | Extent Reports is an open-source reporting library useful for test automation. These reports are HTML documents that contains results. It shows logs, snapshots, and other customized details. Annual reports are a type of report that is used to summarize the activities and performance of a company or organization for a given year. They are typically published once a year. |
15. Test case 0, 2, 4. Which one will execute first? | Test case 0 will execute first and one after like 2,4. |
16. What is the framework you use for your automation project? Or, Can you explain what kind of framework you worked on? | Data driven framework. and rest assued framework |
18. Explain your sprint system both Development and TEST? Or, How about your experience on sprint? | -Daily stand up , - Checking regression, Checking Pull requests. Doing Tasks that were assigned to you in the sprint planining |
20. Are you mainly developing scripts in automation or executing test cases only? | -I played a huge part developing the automation framework ,i also write new automation test cases. The executes in scheduled time |
21. How do you extract more logs about the bugs that I put it on JIRA,, like how I can see where the test actually failed?? Would you do that generally? | I create cucumber use Allure reporting that shows the logs about the bugs Using Log4j, and also the report like Allure, cucumber report and extent report shows |
22. What are the meetings happens on your Agile project? | Sprint Planning (before sprint): Tester decides how many hours (Effort Estimation) it should take to finish testing the test cases. Tester contributes to the prioritizing process Sprint: Test execution is performed, bugs/issues/defects (it all means the same) are reported in Jira, Issues can be analyzed during the stand-up meeting. Defects are retested as soon as it is resolved (fixed) and deployed for testing Deployed / Deployment = changes/new code (the fix) is ready to be tested. It is the responsibility of the deployment team to move the changes from DEV (Development) to QA. Sprint Retrospective: Tester will figure out what went wrong and what went right in the current sprint Tester identifies lessons learned and best practices Meetings during Sprint (“Ceremonies”): Sprint planning meeting where the team answers two basic questions: What work can get done in this sprint and how will it be done? Attendees: Development, Product Manager (scrum master), Product owner (usually the Product Manager) When: At the beginning of a sprint Duration: Usually an hour Purpose: Product owner will have a prioritized product backlog. They discuss each item with the development team, and the group collectively estimates the effort involved. The development team will then make a sprint forecast outlining how much work the team can complete from the product backlog. That body of work then becomes the sprint backlog. Daily Stand-up(in some companies it’s not daily for QA and in some they don’t have it at all) Attendees: development team, scrum master, product owner When: Once per day, typically in the morning. Duration: Around 15 minutes. Purpose: Quickly inform everyone of what's going on across the team. It's not a detailed status meeting. The tone should be light and fun, but informative. Have each team member answer the following questions: What will I work on today? What did I complete yesterday? (just in case that others are telling it too) Am I blocked by anything? (just if you are, in most cases you want to discuss issues after the meeting 1 on 1 with the relevant people to not waste time of others) Sprint Review--> Attendees: development team, scrum master, product owner Optional: project stakeholders When: At the end of a sprint Duration: 30-60 minutes. Purpose: A sprint review is about demonstrating the work of the entire team: designers, developers, and the product owner. Team members gather around a desk for informal demos and describe the work they’ve done for that iteration. It’s a time to ask questions, try new features, and give feedback (usually not by QA) Team answer the following questions: What We're Doing Awesome What We Could Be Doing Better What Outside the Team Needs to Change Feedback of Team Members Other meetings QA team meetings Meetings for all company employees (celebrations, COVID updates, happy hour…) Trainings, lunch and learn, free to join meetings (“Women in tech” etc) |
23. Are you doing Cross-browser testing? | Yes. In selenium we define webdriver for that. |
24. As you are working in an Agile environment, what ceremonies are you attending? | Agile ceremonies are meetings where a development team comes together to keep each other updated on their project's details. At the same time, other Scrum ceremonies, such as the sprint retrospective, helps the scrum team look back on their work and find ways of improving for future sprints. The agile ceremonies list includes: 1. Sprint Planning 2. Daily Stand-Up 3. Sprint Review 4. Sprint Retrospective |
25. As you’re in scrum team, who are the members in your team? | QA team (team lead), development team (team lead, software developer manager), product manager |
26. What is your approach in defect life cycle? | Defect Identification: The first step is to identify the defect by observing any deviation from the expected behavior or from the requirements. This can be done through testing or by customer feedback. Defect Logging: Once a defect is identified, it needs to be logged into a tracking system or tool with as much information as possible about the defect, such as the steps to reproduce it, screenshots or logs, and the severity of the defect. Defect Prioritization: After the defect is logged, it is prioritized based on its severity, impact on the system, and the urgency of the issue. Defect Assigning: Once the defect is prioritized, it is assigned to the relevant team or individual for investigation and resolution. Defect Fixing: The assigned team or individual works to reproduce the defect, identify the root cause, and develop a fix for the issue. Defect Verification: After the fix is developed, it needs to be tested to ensure that it resolves the issue and does not create any new problems. Defect Closing: Once the fix is verified, the defect is closed, and the resolution is documented in the tracking system or tool. Defect Reporting: Regular reports are generated to keep the stakeholders informed about the status of defects, their severity, the progress in resolving them, and any emerging patterns or trends. |
27. If you can’t deliver on-time, what is the communication process you follow? | I may open communications with my team-lead first, then follow-up to the manager, I may apologize for the inconvenience and explain what are the reasons you didn't finish on time, then, I may propose a new date where I know I'll be able to deliver on time. |
28. If you are put on extra work on your regular work, how do you prioritize first? | I will make a list of all my tasks. And then start doing up by urgencies. |
30. How you will participate in root/impact cause analysis and what is the next step? | 1. Define the event 2. Find causes 3. Finding the root cause 4. Find solutions (this is next step after finding the root cause) 5. Take action 6. Verify solution effectiveness https://evocon.com/articles/perform-root-cause-analysis/#:~:text=Define%20the%20event,Verify%20solution%20effectiveness |
31. When do we stop testing? | we never stop testing. we are running all the testcases every single day thru jenkins. we are executing and verifying failures every single day |
32. How do you know when the product is ready to be released? | When all the minimum requirements and functionalities are satisfied. |
33. What is sign off? | In QA, sign-off is declaring that testing is complete and that the software is ready to be released. |
34. What do MannualQA Engineers do before release? | Mannual tester- Make sure features that are going to be released for this sprint. Mannual testers tests those features and make sure they are working properly.. |
What do Automation Engineer does before release | Automation engineer executes the regression suite thru jenkins to make sure all the test cases are working with the current features |
35. What do QA Automation Engineers do after release? | Autiomation engineers makes autiomation testcase for that feature that was released. |
36. How many test cases did you execute on average per day? | in our current company we execute 1500 test cases a day thru Jenkins regression execution. |
38. In a sprint, how many test cases you can write? | In a sprint i can script 4 end to end or functinal testcaes |
39. What are the points should be considered while writing test cases? | 1. Test cases should be based on the requirements. 2. Clear and concise 3. Maintainable and traceble. |
40. What type of testing are you doing (like smoke, sanity, database, api, regression, re-testing, load, stress.. etc.) | 1) regression, 2) End to End test executions.3) Smoke test 4) Sanity test |
42. Why we put monochrome=true most of the time and what will happen if i put monochrome=false? | Most of the time, monochrome is set to true to make it easier to read the test output. If we set monochrome to false, the output of the test will be displayed in color and make the report harder to read. |
44. Have you deal any defects which are rejected by development team? |
Project 3
Questions Answers 1. Why do you think manual testing is important? Manual testing is an essential part of the software development life cycle (SDLC) and plays a crucial role in ensuring that the end product meets customer requirements. Human insight: Manual testers can provide valuable insights as they have human intuition, experience, and creativity to identify issues that automated tests may miss. 2. Where do you track your test cases? jira 3. If you found a defect, how do you raise a defect and how do you report? 4. If you found a defect and developer said "This defect is not in my system." Then what you do? 1. Will Check if it's an environment issue
2. Share evidence of the defect: If I have clear evidence of the defect
3. Collaborate with team members 6. You found a defect and developer said “its not a defect”. How do you deal with this situation? a. Provide evidence of the defect: Share test results/evidence like screenshots or videos which clearly demonstrate problem exists in codebase/application;
b. Explain impact on user experience and business value proposition if left unresolved
c. Collaborate with team members
Most important things is we not gonna fight each-other instead we will accomplish the things together 7. If you are in gas station to purchase a fuel, provide some scenarios to deal with gas pump? 8. With a loyalty card, provide some scenarios to deal with gas pump? 9. You done your testing and you found no problem. But in the production, they found a defect. What is opinion that what thing gone wrong? Most probably there were no testcase for that feature . So the best apporach will be to make that testcase 10. As a team-member, I am asking you to send me a detail-report by using email. How do you configure that? So what i am gonna do, I will check first what test cases are failed, I will mark it. Then I will investigate why those failed. There are a lot of reasons it may fail like environment/server slow, or element change. Then what I am doing with those failing test cases? I will make a detail report and then I will share it. 11. In your framework, how do you read the test data in your script? There are three types of things we can read. Sometimes we directly hard-coded the data, sometimes we take data from Excel; sometimes we take from CSV file. 12. Do you have experience with JS framework? What is JS Framwork? No. But I know its a JavaScript framework. Never had to chance to learn more. 14. Have you done testing in not including cucumber, just straight the Java selenium without the cucumber. The one I am working on is BDD cucumber. However, I know how to do the automation just with the java selenium without the cucumber. Its like same like Page object feature, but in cucumber we do some extra step like attaching test case in given, when, then format. 18. What is white box testing? Who do the white box testing? White box testing is a type of software testing in which the tester has knowledge of the internal workings, structure, and implementation details of an application.
QA engineers do the white box testing. 17. How you analyse that test cases can be automated or not. 1. repetitive and time-consuming tests are good candidates for automation.
2. If test case has frequent changes in UI or functionality then its less ideal for Automation.
3. If an application requires testing multiple data sets (positive / negative) - Automating these scenarios would save significant manual effort/time
4. If the test case has very Complexity then it is good for automation. 18. What are things we can’t automate? Nowadays you can automate anything or everything. However, there are some things we can automate is like a captcha or “Are you a human or robot checking”. So, for the qa environment developer turn off those features so we can perform testing. 19. If you join somewhere and then the team asks you to create a framework, what will be your approach? First I need to start my project. Like I can create a Maven project in that we need to define what tools we need to use. I need to create a framework in a cucumber manner with Java language. So I create a Maven project in that I need to add some dependencies in the pom.xml dependencies like whatever we needed in the cucumber project and supporting tools. Suppose I'm using the TestNG with the cucumber. So I need to add the dependency of the TestNG. So after adding all those things, I need to define like, I need to write my framework. I am using the cucumber framework. So in that three major components are using the first components is a feature file. So in the feature file, because I am using a behavior driven development methodology. So basically, the behavior driven means it is understandable by a non-technical and technical person, and it is written in a plain English language, which is a Gherkin language and some predefined keywords are there like a feature scenario given when then all those features are there. So I need to create my framework from the feature file. So my first component is a feature file and my requirement is a login page. So I can define my feature as a login. I can define my scenario as a user should land on the login page. And then I need to define some test steps over there in the scenario steps like given user is already on the login page and then user enter user name password. And then I need to go to validate the dashboard page or homepage, whatever it is. So that is my feature file. So I need to connect my feature file to the step definition file. So that is my second component is a step definition file. So in the step definition file, I need to write my Java code and I need to glued all those whatever test cases I'm writing in the feature file. I need to glued those all those test cases in the step definition with the annotations given when then. And after that, I have a third component, which is a runner class and which is a bridge between the feature file and the step definition. So runner class is like I need to define some annotations in the runner class like run with Cucumber.class at the root Cucumber options in that I need to define some parameters over there. So parameters like feature. So in that I need to give the path of the feature file and in the second some parameters like glue, monogram, dry run, plugins over there. So after that my like I created some of the features, some of the components over there and I am following the design pattern as a page object model. So for that whatever the web page I need to test, I need to create a page class of that particular web page. In that page class, I need to define all the web elements location. Location means I can define suppose user name I am fetching through the ID or password I am fetching through the ID and if login I need to define the buttons and corresponding I need to create those elements and corresponding methods in the page class. And then I need to connect the page class to the step definition through the object. And so this is all my setup in the program framework and after that we can work on that. Thank you. I am just continuing the same on what my manager asked. 20. Do you have you ever heard about defect rejection ratio or defect leakage ratio? Rejection ratio versus defect leakage ratio. Defect leakage ratio – this refers to the number of defects that have been undetected during the project (SDLC) and ended up in production. These could be due to number of issues such as poor environment, functional testing coverage, missing or incorrect requirements.
The ratio can be determined with the following formula:
PD / (TD – RD) * 100
PD = Total number of defects found in production
TD = Total number of defects found during testing
RD = Total number of rejected/invalid/cancelled defects
Defect rejection ratio - Defect rejection ratio refers to the number of defects that were raised that have been rejected divided by the total number of defects raised. There are 3 main categories/types of rejected bugs: irreproducible, incorrect and duplicate bugs.
Ratio is formulated as follows:
(Defects Rejected as invalid by Development team / Total number of defects logged) * 10 22. You completed your commitments in time, but one of your fellow customers was not able and getting down to crunch time. And your fellow peer is not able to complete in a timely manner because maybe there was issues with the code. A lot of defects. What do you do in that situation? I will help my teammate, also I will raise a concern to the QA Manager that we might need more time or effort/resources/people to finish this testing on time - if I see that the tasks are complicated or time-consuming. 23. There is a common method. In future you don't have that common method like the new functionality added in the common method. So how are you going to tackle this and how you will try to? We have to write new test cases; add new test cases and obviously write the automation script according to the situation. 25. How do you manage your day? So every day we do have a meeting, a daily meeting, we, we call it a daily stand up meeting in the morning.
So basically we discuss what we did yesterday, what we are doing today. You know, if there are any.
Any questions that we have any impediments that we would like to, we would like the scrum master to help us resolve.So all that we discussed in the morning then then I go back to my desk and then I, you know, kind of work because we have automated. That we are automating some requirements and we are doing manual testing to some requirements.
So then I refresh the code on the Git to make sure that if there is no more code that I need to pull that is the first thing that I do also.
Then after that I I check my emails to see that you know.
After the stand up meeting, if there is Any any updates?
Of course we are sent the minutes of the meeting and stuff so we I just want to, you know, first update myself on that.
Then I start working on what my project, what my tasks are for the day.
So you know if I have a certain user, certain number of user stories that I'm working on.
You know that are needed to be tested.
Then I work on that on them during the day because we have.
In my current job, we have two week of Sprint, so I mean every company is different.
But in our company we have a two week Sprint.
We are following the scrum framework right now.
So I basically work on my Part of the user stories.
Whatever I'm working on and then, you know, we have back and forth communication with the developers and stuff. So yeah, that's how my day goes and the and at the end of the day we are.
I mean, I do like every alternate day I have regression test kind of scheduled that I do, you know testing to make sure that you know whatever new codes have been pulled from Git, it's not damaging the old code. 27. You just join the team. So, what’s your methodology to get the business knowledge? I started from learning about the product and its documentation, reading the requirements, test plans and test cases , what aries to test , and how the product will work. I will arrange meetings and ask about their experience, do they work close with qa, what do they think should be improved and to listen about project, architecture and if something unclear I will ask my team-lead/manager for more clarification. 36.one test case in continuously failing even you do the right code. What will you do? 37. Let's say I have a method, and inside the method I have, like, assertion 1, assertion 2, and assertion 3. It gets to assertion 1, and it fails. How would I write my test script so instead of going, instead of, like, automatically saying, stop execution of the test script, it would go instead to assertion 2 and assertion 3. 38. What you do in test plan? So some components of a test plan include, obviously, the description of the test, what we're testing of the software. It includes our test scenarios, our test data, includes our resources environment and where the test is testing will take care of. It'll include our acceptance criteria. Our, um, it'll also includes time towards the test cases. And also, uh, it'll include our Test case. A passable scenarios. 41. Let's take the same example. Deliverables need to finish on time. And there is some lag from your team due to various reasons. How do you accept this challenge and how exactly you proceed as a lead? Yeah, so that is a pretty big challenge to face. Obviously we want to meet the stakeholders expectations with our testing and development. The best thing I can think of is possibly making sure that all of our main functional test cases are complete, making sure that our test coverage is sufficient enough to cover our program, which allows us to ensure all the test coverage is done for all the important functionalities, and then move to the next sprint with our test cases that may have not been completed.
Questions | Answers |
1. Why do you think manual testing is important? | Manual testing is an essential part of the software development life cycle (SDLC) and plays a crucial role in ensuring that the end product meets customer requirements. Human insight: Manual testers can provide valuable insights as they have human intuition, experience, and creativity to identify issues that automated tests may miss. |
2. Where do you track your test cases? | jira |
3. If you found a defect, how do you raise a defect and how do you report? | |
4. If you found a defect and developer said "This defect is not in my system." Then what you do? | 1. Will Check if it's an environment issue 2. Share evidence of the defect: If I have clear evidence of the defect 3. Collaborate with team members |
6. You found a defect and developer said “its not a defect”. How do you deal with this situation? | a. Provide evidence of the defect: Share test results/evidence like screenshots or videos which clearly demonstrate problem exists in codebase/application; b. Explain impact on user experience and business value proposition if left unresolved c. Collaborate with team members Most important things is we not gonna fight each-other instead we will accomplish the things together |
7. If you are in gas station to purchase a fuel, provide some scenarios to deal with gas pump? | |
8. With a loyalty card, provide some scenarios to deal with gas pump? | |
9. You done your testing and you found no problem. But in the production, they found a defect. What is opinion that what thing gone wrong? | Most probably there were no testcase for that feature . So the best apporach will be to make that testcase |
10. As a team-member, I am asking you to send me a detail-report by using email. How do you configure that? | So what i am gonna do, I will check first what test cases are failed, I will mark it. Then I will investigate why those failed. There are a lot of reasons it may fail like environment/server slow, or element change. Then what I am doing with those failing test cases? I will make a detail report and then I will share it. |
11. In your framework, how do you read the test data in your script? | There are three types of things we can read. Sometimes we directly hard-coded the data, sometimes we take data from Excel; sometimes we take from CSV file. |
12. Do you have experience with JS framework? What is JS Framwork? | No. But I know its a JavaScript framework. Never had to chance to learn more. |
14. Have you done testing in not including cucumber, just straight the Java selenium without the cucumber. | The one I am working on is BDD cucumber. However, I know how to do the automation just with the java selenium without the cucumber. Its like same like Page object feature, but in cucumber we do some extra step like attaching test case in given, when, then format. |
18. What is white box testing? Who do the white box testing? | White box testing is a type of software testing in which the tester has knowledge of the internal workings, structure, and implementation details of an application. QA engineers do the white box testing. |
17. How you analyse that test cases can be automated or not. | 1. repetitive and time-consuming tests are good candidates for automation. 2. If test case has frequent changes in UI or functionality then its less ideal for Automation. 3. If an application requires testing multiple data sets (positive / negative) - Automating these scenarios would save significant manual effort/time 4. If the test case has very Complexity then it is good for automation. |
18. What are things we can’t automate? | Nowadays you can automate anything or everything. However, there are some things we can automate is like a captcha or “Are you a human or robot checking”. So, for the qa environment developer turn off those features so we can perform testing. |
19. If you join somewhere and then the team asks you to create a framework, what will be your approach? | First I need to start my project. Like I can create a Maven project in that we need to define what tools we need to use. I need to create a framework in a cucumber manner with Java language. So I create a Maven project in that I need to add some dependencies in the pom.xml dependencies like whatever we needed in the cucumber project and supporting tools. Suppose I'm using the TestNG with the cucumber. So I need to add the dependency of the TestNG. So after adding all those things, I need to define like, I need to write my framework. I am using the cucumber framework. So in that three major components are using the first components is a feature file. So in the feature file, because I am using a behavior driven development methodology. So basically, the behavior driven means it is understandable by a non-technical and technical person, and it is written in a plain English language, which is a Gherkin language and some predefined keywords are there like a feature scenario given when then all those features are there. So I need to create my framework from the feature file. So my first component is a feature file and my requirement is a login page. So I can define my feature as a login. I can define my scenario as a user should land on the login page. And then I need to define some test steps over there in the scenario steps like given user is already on the login page and then user enter user name password. And then I need to go to validate the dashboard page or homepage, whatever it is. So that is my feature file. So I need to connect my feature file to the step definition file. So that is my second component is a step definition file. So in the step definition file, I need to write my Java code and I need to glued all those whatever test cases I'm writing in the feature file. I need to glued those all those test cases in the step definition with the annotations given when then. And after that, I have a third component, which is a runner class and which is a bridge between the feature file and the step definition. So runner class is like I need to define some annotations in the runner class like run with Cucumber.class at the root Cucumber options in that I need to define some parameters over there. So parameters like feature. So in that I need to give the path of the feature file and in the second some parameters like glue, monogram, dry run, plugins over there. So after that my like I created some of the features, some of the components over there and I am following the design pattern as a page object model. So for that whatever the web page I need to test, I need to create a page class of that particular web page. In that page class, I need to define all the web elements location. Location means I can define suppose user name I am fetching through the ID or password I am fetching through the ID and if login I need to define the buttons and corresponding I need to create those elements and corresponding methods in the page class. And then I need to connect the page class to the step definition through the object. And so this is all my setup in the program framework and after that we can work on that. Thank you. I am just continuing the same on what my manager asked. |
20. Do you have you ever heard about defect rejection ratio or defect leakage ratio? Rejection ratio versus defect leakage ratio. | Defect leakage ratio – this refers to the number of defects that have been undetected during the project (SDLC) and ended up in production. These could be due to number of issues such as poor environment, functional testing coverage, missing or incorrect requirements. The ratio can be determined with the following formula: PD / (TD – RD) * 100 PD = Total number of defects found in production TD = Total number of defects found during testing RD = Total number of rejected/invalid/cancelled defects Defect rejection ratio - Defect rejection ratio refers to the number of defects that were raised that have been rejected divided by the total number of defects raised. There are 3 main categories/types of rejected bugs: irreproducible, incorrect and duplicate bugs. Ratio is formulated as follows: (Defects Rejected as invalid by Development team / Total number of defects logged) * 10 |
22. You completed your commitments in time, but one of your fellow customers was not able and getting down to crunch time. And your fellow peer is not able to complete in a timely manner because maybe there was issues with the code. A lot of defects. What do you do in that situation? | I will help my teammate, also I will raise a concern to the QA Manager that we might need more time or effort/resources/people to finish this testing on time - if I see that the tasks are complicated or time-consuming. |
23. There is a common method. In future you don't have that common method like the new functionality added in the common method. So how are you going to tackle this and how you will try to? | We have to write new test cases; add new test cases and obviously write the automation script according to the situation. |
25. How do you manage your day? | So every day we do have a meeting, a daily meeting, we, we call it a daily stand up meeting in the morning. So basically we discuss what we did yesterday, what we are doing today. You know, if there are any. Any questions that we have any impediments that we would like to, we would like the scrum master to help us resolve.So all that we discussed in the morning then then I go back to my desk and then I, you know, kind of work because we have automated. That we are automating some requirements and we are doing manual testing to some requirements. So then I refresh the code on the Git to make sure that if there is no more code that I need to pull that is the first thing that I do also. Then after that I I check my emails to see that you know. After the stand up meeting, if there is Any any updates? Of course we are sent the minutes of the meeting and stuff so we I just want to, you know, first update myself on that. Then I start working on what my project, what my tasks are for the day. So you know if I have a certain user, certain number of user stories that I'm working on. You know that are needed to be tested. Then I work on that on them during the day because we have. In my current job, we have two week of Sprint, so I mean every company is different. But in our company we have a two week Sprint. We are following the scrum framework right now. So I basically work on my Part of the user stories. Whatever I'm working on and then, you know, we have back and forth communication with the developers and stuff. So yeah, that's how my day goes and the and at the end of the day we are. I mean, I do like every alternate day I have regression test kind of scheduled that I do, you know testing to make sure that you know whatever new codes have been pulled from Git, it's not damaging the old code. |
27. You just join the team. So, what’s your methodology to get the business knowledge? | I started from learning about the product and its documentation, reading the requirements, test plans and test cases , what aries to test , and how the product will work. I will arrange meetings and ask about their experience, do they work close with qa, what do they think should be improved and to listen about project, architecture and if something unclear I will ask my team-lead/manager for more clarification. |
36.one test case in continuously failing even you do the right code. What will you do? | |
37. Let's say I have a method, and inside the method I have, like, assertion 1, assertion 2, and assertion 3. It gets to assertion 1, and it fails. How would I write my test script so instead of going, instead of, like, automatically saying, stop execution of the test script, it would go instead to assertion 2 and assertion 3. | |
38. What you do in test plan? | So some components of a test plan include, obviously, the description of the test, what we're testing of the software. It includes our test scenarios, our test data, includes our resources environment and where the test is testing will take care of. It'll include our acceptance criteria. Our, um, it'll also includes time towards the test cases. And also, uh, it'll include our Test case. A passable scenarios. |
41. Let's take the same example. Deliverables need to finish on time. And there is some lag from your team due to various reasons. How do you accept this challenge and how exactly you proceed as a lead? | Yeah, so that is a pretty big challenge to face. Obviously we want to meet the stakeholders expectations with our testing and development. The best thing I can think of is possibly making sure that all of our main functional test cases are complete, making sure that our test coverage is sufficient enough to cover our program, which allows us to ensure all the test coverage is done for all the important functionalities, and then move to the next sprint with our test cases that may have not been completed. |
3. Selenium BDD
m Answers 1. What is Selenium? Selenium is a popular open-source automation testing tool widely used for web-application testing. It allows developers to write automated tests in various programming languages like Java, Python, Ruby etc., and execute them against different browsers like Chrome, Firefox, Safari etc. 2. Explain Selenium wait? Implicit wait: We put in the code once and it’ll be applied for all the functions
Explicit wait: We put into the function where we need to wait conditional wait
Non-Selenium wait:
Sleep: default function of programming language, not recommended to use in automation 3. Explain BDD framework.
Why do we use BDD framework / Benefits of using BDD framework? BDD stands for Behavior-Driven Development. In BDD, test cases are written in the form of scenarios, which describe the behavior of the application in a specific context.
We use it because:
1. Increased visibility of the testing process for all team members
2. Improved test coverage and test quality
3. Faster feedback on code changes
4. Reduced development and testing time
5. Higher customer satisfaction due to better alignment of software with business goals 3. What is TDD? TDD stands for Test-Driven Development, which is a software development methodology that involves writing automated tests before writing the actual code. However, I am not using that in my prject. 4. What is a headless browser? A headless browser is a web browser without a graphical user interface. 5. Have you ever used headless browsers? Yes. in jenkins we did headless browser execution 6. Explain Synchronization in Selenium. Two type of waits helps us to synchronize
1. Implicit wait: We put in the code once and it’ll be applied for all the functions
2. Explicit wait: We put into the function where we need to wait 7. Difference between Submit and Click in selenium. "submit" method is used to submit a form to the server.
"click" method is used to click a button or a link. 9. Ways to find broken links in selenium (except using HTTPURL connection). https://www.youtube.com/watch?v=ZRlQvGIhvho 10. Test scenarios for Amazon search results page Here are some test scenarios for the Amazon search results page:
1. Verify that the search results page is displayed when a user enters a valid search term in the search bar and clicks on the search button.
2. Verify that the search results page displays the correct number of search results for the entered search term.
3. Verify that the search results page is responsive and works correctly on different screen sizes and resolutions. Pls check this git hub link for automation example:https://github.com/celikgumusdag/selenium-automation-amazon/blob/master/src/test/java/Search.java 11. Test scenarios for Screen sharing in an app. Here are some test scenarios for screen sharing in an app:
1. Verify that the app allows the user to initiate a screen sharing session with another user.
2. Verify that the app provides clear instructions for the user to start and end a screen sharing session.
3. Verify that the app allows the user to pause or stop screen sharing at any time during the session. 12. What is Absolute and Relative xpath? Absolute XPath: this one is the complex Path of the element starting from the root. It is the direct way to find the element, but the disadvantage of the absolute XPath is that if there are any changes made in the path of the element then that XPath gets failed.
Relative XPath – in this case, the path starts from the middle of the HTML DOM structure. It starts with the double forward-slash (//), which means it can search the element anywhere on the webpage. 13. Difference between "findelement" and "findelements". find_element
● will find the first matching element.
● will throw NoSuchElementException if the element is not found.
find_elements
● will find all the matching elements.
● will return an empty list if the elements are not found. 14. Difference between get and navigate method in Selenium? GET will wait till the whole page gets loaded.
NAVIGATE will just redirect to our required page and will not wait. It will guide us through the history like refresh, back, forward. For example if we want to move forward and do some functionality, we need use naviagte. 15. Difference between quit and close methods in Webdiver? close( ) WebDriver closes the Browser window which is in focus.
quit( ) WebDriver closes all the Browser windows. 16. What is Webdriver and Webdriver protocol? WebDriver is an open-source framework for automating web browsers. It provides a programming interface to interact with web browsers such as Chrome, Firefox, Safari, and Edge.
WebDriver protocol is a standardized way of communicating with web browsers using WebDriver. The WebDriver protocol defines a set of RESTful APIs that allow you to control web browsers programmatically. 17. How selenium connects to the Java language and the browser? 1. Download & Install JDK.
2. Configure IDE.
3. Add Selenium WebDriver library (Maven)
4. Create Test Script.
5. Run Test Script (TestNG) 18. If you have to execute JavaScript like button, how do you approach it? Create an instance of the JavascriptExecutor. Then Use the executeScript().
Example:
try{
// Step 1: Casting webdriver instance to javaScript executor
JavascriptExecutor js=(JavascriptExecutor)driver;
// Step 2 : Executing script (clicking button)
WebElement btnElement=driver.findElement(By.id("myButtonId"));
js.executeScript("arguments[0].click();",btnElement);
} catch(Exception e){
System.out.println(e.getMessage());
} 19. How would you handle the iframe? 1. Identify the iframe.
2. Switch to the iframe: Use driver.switchTo().frame()
3. Perform required operations on elements inside that frame: Locate element with findElement() and sendKeys()
4. Switch back to default content: driver.switchTo().defaultContent() 20. You come across a web page and it's very dynamic how do you handle waiting for page to be ready or certain elements to be appear on the page. I have to use Explicit wait . watforpage to load with element to be visible or clickable 21. What are the limitations of selenium webdriver? 1. Limited support for desktop applications: Selenium WebDriver is primarily used to test web-based applications and does not have native support for desktop applications.
2. Handling CAPTCHA.
3. Difficulty with handling dynamic elements: f the website under test contains dynamic elements that change frequently such as pop-ups or overlays, it can be challenging for Selenium WebDriver to identify and interact with them correctly.
4. Limited mobile device support. 22. What are the ways you find the element in the selenium? ID, Name, Class Name, Tag Name, Link Text and Partial Link Text, CSS Selector, Xpath 23. You have a dropdown list on the webpage. let's say you need to add dropdown values like option with checkboxes. Select all options which is unselected. What will your step and logic here? // Locate the dropdown element on the webpage
WebElement dropdown = driver.findElement(By.id("myDropdown"));
// Get all option elements within the dropdown
List<WebElement> options = dropdown.findElements(By.xpath(".//input[@type='checkbox']"));
// Iterate through each option and select it if it's not already selected
for (WebElement option : options) {
if (!option.isSelected()) {
// Scroll into view (if needed) and click on checkbox to mark it as selected
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", option);
option.click();
}
}
Explanation of code snippet:
We first locate the select element containing our desired options by their ID.
We then use .findElements() method to get all input fields inside this select.
Next, we iterate over these input fields one-by-one using a for loop.
If an input field is found to be unselected (using its isSelected() method), we scroll that field into view so that it's clickable and then click on its checkbox or label using .click().
The final result should be that all previously-unselected inputs are now checked.
<select id="myDropdown">
<option><input type="checkbox" value="option1"> Option 1</option>
<option><input type="checkbox" value="option2"> Option 2</option>
<option><input type="checkbox" value="option3"> Option 3</option>
</select> 24. What is cucumber? What are advantages and disadvantage? Cucumber is a testing framework that allows developers to write tests in natural language using Gherkin syntax.
Advantages of Cucumber:
Reusability, Easy Readability
Disadvantages of Cucumber:
It requires user involvement to describe scenarios right
Requires maintenance of both steps and scenarios 25. What is the difference between soft and hard assertion? Hard assertion:With hard assertion, any error that occurs in a test case will cause the entire script to stop executing.
Soft assertion: with soft assertion, even if an assertion fails within a test case, the remaining part of script continues to execute without getting halted until all checks have been completed allowing us track down multiple problems at once before failing out altogether.
26. Where do we go for implicit? Where do we go for extra time? We generally use implicit wait when we know that some elements may take longer to load or become visible on the page and we want our test script to wait until they appear before proceeding with further actions. This can help us avoid NoSuchElementException errors that might occur due to race conditions between webdriver and actual webpage rendering. 28. So which one the framework recommends? Implicit or explicit? The recommendation for using Implicit or Explicit waits in Java Selenium framework depends on the specific scenario and use case.
29. In Selenium, how do you check for broken links? There are 100 links on a web page and how do you check for broken links on that page? In Java Selenium, we can find broken links on a webpage by iterating through all the links present on that page and checking their response status code. If the status code is not 200 (OK), it means that link is broken..
Example:
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import java.util.List;
public class FindBrokenLinks {
public static void main(String[] args) {
WebDriver driver = new ChromeDriver();
driver.get("https://www.example.com");
List<WebElement> links = driver.findElements(By.tagName("a"));
for (WebElement link : links) {
String href = link.getAttribute("href");
verifyLinkActive(href);
}
// Close Browser
driver.quit();
}
public static void verifyLinkActive(String url){
try {
URL obj = new URL(url);
HttpURLConnection conn = (HttpURLConnection)obj.openConnection();
conn.setConnectTimeout(3000); // Timeout set as 3 seconds
// Request Method Head , No need to download entire resource.
conn.setRequestMethod("HEAD");
int statusCode=conn.getResponseCode();
if(statusCode>=400){
System.out.println(url+" - Broken Link with Status Code "+statusCode);
} else{
System.out.println(url+" - Working Fine with Status Code "+statusCode);
}
} catch (Exception e) {
e.printStackTrace();
}
}
} 30. What is scenario outline in cucumber? Feature: Test Login feature with multiple credentials
@AB1
Scenario Outline:TestCase:"<TCID>"Test Newtour website with Multiple credentials
Given Open the browser and open application
When user enter "<username>" and "<password>"
Then user should be successfully login into Application
Examples:
| TCID | username | password |
| TC1 | mercury | mercury |
| TC2 | mercury | mercury |
| TC3 | mercury | mercury |
| TC4 | mercury | mercury |
m | Answers |
1. What is Selenium? | Selenium is a popular open-source automation testing tool widely used for web-application testing. It allows developers to write automated tests in various programming languages like Java, Python, Ruby etc., and execute them against different browsers like Chrome, Firefox, Safari etc. |
2. Explain Selenium wait? | Implicit wait: We put in the code once and it’ll be applied for all the functions Explicit wait: We put into the function where we need to wait conditional wait Non-Selenium wait: Sleep: default function of programming language, not recommended to use in automation |
3. Explain BDD framework. Why do we use BDD framework / Benefits of using BDD framework? | BDD stands for Behavior-Driven Development. In BDD, test cases are written in the form of scenarios, which describe the behavior of the application in a specific context. We use it because: 1. Increased visibility of the testing process for all team members 2. Improved test coverage and test quality 3. Faster feedback on code changes 4. Reduced development and testing time 5. Higher customer satisfaction due to better alignment of software with business goals |
3. What is TDD? | TDD stands for Test-Driven Development, which is a software development methodology that involves writing automated tests before writing the actual code. However, I am not using that in my prject. |
4. What is a headless browser? | A headless browser is a web browser without a graphical user interface. |
5. Have you ever used headless browsers? | Yes. in jenkins we did headless browser execution |
6. Explain Synchronization in Selenium. | Two type of waits helps us to synchronize 1. Implicit wait: We put in the code once and it’ll be applied for all the functions 2. Explicit wait: We put into the function where we need to wait |
7. Difference between Submit and Click in selenium. | "submit" method is used to submit a form to the server. "click" method is used to click a button or a link. |
9. Ways to find broken links in selenium (except using HTTPURL connection). | https://www.youtube.com/watch?v=ZRlQvGIhvho |
10. Test scenarios for Amazon search results page | Here are some test scenarios for the Amazon search results page: 1. Verify that the search results page is displayed when a user enters a valid search term in the search bar and clicks on the search button. 2. Verify that the search results page displays the correct number of search results for the entered search term. 3. Verify that the search results page is responsive and works correctly on different screen sizes and resolutions. Pls check this git hub link for automation example:https://github.com/celikgumusdag/selenium-automation-amazon/blob/master/src/test/java/Search.java |
11. Test scenarios for Screen sharing in an app. | Here are some test scenarios for screen sharing in an app: 1. Verify that the app allows the user to initiate a screen sharing session with another user. 2. Verify that the app provides clear instructions for the user to start and end a screen sharing session. 3. Verify that the app allows the user to pause or stop screen sharing at any time during the session. |
12. What is Absolute and Relative xpath? | Absolute XPath: this one is the complex Path of the element starting from the root. It is the direct way to find the element, but the disadvantage of the absolute XPath is that if there are any changes made in the path of the element then that XPath gets failed. Relative XPath – in this case, the path starts from the middle of the HTML DOM structure. It starts with the double forward-slash (//), which means it can search the element anywhere on the webpage. |
13. Difference between "findelement" and "findelements". | find_element ● will find the first matching element. ● will throw NoSuchElementException if the element is not found. find_elements ● will find all the matching elements. ● will return an empty list if the elements are not found. |
14. Difference between get and navigate method in Selenium? | GET will wait till the whole page gets loaded. NAVIGATE will just redirect to our required page and will not wait. It will guide us through the history like refresh, back, forward. For example if we want to move forward and do some functionality, we need use naviagte. |
15. Difference between quit and close methods in Webdiver? | close( ) WebDriver closes the Browser window which is in focus. quit( ) WebDriver closes all the Browser windows. |
16. What is Webdriver and Webdriver protocol? | WebDriver is an open-source framework for automating web browsers. It provides a programming interface to interact with web browsers such as Chrome, Firefox, Safari, and Edge. WebDriver protocol is a standardized way of communicating with web browsers using WebDriver. The WebDriver protocol defines a set of RESTful APIs that allow you to control web browsers programmatically. |
17. How selenium connects to the Java language and the browser? | 1. Download & Install JDK. 2. Configure IDE. 3. Add Selenium WebDriver library (Maven) 4. Create Test Script. 5. Run Test Script (TestNG) |
18. If you have to execute JavaScript like button, how do you approach it? | Create an instance of the JavascriptExecutor. Then Use the executeScript(). Example: try{ // Step 1: Casting webdriver instance to javaScript executor JavascriptExecutor js=(JavascriptExecutor)driver; // Step 2 : Executing script (clicking button) WebElement btnElement=driver.findElement(By.id("myButtonId")); js.executeScript("arguments[0].click();",btnElement); } catch(Exception e){ System.out.println(e.getMessage()); } |
19. How would you handle the iframe? | 1. Identify the iframe. 2. Switch to the iframe: Use driver.switchTo().frame() 3. Perform required operations on elements inside that frame: Locate element with findElement() and sendKeys() 4. Switch back to default content: driver.switchTo().defaultContent() |
20. You come across a web page and it's very dynamic how do you handle waiting for page to be ready or certain elements to be appear on the page. | I have to use Explicit wait . watforpage to load with element to be visible or clickable |
21. What are the limitations of selenium webdriver? | 1. Limited support for desktop applications: Selenium WebDriver is primarily used to test web-based applications and does not have native support for desktop applications. 2. Handling CAPTCHA. 3. Difficulty with handling dynamic elements: f the website under test contains dynamic elements that change frequently such as pop-ups or overlays, it can be challenging for Selenium WebDriver to identify and interact with them correctly. 4. Limited mobile device support. |
22. What are the ways you find the element in the selenium? | ID, Name, Class Name, Tag Name, Link Text and Partial Link Text, CSS Selector, Xpath |
23. You have a dropdown list on the webpage. let's say you need to add dropdown values like option with checkboxes. Select all options which is unselected. What will your step and logic here? | // Locate the dropdown element on the webpage WebElement dropdown = driver.findElement(By.id("myDropdown")); // Get all option elements within the dropdown List<WebElement> options = dropdown.findElements(By.xpath(".//input[@type='checkbox']")); // Iterate through each option and select it if it's not already selected for (WebElement option : options) { if (!option.isSelected()) { // Scroll into view (if needed) and click on checkbox to mark it as selected ((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", option); option.click(); } } Explanation of code snippet: We first locate the select element containing our desired options by their ID. We then use .findElements() method to get all input fields inside this select. Next, we iterate over these input fields one-by-one using a for loop. If an input field is found to be unselected (using its isSelected() method), we scroll that field into view so that it's clickable and then click on its checkbox or label using .click(). The final result should be that all previously-unselected inputs are now checked. <select id="myDropdown"> <option><input type="checkbox" value="option1"> Option 1</option> <option><input type="checkbox" value="option2"> Option 2</option> <option><input type="checkbox" value="option3"> Option 3</option> </select> |
24. What is cucumber? What are advantages and disadvantage? | Cucumber is a testing framework that allows developers to write tests in natural language using Gherkin syntax. Advantages of Cucumber: Reusability, Easy Readability Disadvantages of Cucumber: It requires user involvement to describe scenarios right Requires maintenance of both steps and scenarios |
25. What is the difference between soft and hard assertion? | Hard assertion:With hard assertion, any error that occurs in a test case will cause the entire script to stop executing. Soft assertion: with soft assertion, even if an assertion fails within a test case, the remaining part of script continues to execute without getting halted until all checks have been completed allowing us track down multiple problems at once before failing out altogether. |
26. Where do we go for implicit? Where do we go for extra time? | We generally use implicit wait when we know that some elements may take longer to load or become visible on the page and we want our test script to wait until they appear before proceeding with further actions. This can help us avoid NoSuchElementException errors that might occur due to race conditions between webdriver and actual webpage rendering. |
28. So which one the framework recommends? Implicit or explicit? | The recommendation for using Implicit or Explicit waits in Java Selenium framework depends on the specific scenario and use case. |
29. In Selenium, how do you check for broken links? There are 100 links on a web page and how do you check for broken links on that page? | In Java Selenium, we can find broken links on a webpage by iterating through all the links present on that page and checking their response status code. If the status code is not 200 (OK), it means that link is broken.. Example: import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import java.util.List; public class FindBrokenLinks { public static void main(String[] args) { WebDriver driver = new ChromeDriver(); driver.get("https://www.example.com"); List<WebElement> links = driver.findElements(By.tagName("a")); for (WebElement link : links) { String href = link.getAttribute("href"); verifyLinkActive(href); } // Close Browser driver.quit(); } public static void verifyLinkActive(String url){ try { URL obj = new URL(url); HttpURLConnection conn = (HttpURLConnection)obj.openConnection(); conn.setConnectTimeout(3000); // Timeout set as 3 seconds // Request Method Head , No need to download entire resource. conn.setRequestMethod("HEAD"); int statusCode=conn.getResponseCode(); if(statusCode>=400){ System.out.println(url+" - Broken Link with Status Code "+statusCode); } else{ System.out.println(url+" - Working Fine with Status Code "+statusCode); } } catch (Exception e) { e.printStackTrace(); } } } |
30. What is scenario outline in cucumber? | Feature: Test Login feature with multiple credentials @AB1 Scenario Outline:TestCase:"<TCID>"Test Newtour website with Multiple credentials Given Open the browser and open application When user enter "<username>" and "<password>" Then user should be successfully login into Application Examples: | TCID | username | password | | TC1 | mercury | mercury | | TC2 | mercury | mercury | | TC3 | mercury | mercury | | TC4 | mercury | mercury | |
4. TestNG
Questions Answers 1. Do you use any TestNG framework? Yes, TestNG is a testing framework for Java that helps to organize and execute test cases. 2. Can you explain different types of annotation in TestNG? @Test: This will execute all methods marked with this annotation as part of the test suite.
@BeforeSuite: should be executed before any of the test methods in the suite are executed.
@AfterSuite: should be executed after all of the test methods in the suite have been executed.
@BeforeTest: should be executed before any of the test methods in the current test tag are executed.
@AfterTest: should be executed after all of the test methods in the current test tag have been executed.
@BeforeClass: should be executed before the first test method in the current test class is executed.
@AfterClass: should be executed after all of the test methods in the current test class have been executed.
@BeforeMethod: should be executed before each test method in the current test class is executed.
@AfterMethod: should be executed after each test method in the current test class is executed. 3. Have you used hook file? Please explain. In Hook, we use different kinds of annotations for executed before or after specific events in the test execution process such as @Before, @AfterStep, @After for capturing the failed test-cases, cleanup the driver. 4. In TestNG, how can I run only Failed Test cases? In TestNG, I can run only failed test cases by using the testng-failed.xml file. This file is created automatically by TestNG when a test run is completed and contains the list of all the failed test cases.
To run only the failed test cases, you need to do the following:
1. Create a new XML file, for example failed-tests.xml.
2. Add the suite tag to the XML file "Failed Test Suite".
3. Inside the suite tag, add the test tag and set the name attribute to "Failed Tests".
4. We need to use Listener.
6. Save the XML file.
7. Open the command prompt and Run the following command to execute the failed test cases:
java -cp "testng.jar;bin" org.testng.TestNG failed-tests.xml
This command will execute only the failed test cases and generate a new report with the results of the failed tests. 5. Have you ever applied to a listener class in TestNG? Any idea about listener class? No, I didnot.
But, I have idea of it. TestNG provides a bunch of listeners as a part of its testing environment. These listeners are as follows:
ITestListener
IReporter
ISuiteListener
IInvokedMethod
IHookable
IConfigurationListener
IConfigurableListener
IAnnotationTransformer
IExecution
IMethodInterceptor 6. In TestNG, how can I run a particular test case end number of time? In TestNG, you can run a particular test case a specific number of times by using the invocationCount attribute of the @Test annotation. The invocationCount attribute specifies the number of times a test method should be invoked.
Here is an example of using invocationCount to run a test method 5 times:
@Test(invocationCount = 5)
public void myTestMethod() {
// Test code goes here
} 7. Difference between after-suite and before-suite. After-Suite is executed after all the test methods in the suite are executed.
Before-Suite is executed before any of the test methods in the suite are executed. 8. What is pom.xml and testng.xml? pom.xml is a file that contains information about a Maven project. It specifies the project's dependencies, build settings, and other information.
testng.xml is a file that contains information about a TestNG test suite. It specifies the tests that are included in the suite and how they should be run. 9. How many suits can be there in TestNG? What if I run all the suits? There is no limit to the number of suites that can be defined in a TestNG test suite.
If I run all of the suites in a test suite, it may take a long time to complete, and I may not be able to identify the source of any errors that occur. It is recommended to run suites in groups of 5-10. 10. Are you familiar with data-provider? What is data-provider? Yes.
Data Provider in Java Selenium is an approach for passing data sets to test methods via another method annotated with @DataProvider. This allows you to run tests with different input values without having to write separate test methods for each set of inputs. 11. What is the difference between Junit and TestNG? 1. Annotations: TestNG provides more annotations than JUnit which makes it easier to write complex test cases that need additional setup/teardown or configuration before execution.
2. Grouping: Grouping feature is available only in TestNG; allowing testers to execute specific set of tests based on certain criteria like smoke/regression etc
3. Parallel Execution: TestNG has, JUnit doesnot.
4. Data Providers: TestNG has, JUnit doesnot. 12. What will happen priority=0 in TestNG? It will execute the first one. 13. Explain grouping in TestNG?
Questions | Answers |
1. Do you use any TestNG framework? | Yes, TestNG is a testing framework for Java that helps to organize and execute test cases. |
2. Can you explain different types of annotation in TestNG? | @Test: This will execute all methods marked with this annotation as part of the test suite. @BeforeSuite: should be executed before any of the test methods in the suite are executed. @AfterSuite: should be executed after all of the test methods in the suite have been executed. @BeforeTest: should be executed before any of the test methods in the current test tag are executed. @AfterTest: should be executed after all of the test methods in the current test tag have been executed. @BeforeClass: should be executed before the first test method in the current test class is executed. @AfterClass: should be executed after all of the test methods in the current test class have been executed. @BeforeMethod: should be executed before each test method in the current test class is executed. @AfterMethod: should be executed after each test method in the current test class is executed. |
3. Have you used hook file? Please explain. | In Hook, we use different kinds of annotations for executed before or after specific events in the test execution process such as @Before, @AfterStep, @After for capturing the failed test-cases, cleanup the driver. |
4. In TestNG, how can I run only Failed Test cases? | In TestNG, I can run only failed test cases by using the testng-failed.xml file. This file is created automatically by TestNG when a test run is completed and contains the list of all the failed test cases. To run only the failed test cases, you need to do the following: 1. Create a new XML file, for example failed-tests.xml. 2. Add the suite tag to the XML file "Failed Test Suite". 3. Inside the suite tag, add the test tag and set the name attribute to "Failed Tests". 4. We need to use Listener. 6. Save the XML file. 7. Open the command prompt and Run the following command to execute the failed test cases: java -cp "testng.jar;bin" org.testng.TestNG failed-tests.xml This command will execute only the failed test cases and generate a new report with the results of the failed tests. |
5. Have you ever applied to a listener class in TestNG? Any idea about listener class? | No, I didnot. But, I have idea of it. TestNG provides a bunch of listeners as a part of its testing environment. These listeners are as follows: ITestListener IReporter ISuiteListener IInvokedMethod IHookable IConfigurationListener IConfigurableListener IAnnotationTransformer IExecution IMethodInterceptor |
6. In TestNG, how can I run a particular test case end number of time? | In TestNG, you can run a particular test case a specific number of times by using the invocationCount attribute of the @Test annotation. The invocationCount attribute specifies the number of times a test method should be invoked. Here is an example of using invocationCount to run a test method 5 times: @Test(invocationCount = 5) public void myTestMethod() { // Test code goes here } |
7. Difference between after-suite and before-suite. | After-Suite is executed after all the test methods in the suite are executed. Before-Suite is executed before any of the test methods in the suite are executed. |
8. What is pom.xml and testng.xml? | pom.xml is a file that contains information about a Maven project. It specifies the project's dependencies, build settings, and other information. testng.xml is a file that contains information about a TestNG test suite. It specifies the tests that are included in the suite and how they should be run. |
9. How many suits can be there in TestNG? What if I run all the suits? | There is no limit to the number of suites that can be defined in a TestNG test suite. If I run all of the suites in a test suite, it may take a long time to complete, and I may not be able to identify the source of any errors that occur. It is recommended to run suites in groups of 5-10. |
10. Are you familiar with data-provider? What is data-provider? | Yes. Data Provider in Java Selenium is an approach for passing data sets to test methods via another method annotated with @DataProvider. This allows you to run tests with different input values without having to write separate test methods for each set of inputs. |
11. What is the difference between Junit and TestNG? | 1. Annotations: TestNG provides more annotations than JUnit which makes it easier to write complex test cases that need additional setup/teardown or configuration before execution. 2. Grouping: Grouping feature is available only in TestNG; allowing testers to execute specific set of tests based on certain criteria like smoke/regression etc 3. Parallel Execution: TestNG has, JUnit doesnot. 4. Data Providers: TestNG has, JUnit doesnot. |
12. What will happen priority=0 in TestNG? | It will execute the first one. |
13. Explain grouping in TestNG? |
5. Java
Questions Answers 1. How do you use OOPS concept in Selenium?
Or,
Basic priciples of page object model / page object pattern. Object-Oriented Programming (OOP) concepts can be used in Selenium to create more modular and maintainable test automation code. Here are some examples of how OOP concepts can be applied in Selenium:
Encapsulation: In Selenium, we can encapsulate the page objects by creating a separate class for each page, which contains the page elements and their corresponding methods.
Inheritance: In Selenium, we can use inheritance to create a base page object class that contains common page elements and methods, which can be inherited by the child page object classes. This way, we can reduce code duplication and make the code more maintainable.
Polymorphism: Polymorphism allows an object to take on many forms. In Selenium, we can use polymorphism to create different implementations of the same method for different page objects. For example, if we have a method to click a button, we can create different implementations for different types of buttons, such as regular buttons, dropdown buttons, etc.
Abstraction: In Selenium, we can use abstraction to create an interface for the page objects, which only exposes the essential methods for interacting with the page. This way, the test automation code can work with any page object that implements the interface. https://www.softwaretestingmaterial.com/oops-concept-in-automation-framework/ 2. Have you used Super interface in selenium? Please explain. Super interfaces in Selenium are used to extend the functionality of the base WebDriver interface by providing additional methods and constants. By extending these super interfaces, we can access additional functionality that is not available in the base interface. 3. Why should I use constructor? Object consistency: Constructors can be used to ensure that an object is created in a consistent and valid state. For example, if you have a class that represents a person, you can use a constructor to ensure that the person object always has a valid name and age.
Facilitating code reuse: Constructors can be used to create object instances that share a common set of properties or behavior. This can make it easier to create and reuse object instances throughout codebase. 4. I am getting stale element reference exception. What would be the cause for it? A stale element reference exception is thrown when a referenced web element is no longer attached to the DOM or has become stale. This can happen for several reasons, such as the page being reloaded, a new page being loaded, or the element being modified by JavaScript after it was initially loaded.
1. Test failure: This makes test fail.
2. Reduced test coverage: If a stale element reference causes a test to fail, you may need to exclude that test from your test suite, which can reduce your overall test coverage and leave you with blind spots in your application.
3. Maintenance overhead: If you have a lot of tests that rely on web elements, you may need to spend a lot of time updating them to handle stale element references.
Using explicit waits can help the avoid Stale Element exception. 5. Explain -- Page Object Model, Page Factory, Page Object Pattern. Page Object Model (POM) and Page Factory are design patterns used in Selenium to create more modular and maintainable test automation code.
Page Object Model (POM) is creating a separate class for each page of the application. Each page class contains the page elements and their corresponding methods. The test automation code interacts with the page classes instead of the individual page elements, which makes the code more modular and easier to maintain.
Page Factory is a design pattern that complements POM by providing a convenient way to initialize the page elements in the page classes. The Page Factory class uses annotations to identify the page elements in the page classes and initializes them using the initElements method. This allows the page elements to be initialized, which can improve test performance. 7. Difference between Abstraction and interface. Abstraction:
Abstraction is a process of hiding the implementation details and showing only functionality to the user.
It provides a template for creating classes that share some common attributes and behaviors.
Interface:
An interface is a collection of abstract methods and constants.
It is used to define a set of behaviors that can be used by different classes. 8. What is encapsulation? In Selenium, we can encapsulate the page objects by creating a separate class for each page, which contains the page elements and their corresponding methods. 9. Difference between throw and throws. In Java, we use the throw keyword to explicitly throw an exception from a method or block of code.
For example:
public void divide(int num1, int num2) {
if (num2 == 0) {
throw new ArithmeticException("Cannot divide by zero");
}
int result = num1 / num2;
}
throws is used to declare that a method can throw an exception.
For example:
public void readFile(String fileName) throws FileNotFoundException {
File file = new File(fileName);
Scanner scanner = new Scanner(file);
// rest of code
} 10. What are the exceptions you faced and how can you resolve no such element option? NoSuchElementException: This exception is thrown when Selenium cannot find the element that you are trying to locate.
ElementNotVisibleException: This exception is thrown when Selenium cannot find the element that you are trying to locate because it is not visible on the page.
StaleElementReferenceException: This exception is thrown when Selenium tries to interact with an element that has been removed from the page.
WebDriverException: This exception is a catch-all exception that is thrown for any other errors that occur while using Selenium.
To resolve the "no such element option" exception:
1. Use a different locator strategy, such as XPath or CSS.
2. Use the implicit wait or explicit wait to wait for the element to become available.
3. Make sure the element exists on the page. 11. Explain Page Object Model and its advantages. The Page Object Model is a design pattern that is used in test automation to create a separate class for each page in an application.
This can help to improve the maintainability and readability of your test code. 12. What is hashmap. Can we store them and how to retrieve them? Hashmap is a data structure that maps keys to values. It is a collection of key-value pairs, where the keys are unique and the values can be any object.
Yes, we can store them and retrieve them by using get() method. 13. How do I make the class abstract? To make a class abstract in Java, I can use the abstract keyword. Simply put the keyword before the class name at the beginning of the class.
public abstract class MyClass {
// class body
} 14. What primitives do you know in Java? In Java, there are eight primitive data types, which are:
byte, short, int, long, float, double, char, boolean 15. What is the difference between primitive data-type and reference data-type? Primitive data types are basic data types that are built into the Java language. These data types include byte, short, int, long, float, double, char, and boolean. Primitive data types are stored directly in memory and are passed by value.
Reference data types, on the other hand, are more complex data types that are created by the programmer using classes, interfaces, and arrays. These data types include objects, arrays, and interfaces. Reference data types are stored in memory as references (pointers) to objects, and are passed by reference. 16. What is generic in Java? Is Lists or HashMap, generics or not? Generics is a feature that allows you to parameterize types. Generics enable you to create classes, interfaces, and methods that can work with different types of objects, without requiring you to write separate code for each type.
Both List and HashMap in Java are generic classes. They can be parameterized with a type, such as String, Integer, or any other type. This means that you can create a List or a HashMap that works with any type of object, without having to write separate code for each type. 17. From a compilation perspective, there are two types of exceptions in Java. What are those? From a compilation perspective, there are two types of exceptions in Java:
1. Checked Exceptions: These are exceptions that are checked at compile-time. This means that the compiler will check if the code that can throw a checked exception has provided a way to handle that exception. If not, the code will not compile. Examples of checked exceptions include IOException, SQLException, and ClassNotFoundException.
2. Unchecked Exceptions: These are exceptions that are not checked at compile-time. This means that the compiler does not require the code to handle these exceptions explicitly. Unchecked exceptions are also called runtime exceptions, and they occur at runtime when something unexpected happens. Examples of unchecked exceptions include NullPointerException, ArrayIndexOutOfBoundsException, and ArithmeticException. 18. What are the exceptions in Java? 1. ArithmeticException : Thrown when an arithmetic operation results in an overflow or a divide-by-zero error.
2. NullPointerException : Thrown when a null reference is used where an object is expected.
3. ArrayIndexOutOfBoundsException : Thrown when an array index is out of bounds.
4. IllegalArgumentException : Thrown when an illegal argument is passed to a method.
5. ClassCastException : Thrown when an object is cast to a class of an incompatible type.
6. IOException : Thrown when an I/O operation fails. 20. What package manage tool do you use in your project? Maven 22. Can one interface extend another interface? Yes, in Java one interface can extend another interface.
Example:
public interface Vehicle {
void drive();
}
public interface Car extends Vehicle {
void park();
} 23. Can one class extend another interface? No, in Java, a class cannot extend an interface.
Example:
public interface Vehicle {
void drive();
}
public class Car implements Vehicle {
public void drive() {
System.out.println("Driving car...");
}
} 24. What is the access modifier in Java? Access modifiers in Java are keywords used to specify the level of access or visibility that a class, method, or variable has. There are four types of access modifiers in Java: Public, private, protected, default 25. What is the syntax of array? In Java, an array is a container object that holds a fixed number of values of a single data type.
// Syntax to declare an array
dataType[] arrayName;
// Syntax to initialize an array
arrayName = new dataType[arraySize];
// Or we could do both together like this:
dataType[] arrayName = new dataType[arraySize];
dataType refers to the type of data that will be stored in the array (e.g., int, double, String).
arrayName is the name given to our newly created Array.
arraySize specifies how many elements can be stored inside our Array. 26. What is the difference between HashMap and Hash-Table? HashMap and HashTable are two data structures in Java that use key-value pairs to store and retrieve data. Although both have similar functionality, there are some differences between them: like Synchronization, Performance. 27. Can we overwrite static method? In Java, we cannot override or overwrite a static method; instead, we can only hide it. 28. What is Method overloading and method overriding? Method Overloading
Method overloading is a feature in Java where we can declare multiple methods with the same name within a class, but they must have different parameter lists. This allows programmers to define similar operations on objects of different types or parameters without having to use separate names for each operation.
Example:
public class Example {
public void print(int num) {
System.out.println("Printing integer: " + num);
}
public void print(String str) {
System.out.println("Printing string: " + str);
}
}
Method Overriding
Method overriding occurs when a subclass provides its own implementation of a method that is already defined by its parent class.
Example:
class Parent {
public void print() {
System.out.println("Parent");
}
}
class Child extends Parent {
@Override
public void print() {
System.out.println("Child");
}
}
public class Example{
public static void main(String[] args){
Parent p= new Child();
/* Here object type is 'Child' but reference type is 'Parent'
hence Child's print() method gets called at runtime due to
Polymorphism */
p.print(); // Output: "Child"
}
} 29. Explain the main method (public static void main(String args[]) in Java? public: This keyword specifies that the main() method can be accessed by any class in any package.
static: This keyword allows us to call the main() method without having to create an instance of the class containing it. In other words, we don't need to instantiate an object before calling our Main function.
void: The keyword void indicates that this function does not return anything back.
main: This is simply the name assigned to our entry point function/method which could also be changed if needed.
String[] args: These are command-line arguments passed by user at runtime as Array of Strings.
Example:
public class Example {
public static void main(String[] args) {
System.out.println("Hello World");
}
} 30. How to do inheritance in the class? Inheritance is a mechanism in Java that allows us to create new classes based on existing ones. Inheritance enables one class, the subclass, to inherit methods and variables from another class called superclass. The syntax for creating an inheritance relationship between two classes is as follows:
class SuperClass {
// Fields
// Methods
}
class SubClass extends SuperClass {
// Fields
// Methods
} 31. In Java, what's the difference between static method and instance method? Static Method: A static method is marked with the keyword "static" and can be called without creating an object/instance of the class. Static methods are often used for utility functions which do not depend on any specific state or data associated with individual objects. They cannot access non-static variables/methods directly; they have their own scope & memory allocation in JVM.
Instance Method: An instance method can only be called via an instance/object of its corresponding class. These methods can access both static and non-static variables/methods within their own class as well as parameters passed during function call from outside objects/classes. 33. What is garbage collection in Java? Garbage Collection is a process in Java that automatically frees up memory by removing the objects/instances which are no longer being used or referenced by any part of the program. It helps to avoid memory leaks, where unused objects take up space and can cause performance issues.
Example:
public class MyClass {
public static void main(String[] args) {
String str1 = new String("Hello");
String str2 = new String("World");
// making 'str1' reference null
str1 = null;
// calling garbage collector explicitly
System.gc();
}
} How would you find a palindrome How the oops concept are implemented selenium https://www.softwaretestingmaterial.com/oops-concept-in-automation-framework/
Questions | Answers |
1. How do you use OOPS concept in Selenium? Or, Basic priciples of page object model / page object pattern. | Object-Oriented Programming (OOP) concepts can be used in Selenium to create more modular and maintainable test automation code. Here are some examples of how OOP concepts can be applied in Selenium: Encapsulation: In Selenium, we can encapsulate the page objects by creating a separate class for each page, which contains the page elements and their corresponding methods. Inheritance: In Selenium, we can use inheritance to create a base page object class that contains common page elements and methods, which can be inherited by the child page object classes. This way, we can reduce code duplication and make the code more maintainable. Polymorphism: Polymorphism allows an object to take on many forms. In Selenium, we can use polymorphism to create different implementations of the same method for different page objects. For example, if we have a method to click a button, we can create different implementations for different types of buttons, such as regular buttons, dropdown buttons, etc. Abstraction: In Selenium, we can use abstraction to create an interface for the page objects, which only exposes the essential methods for interacting with the page. This way, the test automation code can work with any page object that implements the interface. https://www.softwaretestingmaterial.com/oops-concept-in-automation-framework/ |
2. Have you used Super interface in selenium? Please explain. | Super interfaces in Selenium are used to extend the functionality of the base WebDriver interface by providing additional methods and constants. By extending these super interfaces, we can access additional functionality that is not available in the base interface. |
3. Why should I use constructor? | Object consistency: Constructors can be used to ensure that an object is created in a consistent and valid state. For example, if you have a class that represents a person, you can use a constructor to ensure that the person object always has a valid name and age. Facilitating code reuse: Constructors can be used to create object instances that share a common set of properties or behavior. This can make it easier to create and reuse object instances throughout codebase. |
4. I am getting stale element reference exception. What would be the cause for it? | A stale element reference exception is thrown when a referenced web element is no longer attached to the DOM or has become stale. This can happen for several reasons, such as the page being reloaded, a new page being loaded, or the element being modified by JavaScript after it was initially loaded. 1. Test failure: This makes test fail. 2. Reduced test coverage: If a stale element reference causes a test to fail, you may need to exclude that test from your test suite, which can reduce your overall test coverage and leave you with blind spots in your application. 3. Maintenance overhead: If you have a lot of tests that rely on web elements, you may need to spend a lot of time updating them to handle stale element references. Using explicit waits can help the avoid Stale Element exception. |
5. Explain -- Page Object Model, Page Factory, Page Object Pattern. | Page Object Model (POM) and Page Factory are design patterns used in Selenium to create more modular and maintainable test automation code. Page Object Model (POM) is creating a separate class for each page of the application. Each page class contains the page elements and their corresponding methods. The test automation code interacts with the page classes instead of the individual page elements, which makes the code more modular and easier to maintain. Page Factory is a design pattern that complements POM by providing a convenient way to initialize the page elements in the page classes. The Page Factory class uses annotations to identify the page elements in the page classes and initializes them using the initElements method. This allows the page elements to be initialized, which can improve test performance. |
7. Difference between Abstraction and interface. | Abstraction: Abstraction is a process of hiding the implementation details and showing only functionality to the user. It provides a template for creating classes that share some common attributes and behaviors. Interface: An interface is a collection of abstract methods and constants. It is used to define a set of behaviors that can be used by different classes. |
8. What is encapsulation? | In Selenium, we can encapsulate the page objects by creating a separate class for each page, which contains the page elements and their corresponding methods. |
9. Difference between throw and throws. | In Java, we use the throw keyword to explicitly throw an exception from a method or block of code. For example: public void divide(int num1, int num2) { if (num2 == 0) { throw new ArithmeticException("Cannot divide by zero"); } int result = num1 / num2; } throws is used to declare that a method can throw an exception. For example: public void readFile(String fileName) throws FileNotFoundException { File file = new File(fileName); Scanner scanner = new Scanner(file); // rest of code } |
10. What are the exceptions you faced and how can you resolve no such element option? | NoSuchElementException: This exception is thrown when Selenium cannot find the element that you are trying to locate. ElementNotVisibleException: This exception is thrown when Selenium cannot find the element that you are trying to locate because it is not visible on the page. StaleElementReferenceException: This exception is thrown when Selenium tries to interact with an element that has been removed from the page. WebDriverException: This exception is a catch-all exception that is thrown for any other errors that occur while using Selenium. To resolve the "no such element option" exception: 1. Use a different locator strategy, such as XPath or CSS. 2. Use the implicit wait or explicit wait to wait for the element to become available. 3. Make sure the element exists on the page. |
11. Explain Page Object Model and its advantages. | The Page Object Model is a design pattern that is used in test automation to create a separate class for each page in an application. This can help to improve the maintainability and readability of your test code. |
12. What is hashmap. Can we store them and how to retrieve them? | Hashmap is a data structure that maps keys to values. It is a collection of key-value pairs, where the keys are unique and the values can be any object. Yes, we can store them and retrieve them by using get() method. |
13. How do I make the class abstract? | To make a class abstract in Java, I can use the abstract keyword. Simply put the keyword before the class name at the beginning of the class. public abstract class MyClass { // class body } |
14. What primitives do you know in Java? | In Java, there are eight primitive data types, which are: byte, short, int, long, float, double, char, boolean |
15. What is the difference between primitive data-type and reference data-type? | Primitive data types are basic data types that are built into the Java language. These data types include byte, short, int, long, float, double, char, and boolean. Primitive data types are stored directly in memory and are passed by value. Reference data types, on the other hand, are more complex data types that are created by the programmer using classes, interfaces, and arrays. These data types include objects, arrays, and interfaces. Reference data types are stored in memory as references (pointers) to objects, and are passed by reference. |
16. What is generic in Java? Is Lists or HashMap, generics or not? | Generics is a feature that allows you to parameterize types. Generics enable you to create classes, interfaces, and methods that can work with different types of objects, without requiring you to write separate code for each type. Both List and HashMap in Java are generic classes. They can be parameterized with a type, such as String, Integer, or any other type. This means that you can create a List or a HashMap that works with any type of object, without having to write separate code for each type. |
17. From a compilation perspective, there are two types of exceptions in Java. What are those? | From a compilation perspective, there are two types of exceptions in Java: 1. Checked Exceptions: These are exceptions that are checked at compile-time. This means that the compiler will check if the code that can throw a checked exception has provided a way to handle that exception. If not, the code will not compile. Examples of checked exceptions include IOException, SQLException, and ClassNotFoundException. 2. Unchecked Exceptions: These are exceptions that are not checked at compile-time. This means that the compiler does not require the code to handle these exceptions explicitly. Unchecked exceptions are also called runtime exceptions, and they occur at runtime when something unexpected happens. Examples of unchecked exceptions include NullPointerException, ArrayIndexOutOfBoundsException, and ArithmeticException. |
18. What are the exceptions in Java? | 1. ArithmeticException : Thrown when an arithmetic operation results in an overflow or a divide-by-zero error. 2. NullPointerException : Thrown when a null reference is used where an object is expected. 3. ArrayIndexOutOfBoundsException : Thrown when an array index is out of bounds. 4. IllegalArgumentException : Thrown when an illegal argument is passed to a method. 5. ClassCastException : Thrown when an object is cast to a class of an incompatible type. 6. IOException : Thrown when an I/O operation fails. |
20. What package manage tool do you use in your project? | Maven |
22. Can one interface extend another interface? | Yes, in Java one interface can extend another interface. Example: public interface Vehicle { void drive(); } public interface Car extends Vehicle { void park(); } |
23. Can one class extend another interface? | No, in Java, a class cannot extend an interface. Example: public interface Vehicle { void drive(); } public class Car implements Vehicle { public void drive() { System.out.println("Driving car..."); } } |
24. What is the access modifier in Java? | Access modifiers in Java are keywords used to specify the level of access or visibility that a class, method, or variable has. There are four types of access modifiers in Java: Public, private, protected, default |
25. What is the syntax of array? | In Java, an array is a container object that holds a fixed number of values of a single data type. // Syntax to declare an array dataType[] arrayName; // Syntax to initialize an array arrayName = new dataType[arraySize]; // Or we could do both together like this: dataType[] arrayName = new dataType[arraySize]; dataType refers to the type of data that will be stored in the array (e.g., int, double, String). arrayName is the name given to our newly created Array. arraySize specifies how many elements can be stored inside our Array. |
26. What is the difference between HashMap and Hash-Table? | HashMap and HashTable are two data structures in Java that use key-value pairs to store and retrieve data. Although both have similar functionality, there are some differences between them: like Synchronization, Performance. |
27. Can we overwrite static method? | In Java, we cannot override or overwrite a static method; instead, we can only hide it. |
28. What is Method overloading and method overriding? | Method Overloading Method overloading is a feature in Java where we can declare multiple methods with the same name within a class, but they must have different parameter lists. This allows programmers to define similar operations on objects of different types or parameters without having to use separate names for each operation. Example: public class Example { public void print(int num) { System.out.println("Printing integer: " + num); } public void print(String str) { System.out.println("Printing string: " + str); } } Method Overriding Method overriding occurs when a subclass provides its own implementation of a method that is already defined by its parent class. Example: class Parent { public void print() { System.out.println("Parent"); } } class Child extends Parent { @Override public void print() { System.out.println("Child"); } } public class Example{ public static void main(String[] args){ Parent p= new Child(); /* Here object type is 'Child' but reference type is 'Parent' hence Child's print() method gets called at runtime due to Polymorphism */ p.print(); // Output: "Child" } } |
29. Explain the main method (public static void main(String args[]) in Java? | public: This keyword specifies that the main() method can be accessed by any class in any package. static: This keyword allows us to call the main() method without having to create an instance of the class containing it. In other words, we don't need to instantiate an object before calling our Main function. void: The keyword void indicates that this function does not return anything back. main: This is simply the name assigned to our entry point function/method which could also be changed if needed. String[] args: These are command-line arguments passed by user at runtime as Array of Strings. Example: public class Example { public static void main(String[] args) { System.out.println("Hello World"); } } |
30. How to do inheritance in the class? | Inheritance is a mechanism in Java that allows us to create new classes based on existing ones. Inheritance enables one class, the subclass, to inherit methods and variables from another class called superclass. The syntax for creating an inheritance relationship between two classes is as follows: class SuperClass { // Fields // Methods } class SubClass extends SuperClass { // Fields // Methods } |
31. In Java, what's the difference between static method and instance method? | Static Method: A static method is marked with the keyword "static" and can be called without creating an object/instance of the class. Static methods are often used for utility functions which do not depend on any specific state or data associated with individual objects. They cannot access non-static variables/methods directly; they have their own scope & memory allocation in JVM. Instance Method: An instance method can only be called via an instance/object of its corresponding class. These methods can access both static and non-static variables/methods within their own class as well as parameters passed during function call from outside objects/classes. |
33. What is garbage collection in Java? | Garbage Collection is a process in Java that automatically frees up memory by removing the objects/instances which are no longer being used or referenced by any part of the program. It helps to avoid memory leaks, where unused objects take up space and can cause performance issues. Example: public class MyClass { public static void main(String[] args) { String str1 = new String("Hello"); String str2 = new String("World"); // making 'str1' reference null str1 = null; // calling garbage collector explicitly System.gc(); } } |
How would you find a palindrome | |
How the oops concept are implemented selenium | https://www.softwaretestingmaterial.com/oops-concept-in-automation-framework/ |
6. Technical without code
Questions | Answers |
1. Can you please explain the software development life cycle process? | The software development life cycle (SDLC) is a process that outlines the steps needed to take a software product from concept to completion. It includes planning, designing, developing, testing, deploying, and maintaining. The primary goal of the SDLC process is to ensure that the software meets the needs of the customer and the stakeholders while being cost-effective and time-efficient. |
2. What is Resgression testing and Re testing? | Regression testing is a testing that ensures an application still functions as expected after any code changes, updates, or improvements. Re-testing is a testing where to make sure that the test cases which failed earlier or new changes are made functioning properly. |
3. How do you write a bug report? | I’m going to Jira. Creating a new ticket. 1. Choosing the correct project, choosing the issue type which is a bug report. 2. Writing the Title 3. Description with steps to reproduce, actual and expected behavior, 4. Choose the Environment 5. Set the Priority, 6. Add the Attachments of the screenshots, videos or log files 7. Set the Assignee |
4. If you need to complete 80 test cases in 5 days, but after the first day you completed 8 test cases, what will you do? | I will continue executing test cases; also I will raise a concern to the QA Manager that we might need more time or effort/resources/people to finish this testing on time if I see that the test cases are complicated or time consuming. |
5. Explain -- Test Case, Test Plan, Test Suite. | Test case is a set of instructions where tester will determine whether an application or system meets its requirements and works correctly. Test plan is a document that outlines the testing approach, objectives, scope, and schedule for a particular software testing effort. Test suites are created to organize test cases and make them easier to manage and execute. They help to ensure that all the necessary tests are executed in a systematic and efficient manner, and they also provide a way to measure the progress of testing. |
6. If there is no documentation available, how do you know what to test and how to perform testing properly? | I was mostly working with requirements, but in case that I won't have any, I would ask the PM (Product Manager) what is the expected behavior, if that is missing and I'm told to test it without requirements I would just compare it to similar (competitor) quality product and also use the app as a user and will make sure that the app behaves as expected by the user. I will also ask access to the tickets/stories according to which the app was created by the developers. Those tickets will be our requirements until we receive updated requirements. I will also ask to schedule a meeting with the product manager, QA and the development to better understand the requirements and the expected behavior. |
7. What is the difference between smoke testing and sanity testing? | Smoke testing: Smoke Testing is performed to verify that the critical functionality of the program is working fine. Sanity testing: Sanity Testing is done to check the new functionality/bugs have been fixed. |
8. Is smoke testing documented or not? | Smoke testing is a type of black-box testing. It is usually documented because it is used to detect bugs and other issues. |
9. What is black-box testing? | Black-box testing is a software testing method in which the functionality of an application is tested without having any knowledge of the internal structure or code. It is often used to find errors or bugs in the system and to verify that the application is functioning as expected. |
11. What do you mean by severity and priority? | Severity: how it impact the system. Priority: how it impact business. High Priority & Low Severity: A button is not opening a page High Severity & Low Priority: Customers are not able to apply for credit .card. Credit card page is crashing when applying. Credit officer is not getting notification for approval. |
12. What is the difference between positive and negative testing? | Positive testing: Positive testing is a testing technique that verifies the software product's behavior when given valid inputs. Negative testing: Negative testing is a testing technique that verifies the software product's behavior when given invalid inputs. |
13. What are the testing techniques? | There are various types of testing techniques, which include: 1. Manual testing 2. Automated testing 3. Exploratory testing 4. Regression testing 5. Performance testing 6. Security testing 7. Usability testing 8. Acceptance testing 9. Integration testing 10. System testing 11. Unit testing |
14. What is the difference between verification and validation? | Verification is a process of determining if the software is designed and developed as per the specified requirements. Validation is the process of checking if the software (end product) has met the client’s true needs and expectations. |
15. What is STLC? | The Software Testing Life Cycle (STLC) is a series of phases that a software testing project goes through to ensure that the software product meets its quality objectives. It has several phases. 1. Requirement Analysis 2. Test Planning 3. Test Design 4. Test Execution 5. Test Reporting 6. Test Closure |
16. What is Bug, Defect, Failure? | Bug: A bug is a defect in the software code that causes the software to behave in unexpected manner. It is raised by test engineers. Defect: when software fail or behave abnormally, that is called defect. It is identified by test engineers and is resolved by programmers or developers. Failure: When it doesnot meet its specified requirements, that is called failure. It is found in development phase. |
17. What is Functional and Non-Functional testing? | Functional testing verifies that the software's intended functions correctly. Non-functional verifies the non-functional requirements of the application under test, such as performance, scalability, reliability, usability, security, and compatibility. |
19. What is RTM? Who do the RTM? | RTM stands for Requirement Traceability Matrix. |
22. What are important metrics for measuring quality assurance and why are they important? | Important metrics for measuring quality assurance include: a) Defect Density : number of defects found b) Test Coverage : how many tests are covering every features c) Test Execution Time : total duration taken by all regression/smoke/sanity etc test-cases during each run |
24. What is native application? | Native application refers to software that is developed for a specific platform or operating system (OS) such as Windows, MacOS, iOS, or Android. These applications are installed directly on the device and can access all the resources available on that device like camera, contacts etc. |
32. From your regression testing 50 of your testcase failed . What will be your next step? | investigate the failures and find out why is is failing. three reason test could fail. bug, synchornization issue, element change |
34. What is the difference between test strategy and test plan? With example like what we do in test strategy and in test plan? | |
35. You are hitting a request to the server, but you're not getting the response back. How are you going to handle this situation during your testing | connect wiith the api developer , and if its a bug you will create a bug report |
36. What are the techniques usually in test case design? | |
38. in Java, when you are comparing 2 strings. Which one you choose? The operator equal to or equals method. | In Java, when we want to compare two strings for equality, we should use the equals() method rather than the equal-to (==) operator. The reason behind this is that the == operator compares object references (memory locations) instead of their actual values. Therefore, if we compare two string objects using ==, it will only return true if they are referring to the same exact memory location in memory. On the other hand, The .equals() method compares actual content of both strings. It returns true only if both Strings have exactly same sequence of characters and length; otherwise false. Example: String str1 = "hello"; String str2 = new String("hello"); // Using == Operator if(str1 == str2){ System.out.println("Strings are Equal"); } else { System.out.println("Strings are NOT Equal"); // Output: Strings are NOT Equal } // Using .equals() Method if(str1.equals(str2)){ System.out.println("Strings are Equal"); // Output: Strings are Equal } else { System.out.println("Strings are NOT Equal"); } |
7. Technical with code(Java +Automation)
Automation | |
Questions | Answers |
1. Can you tell me the code for invoking the browser? let’s say Chrome browser. | // Create a new instance of the ChromeDriver WebDriver driver = new ChromeDriver(); // Navigate to a web page driver.get("http://www.example.com"); |
2. What is the selenium method we use for capturing the page title? | driver.getTitle(); |
3. How do you write an XPATH for an element that has a ghost element infront of it? | Using the following-sibling: WebElement targetElement = driver.findElement(By.xpath("//div/following-sibling::input")); |
4. How do you take a screenshot in selenium? Provide a code. | public static void main(String[] args) throws Exception { WebDriver driver = new ChromeDriver(); driver.get("https://www.example.com"); File screenshotFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); FileUtils.copyFile(screenshotFile, new File("path/to/screenshot.png")); } |
5. How do mouse hover to the element in selenium? | from selenium import webdriver from selenium.webdriver import ActionChains from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC driver = webdriver.Chrome() driver.get('https://example.com') element_to_hover = driver.find_element(By.XPATH, '//*[@id="element-id"]') actions = ActionChains(driver) actions.move_to_element(element_to_hover).perform() driver.quit() |
6. How do you scroll on a webpage? | import java.util.concurrent.TimeUnit; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class HorizontalScroll { public static void main(String[] args) { //specify the location of the driver System.setProperty(“webdriver.chrome.driver”,”ChromeDriver_path”); //Initialising the driver WebDriver driver = new ChromeDriver(); //launch the website driver.get(“https://www.album.alexflueras.ro/index.php”); //maximize the window to full screen driver.manage().window().maximize(); //It will wait for maximum of 10sec for each object driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); JavascriptExecutor js = (JavascriptExecutor) driver; js.executeScript(“window.scrollBy(5000,40)”); driver.close(); } } |
7. How do you handle dynamic change elements in XPATH? | <button id="dynamic-button-123">Click me!</button> One way to handle dynamic changes in elements is to use the "contains" function in XPath. //button[contains(@id, 'dynamic-button-')] |
8. How can I ignore or disable CAPTCHA? | In the QA environtment Captacas will be turned off. |
9. How do we create a feature file? | Create a new text file with a ".feature" extension, "my_feature.feature" Inside the file we create "Feature: description of the feature" |
10. How do we write scenarios in feature file? | Scenario keyword, then brief description of the scenario. Then the steps using Given, when, then. Example: Scenario: Search for a product by name Given I am on the home page When I enter "laptop" in the search box And I click the search button Then I should see a list of products containing "laptop" |
11. How do you write step definition? | By using Given, When, and Then keywords. We use these keywords to define the behavior of the feature or scenario. |
12. What are the different locators in selenium? | ID, XPATH, CSS Selector, Class, Name, LinkText, Partial LinkText, TagName |
13. Can you please frame any 4 positive and 4 negative scenarios for the Gmail login page? | Positive Scenarios: 1. Successful login: User enters correct email and password and is successfully logged into their Gmail account. 2. Account recovery: User has forgotten their password and successfully recovers their account by following the account recovery process. 3. Two-factor authentication: User has enabled two-factor authentication and successfully logs into their Gmail account by entering a verification code sent to their phone. 4. Secure session: User logs into their Gmail account and sees that the session is secure, indicated by a lock icon in the browser bar. Negative Scenarios: 1. Incorrect email or password: User enters an incorrect email or password and is unable to log into their Gmail account. 2. Account suspended: User is unable to log into their Gmail account because their account has been suspended or terminated by Google. 3. Hacked account: User attempts to log into their Gmail account but discovers that their account has been hacked and their password has been changed. 4. Suspicious activity: User is unable to log into their Gmail account due to suspicious activity detected by Google, such as multiple failed login attempts. |
14. 14. How do you write a code for Selecting dropdown values using python/java? Or, If I want select particular value from the drop down. How can I do that? | //JAVA import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.support.ui.Select; public class static_dropdown { public static void main(String[] args) { WebDriver driver = new ChromeDriver(); driver.get("https://rahulshettyacademy.com/dropdownsPractise/"); WebElement staticDropdown = driver.findElement(By.id("ctl00_mainContent_DropDownListCurrency")); Select dropDown = new Select(staticDropdown); // one way (selecting USD) dropDown.selectByIndex(3); System.out.println(dropDown.getFirstSelectedOption().getText()); // another way (selecting AED) dropDown.selectByVisibleText("AED"); System.out.println(dropDown.getFirstSelectedOption().getText()); // another way (selecting INR) dropDown.selectByValue("INR"); System.out.println(dropDown.getFirstSelectedOption().getText()); driver.quit(); } } //Only works if tag is <select> //PYTHON from selenium import webdriver from selenium.webdriver.support.ui import Select # Launch the web browser and open the webpage with the dropdown driver = webdriver.Chrome() driver.get("https://example.com") # Find the dropdown element by its HTML tag name, ID or CSS selector dropdown_element = driver.find_element_by_id("dropdown_id") # Create a Select object and choose an option by its value, text or index dropdown_select = Select(dropdown_element) dropdown_select.select_by_value("option_value") # replace "option_value" with the desired value |
15. I have a dialogue box which prompts me to enter my name. What is the syntax for WebDriver to achieve that? | // Find the dialog box element using its ID or name WebElement dialogBox = driver.findElement(By.id("dialogBox")).sendKeys("Your Name"); |
16. Element is available, but error says, “Unable to locate element”. How do you troubleshoot this to locate the element? | 1. Checking the locator is right. 2. Using another locator. 3. Using WebDriverWait class to wait for the element to become visible. 4. Check the console logs for any errors that might be occurring. |
17. Explain the code of launching browser. | //Java import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class LaunchBrowser { public static void main(String[] args) { System.setProperty("webdriver.chrome.driver", "/path/to/chromedriver"); WebDriver driver = new ChromeDriver(); driver.get("https://www.example.com"); driver.quit(); } } //Python from selenium import webdriver driver = webdriver.Chrome() driver.get("https://www.example.com") driver.quit() |
18. How do you handle dropdowns in selenium? | 1. Identify the element: Use any of the available locators (id, name, xpath etc) to identify/select the select box element. 2. Create an instance of Select class: Instantiate a new object of Select class by passing WebElement as parameter. 3. Select option by Visible Text or Value or Index : Use one of these three methods provided by Select Class: .selectByVisibleText() - selects an option based on its text displayed .selectByValue()- selects an option based on its value attribute .selectByIndex()- selects an option based on index starting with zero 4. Deselecting Option(s): If required deselect selected options individually or all at once Example: import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.support.ui.Select; public class DropDownExample { public static void main(String[] args) { // Initialize Chrome driver WebDriver driver = new ChromeDriver(); // Navigate to URL driver.get("https://example.com"); try{ // Step 1 : Locating select Element WebElement selectElement=driver.findElement(By.id("dropdownId")); // Step 2 : Creating object of Select Class and pass webElement as argument Select select=new Select(selectElement); // Step 3 : Selection Based On Visible Text select.selectByVisibleText("Option Text"); // Or alternatively selection Based On Value Attribute select.selectByValue("Option Value"); // Or alternatively selection Based On Index select.selectByIndex(2); // Step 4 : Deselecting Individual Option(s) select.deselectByVisibleText("Option Text"); // Step 5: Deselect All Selected Options select.deselectAll(); } catch(Exception e){ System.out.println(e.getMessage()); } // Close the browser driver.quit(); } } |
19. Why do you need action element? | In Java Selenium, an "Action" element is used to perform complex user interactions such as hover over, drag and drop, click-and-hold etc. |
20. Have you handled multiple windows in selenium? | 1. Get current window handle: Use the driver.getWindowHandle() 2. Get all window handles: Use the driver.getWindowHandles() 3. Switch to another window: driver.switchTo().window(handle) 4. Perform required operations on new child tab/window 5. Close new child tab/window and switch back to original parent/main page Example: import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class MultipleWindowsExample { public static void main(String[] args) { // Initialize Chrome driver WebDriver driver = new ChromeDriver(); // Navigate to main URL driver.get("https://example.com"); try{ // Step 1 : Getting Current Window Handle String mainWindow=driver.getWindowHandle(); // Step 2 : Opening New Tab/Window (child) WebElement linkElement=driver.findElement(By.linkText("Click Here")); linkElement.click(); // Step 3 : Looping Through All Opened Windows/Tabs And Switching To Each One By One Set<String> setOfWindows = driver.getWindowHandles(); Iterator<String> iterator=setOfWindows.iterator(); while(iterator.hasNext()){ String childWindow=iterator.next(); if(!mainWindow.equals(childWindow)){ driver.switchTo().window(childWindow); // Step 4 : Performing Required Actions Inside New Tab/Window WebElement inputField = driver.findElement(By.xpath("//input[@id='username']")); inputField.sendKeys("TestUsername"); // Step 5 : Closing Child Window And Switching Back To Parent/Main Page driver.close(); driver.switchTo().window(mainWindow); } } } catch(Exception e){ System.out.println(e.getMessage()); } // Close the browser driver.quit(); } } |
21. Describe me how you automated the login? | |
Java | |
Questions | Answers |
1. Your input is tomorrow. You need to count each letter in ascending order. Describe the logic. | |
2. How to get System date and time? | //Java import java.time.LocalDateTime; public class DateTimeExample { public static void main(String[] args) { // Get the current date and time LocalDateTime now = LocalDateTime.now(); System.out.println("Current Date and Time: " + now); } } //Python import datetime now = datetime.datetime.now() print("Current Date and Time:", now) |
3. How you can convert string "HELLO" into string "hello"? | //Java String input = "HELLO"; String output = input.toLowerCase(); System.out.println(output); //Python input = "HELLO" output = input.lower() print(output) |
4. Can you write your code for palindrome? | """ A palindrome is a word that reads the same in reverse. For example: radar is a palindrome, radix is not a palindrome. """ public class PalindromeChecker { public static boolean isPalindrome(String s) { return s.equals(new StringBuilder(s).reverse().toString()); } public static void main(String[] args) { String str = "radar"; if (isPalindrome(str)) { System.out.println(str + " is a palindrome"); } else { System.out.println(str + " is not a palindrome"); } } } |
5. Write a program/code for printing the prime numbers. | """ A prime number is a number that is divisible by only two numbers: 1 and itself. So, if any number is divisible by any other number, it is not a prime number. """ public class Main { public static void main(String[] args) { int num = 29; boolean flag = false; for (int i = 2; i <= num / 2; ++i) { if (num % i == 0) { flag = true; break; } } if (!flag) System.out.println(num + " is a prime number."); else System.out.println(num + " is not a prime number."); } } |
6. Write a program/code for factorial. | """ when user enters a number, its factorial is displayed """ import java.util.Scanner; public class FactorialCalculator { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print("Input your number: "); int number = sc.nextInt(); int result = 1; if (number != 0) { for (int i=1; i<=number; i++) { result *= i; } } System.out.printf("The factorial of %d is %d", number, result); } } |
8. I'm giving you one array consisting of numbers. You need to add it in ascending order. sort it without using any in-built function. | |
9. Write a code for fibonacci. | """ In fibonacci series, next number is the sum of previous two numbers for example 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 etc. The first two numbers of fibonacci series are 0 and 1. """ public class Main{ public static void main(String args[]) { int n1=0,n2=1,n3,i,count=10; System.out.print(n1 +" "+ n2);//printing 0 and 1 for(i=2;i<count;++i)//loop starts from 2 because 0 and 1 are already printed { n3=n1+n2; System.out.print(" "+n3); n1=n2; n2=n3; } } } |
10. Write a code for leap year. | """ user will see the year is a leap year or not a leap year """ import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print("Input your year: "); int year = sc.nextInt(); if (year % 4 == 0) { if (year % 100 == 0) { if (year % 400 == 0) { System.out.printf("%d is a leap year", year); } else { System.out.printf("%d is not a leap year", year); } } else { System.out.printf("%d is a leap year", year); } } else{ System.out.printf("%d is not a leap year", year); } } } |
9. SQL JMeter
JIRA | |
Questions | Answers |
1. What is JIRA? | JIRA is an issue tracking and project management software. |
2. What is the purpose of JIRA? | The purpose of JIRA is to help software teams plan, track, and manage their development projects. It provides tools to help teams organize, prioritize, and manage their work. |
3. What is Epic, User Story, Backlog? | Epic is a large body of work that can be broken down into smaller stories, issues, and tasks. User Story is a task that describes a specific feature or functionality that a user should be able to do. Backlog is a list of all the tasks and issues. |
4. What are the settings/properties you use to connect JIRA and GitHub? | To connect JIRA and GitHub, I need to create new integration in JIRA. Going to Settings > Integrations and clicking on the "Add New Integration" button. Then, select "GitHub" from the list of integrations. Then it will prompt enter your GitHub credentials. Once you have entered your credentials, I need to select the repositories that you want to integrate with JIRA. |
JENKINS | |
Questions | Answers |
1. What is Jenkins? | Jenkins is an open-source automation server that automates the repetitive tasks involved in software development and deployment. It is designed to help developers, testers, and operations teams to build, test, and deploy applications continuously. |
2. What is Continuous Integration? | Continuous Integration (CI) is a software development practice in which developers regularly merge their code changes into a shared repository. |
3. What are the benefits of using Jenkins? | 1. Automates repetitive tasks: Jenkins can be used to automate the process of building, testing, and deploying software. This helps to improve the speed and accuracy of the software development process. 2. Integrates with DevOps tools: Jenkins integrates with a wide range of DevOps tools, such as Docker, Puppet, and Chef. This makes it easy to manage the entire DevOps process, from development to deployment. 3. Easy to use: Jenkins has a user-friendly, graphical interface that makes it easy to set up and manage. It also supports a wide range of plugins, which makes it even easier to customize for specific projects or tasks. |
4. In Jenkins, how can I run only 2 test cases except other test cases? | "-t" option. Jenkins -t TestCase1.java, TestCase2.java |
5. Can you explain how you create a job and schedule it particular time in Jenkins? | Yes, sure! Here's a step-by-step guide on how to create a job and schedule it for a particular time in Jenkins: 1. Login to Jenkins. 2. Select the "Project". 4. Configure your job. 5. "Build Triggers" section and select the "Build periodically" checkbox. 6. For example, if you want your job to run at 3:00 AM every day, you would enter "0 3 * * *" in the Schedule field. 7. Click the "Save" button to save your job and schedule it for the specified time. That's it! |
6. As a QA, what do you do with Jenkins? | 1. Running automated tests. 2. Monitoring the quality of software if there any test cases fail. 3. I make a bug issue in Jira if there are any defects. |
10. Git
11. UNIX Command
12. After Interview
dfdf
fd
d
- Get link
- X
- Other Apps
Comments
Post a Comment