Why to Use Protractor for E2E Testing of AngularJS Applications instead of Selenium?

  

  


Why to Use Protractor for E2E Testing of AngularJS Applications instead of Selenium?

  • Protractor is automation framework or tool for AngularJS is rapidly gaining momentum as it can quickly launch applications by extending the functionality of HTML.
  • Protractor is a Node.js program that supports test frameworks like Jasmine, Mocha, and Cucumber
  • The following are some of the features of Protractor that make it worthy for testing AngularJS applications.
    • Protractor is a wrapper around WebDriverJS and supports behavior-driven development frameworks.
    • It offers some new locator strategies and functions that automate the testing of AngularJS applications. 
    • It makes use of Selenium grid to run multiple browsers at once.


  • Advantages of Protractor: -
    • No need to add waits and sleeps.
    • Page Object: It is easy to set up page objects. Protractor does not perform WebDriver commands till an action is needed, i.e., set up page objects so that tests can operate page elements without moving the HTML.
    • Angular-specific locator support: Protractor supports Angular-specific locator strategies including binding, model, repeater.
    • Protractor acts as an end-to-end testing framework for both Angular and non-Angular applications.






What are bin & src folders in Java Automation Framework.

 

  


What are bin & src folders in Java Automation Framework.

  • 'bin' and 'src' are not exclusive to Test automation.

  • These are generic Java folders created to segregate the written-code and the compiled-code.
    • src: Folder where our written code resides. Human readable code files.
    • bin: Folder where the compiled files reside, that the Java Virtual Machine (JVM) executes.. E.g. .class, .jar etc. 

  • In simple words: Developer/Testers , i.e. .Java files >> These .Java files are stored in src folder >> Compile the code >> Java code is converted to Byte-code which can be read by JVM, i.e. .class files stored in bin folder.

  • Please let me know if you want any specific json file to be handled in the python.






Selenium Interview questions -Page 2

 1.What is xpath and it's types?

2.What is cross browser testing and parallel testing?

3.Challenges faced during selenium testing?
4.What is Actions class?
5.How to handle drop down in selenium?
6.How to handle multiple browser pop up?
7.How to handle multiple browser tabs in selenium?
8.How to perform upload file using selenium?
9.How to perform download file using selenium?
10.How to get all values of dropdown in selenium?
11.How to perform (control + a) through selenium?
12.How to shift between tabs of a same browser using selenium?
13.What is Robot class?
14.What is AutoIT?
15.What are the difference between get() and navigate()?
16.What are the difference between findElement() and findElements()?
17.What is difference between quit() and close()?
18.What are different locators used?
19.Difference between xpath and cssSelector?
20.Different approaches to click the submit button?
21.What is javascriptExecutor and when it is used?
22.Handling WebTable(static and dynamic) in selenium
23.What is POM? Advantage and its disadvantage?
24.What is maven? list its phases or life cycle?Command to run our project thro maven?
25.Explain ur project folder structure? Or Explain ur frame work?
26.What is testng?
27.How to create and delete cookies?
28.What does getwindowhandles() and getwindowhandle() return? Or its differences?
29.Is it possible to use only perform() without build()? 30.What is perform() and build()?
31.How to scroll the browser window?
32. Preceding sibling and following sibling of custom xpath?
33.What is test management tool used in ur project?
34.What is the build automation tool used in ur project?
35.How u will handle the SSL certification?
Or what is DesiredCapabilities?
36.How to verify 'Bangalore' present in dropdown box or not?
37.How to verify 'Bangalore' present in 4×4 webtable? And print the column and row number of it is present?
38.How to fetch the data from particular row and column of excel?
39.List all maven plugins like surefire plugin etc
40.What is jenkins?And explain its use?
41.Explain the tags present in testng.xml file
42.What is TDD?
43.What is BDD? Explain cucumber framework?What is gherkins?
44.What is Listener?
45.What is DataProvider?
46.What is parameterization?
47.What is PageFactory?
48.What is apache POI API? Or how to read data from excel?
49.What is explicit and implicit waits?
50.What are the challenges faced in automation testing?
51.Write code for handling multiple browsers and switch to new windows?
52.What is webdriver?And why webdriver is used?
53.List some selenium exceptions
54.What is StaleElementReferenceException?When this occurs?And how to overcome such exception?
55.How do you group the test cases? And why?
56.How to include or exclude test cases?
57.What is NullPointerException?When it occurs?
58.What is selenium grid?
59.Should have knowledge on all testng annotations.
60.How do you control the execution of your test cases/test classes?
61.Git and its commands
62.Maven commands to execute,debug,compile
63.What is the current version of maven used?
64.How to identify broken links?How you have done in your project?Write code or tell approach.
65.Write a code to fetch the value 'Test' from excel sheet which might be present in any cell in excel. Or check whether value 'Test' is present in excel or not.
66.How to pass values to textbox other than using sendKeys()?
67.How to click login button other than using click(), submit() and JavascriptExecutor?
68.What is subversion?

Read Json File using python

   


Code to Read Json File using python

    •  readJsonfiles(fileName):
          file =path.abspath("tempproject/tests/test_data/" + jsonfileName".json")
          with open(file,mode='r',encoding='utf-8'as f:
              file_content = str(f.read())
          return json.loads(file_content)
    • Explanation as below
     file =path.abspath("tempproject/tests/test_data/" + fileName + ".json")

    In this example we are reading the json files, in first line we are creating a file variable which holds the reference of the file using absolute path


    with open(file,mode='r',encoding='utf-8'as f:

    we are setting up the permission for the file like r stands for read and in same way w stands for write


    file_content = str(f.read())
    we are reading the file


    json.loads(file_content)

    Json .loads function is use to parse the json string






    Python Interview questions for SDET

      


    Python Interview questions for SDET 

      • What is yield Keyword in python 
        • yield is a keyword in Python that is used to return from a function without destroying the states of its local variable and when the function is called, the execution starts from the last yield statement. Any function that contains a yield keyword is termed as generator. Hence, yield is what makes a generator
      • What are Idempotent Methods
        • The term idempotent is used more comprehensively to describe an operation that will produce the same results if executed once or multiple times. In HTTP specification, The methods GET, HEAD, PUT and DELETE are declared idempotent methods. Other methods OPTIONS and TRACE SHOULD NOT have side effects, so both are also inherently idempotent.

      COMMON HTTP REQUEST METHODS AND USES

         


      COMMON HTTP REQUEST METHODS AND USES

        • HTTP defines a set of request methods to indicate the desired action to be performed.

          • GET: retrieve data.
          • HEAD: identical to GET request, but without the response body.
          • POST: submit an entity to the specified resource.
          • PUT: modify data with the request payload.
          • DELETE: delete the specified resource.
          • CONNECT: establish a network connection to a web server.
          • OPTIONS: find out the HTTP methods and other options supported.
          • TRACE: performs a message loop-back test.
          • PATCH: apply partial modifications to a resource.

        Performance Testing Interview questions

         . What is Performance Testing?

        2. Why we need of Performance Testing?

        3. Detail about the projects you done.

        4. What is Thread Group?

        5. What is Samplers?

        6. What is Regular Expression

        7. Meaning (.+?) / (.*?) -

        8. What is Beanshell PreProcessor and PostProcessor?

        9. Why we need to use it?

        10. What is the Execution Order of JMeter script?

        11. How do you identify the performance testing requirements?

        12. What are the objectives of Performance Testing Test Plan?

        13. Types of timers in JMeter?

        14. Which tool are you using and why for performance testing?

        15. Do you have any knowledge on other performance testing tools like Loadrunner, NeoLoad?

        16. What is ThinkTime, Why we need to use it?

        17. Types of Assertions

        18. Types of Listeners

        19. Distributed Load Testing (Remote Testing) -

        20. Why use Non GUI mode to run the script?

        21. Command to run jmeter script from non gui mode.

        22. Types of Performance Testing-

        23. Load Testing

        24. Stress Testing

        25. Endurance Testing

        26. Spike Testing

        27. What is Synchronizing Timer and how it is works?

        28. Activities perform during performance testing?

        29. Parameterization.

        30. Correlation

        31. Blazemeter

        32. Do you have any idea about 3rd party monitoring tools like NewRelic and AppDynamics?

        33. Performance Tunning -

        34. How to check server side logs

        35. What are the parameters to check the performance of application after running your jmeter script?

        36. What is Latency?

        37. What is response time?

        38. How to create HTML report from .jtl file?

        39. How to reduce unwanted requests while recording the script from the JMeter?

        40. What is workload Modeling?

        41. What is Performance Analysis?

        42. Types of Thread Groups?

        43. How you are showing the Performance Testing Analysis Report to your client in your current project?

        44. How will you start the requirement gathering for performance testing if we didn't get it from client?

        45. How many projects have you done?

        46. How many max no of users load have you given in your projects?

        47. What are the challenges / problems have you faced in your project?

        48. Have you integrated JMeter script with Jenkins?

        49. Unix commands

        50. SQL