Navigation

    SOFTWARE TESTING

    • Register
    • Login
    • Search
    • Job Openings
    • Freelance Jobs
    • Services
    • Conferences
    • Courses
    1. Home
    2. magpie
    M
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    magpie

    @magpie

    QA Engineer

    3
    Reputation
    9
    Posts
    1
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    magpie Follow
    QA Engineer

    Best posts made by magpie

    • RE: Asp.net core authorization check in tests

      In order to check that the page is available under a non-logged in user, it is enough to make sure that the response code will be 2xx:

      [TestFixture]
      public class HomeControllerTest
      {
          public HomeControllerTest ()
          {
              this._factory = new CustomWebApplicationFactory <Startup> ();
          }
      
          private readonly WebApplicationFactory <Startup> _factory;
      
          [Test]
          public async Task IndexPage_ForNonLoggedUser_ReturnsPageContent ()
          {
              // Arrange
              var client = this._factory.CreateClient ();
      
              // Act
              var response = await client.GetAsync ("/");
      
              // Assert
              response.EnsureSuccessStatusCode (); // Status Code 200-299
          }
      }
      

      But checking that the page is available under an authorized user is more complicated: you need to turn off automatic redirection in the client and check that we are redirected to the authorization page.

      [Test]
      public async Task AboutPage_ForNonLoggedUser_RedirectsToLoginPages ()
      {
          // Arrange
          var client = this._factory.CreateClient (
              new WebApplicationFactoryClientOptions
              {
                  AllowAutoRedirect = false
              });
      
          // Act
          var response = await client.GetAsync ("/ Home / About");
      
          // Assert
          Assert.AreEqual (HttpStatusCode.Redirect, response.StatusCode);
          StringAssert.StartsWith ("http: // localhost / Identity / Account / Login", response.Headers.Location.OriginalString);
      }
      

      (I saw examples on the net in which the 403 response was checked, maybe this worked for earlier versions of asp.net core, I just need a redirect check on 2.1)

      Exactly the same tests are required for Razor Page, they are nothing different from similar checks.

      Basically, there is a detailed description in the documentation, and there is also a link to a test application with xUnit.

      posted in Automated Testing
      M
      magpie
    • Correct way to check server response data (pytest)

      Hello! What is the best way to check the values ​​of a dictionary?

      I wrote a test on pytest in which I send a request to the api with a certain set of data and in response I get a dictionary of something like this:

      {'user': '1', 'objects': [{' id ':' 1 ',' event ': [{' type ':' something ',' timestamp ':' 1522991335319 '}]}],' reached ': True}
      

      The value of the keys user, id, type and reached will have to match the values ​​that I sent in the request, the value of the timestamp key is not interesting to me.

      If you check the value directly through assert, then checking objects with deeper nesting, for example type, does not look very good in the code:

      assert response ["objects"] [0] ["event"] [0] ["type"] == "something"
      

      How can you check the values ​​of such a response more efficiently?

      posted in API Testing
      M
      magpie

    Latest posts made by magpie

    • RE: JMeter test script is getting struck while running the script in GUI and Non GUI mode

      Your "getting struck" doesn't tell anything to us, you need to supply more troubleshooting information like:

      .jtl results file

      JMeter log file

      Thread dump which can be taken from JMeter GUI or using jstack

      c12bb8e7-3f1c-49ca-b024-85178bca3afb-image.png

      For the time being I can give only a generic piece of advice: by default JMeter's HTTP Request samplers don't have any connect/response timeouts defined so it's up to underlying JVM and/or operating system when to close the connection so make sure to provide reasonable timeout values, the setting lives at "Advanced" tab of the HTTP Request sampler (or better use HTTP Request Defaults so the setting will be propagated to all HTTP Request samplers so you won't have to change it for each sampler individually)

      8f359dfc-d08f-4087-aa27-eba4099e05dd-image.png

      posted in Performance
      M
      magpie
    • Modify InnerHTML of a site using Selenium Python

      I want to modify the innerHTML, i have the following html code

      HTML = """
      4 Methods to Make Bitcoin for Totally free?
      
      
      <img src=" https://topcryptofaucets.com/img/logo.png" alt="" width="450" height="250" />
      
      know more|for more information}.</p>
      
      <p>1: Try Taps</p>
      
      <p>Faucets are the simplest way associated with earning Bitcoin on the internet. Since it demands no deep understanding of crypto currencies, you will get started without any kind of worries. All a person need to do is have the valid email deal with and some time for you to invest.</p>
      
      <p>The Method:</p>
      
      <p>own your current rewards and increasing your balance.</p>
      
      <p>two: Check out Paid-to-Click Internet sites</p>
      
      associated with the revenue goes into the pockets of the people who view these ads.</p>
      
      <p>3: Enjoy Browser Games</p>
      
      <p>If you are a gamer and spend hours playing your preferred games online, you should earn money coming from this activity. Several browser-based games permit you to generate money in Bitcoin while playing and having fun.</p>
      
      <p>Even though it's not the boring activity like watching videos or perhaps ads, the rewards will be typically the same. So, a person should have a look at this method as properly.</p>
      
      <p>4: Get Involved in Mining</p>
      
      <p>Should you be interested in mining, there is a good possibility which you didn't put in enough work. Since a lot of people don't recommend mining regarding earning crypto foreign currency anymore, be sure you acquire a rig 1st. Second, you should be prepared to pay high-energy bills. But the method we intend to talk about will be quite basic low-cost. In fact, you don't have to spend a dime. The majority of miners usually are scammers. Therefore, an individual should try this technique.</p>
      
      A few check out more details about upon <a href=" https://topcryptofaucets.com"> bitcoin faucets</a>
      """
      
      posted in Automated Testing
      M
      magpie
    • Is there a way to search the “data-ftjson” of an HTML element using Selenium for Python?

      I am trying to find a button on a website that will change based on the date. The button will always have the "newreq = yes" identifier present in the "data-ftjson" portion of its element. I need a way to check for this element and then click the button. The screenshot below shows the HTML element of said button. I am using the Selenium WebDriver in Python. Any help would be greatly appreciated.

      cdad91ff-7b28-4b28-a467-052f0be62daf-image.png

      posted in Automated Testing
      M
      magpie
    • RE: How to track response time of saving, submitting, editing, deleting forms in an application?

      Break the different types of activities "submitting/ saving any form or uploading/ deleting document and editing forms" into separate transaction types and pick one of them to start with. The goal will be to Use JMeter to reproduce that activity in isolation. You may need to manually create a script or possibly use the JMeter proxy recorder to create a script.

      You will also need to plan how you want to control the data side. For example, run the test with a simple data case and check response times. Then run the same test with a more complex data case.

      Follow this process for each of the different transaction types in isolation. Going through this process will put you in a nice place to begin finding where the slowdown is happening.

      posted in Performance
      M
      magpie
    • RE: Is your QA Team effective?

      I believe our QA team is effective. But, we don't employ testers, we employ QA Analysts who:

      • Write their own test cases, utilizing the Business Requirements and Technical Design documents provided for the project. QA is involved as early in the development cycle as possible.

      • Have intimate knowledge of the business.

      • Know the difference between unit testing, functional testing, systems integration testing, regression testing, etc. In other words, they've put effort into studying QA methodologies.

      • Regularly perform regression testing on the system. This ensures that new projects have not introduced errors in working code.

      • Have the respect of the development team, along with salaries which are comparable to development salaries. Because QA has the respect of the development team, developers are quick to ask QA for opinions on some code changes, especially because QA has a better general knowledge of the business overall than a particular developer, who is almost always specialized in a certain area.

      A QA team composed of a group of manual testers who use developer-provided test cases and do not have a grasp of QA methodology or the business domain may not be as effective.

      posted in General Discussion
      M
      magpie
    • Correct way to check server response data (pytest)

      Hello! What is the best way to check the values ​​of a dictionary?

      I wrote a test on pytest in which I send a request to the api with a certain set of data and in response I get a dictionary of something like this:

      {'user': '1', 'objects': [{' id ':' 1 ',' event ': [{' type ':' something ',' timestamp ':' 1522991335319 '}]}],' reached ': True}
      

      The value of the keys user, id, type and reached will have to match the values ​​that I sent in the request, the value of the timestamp key is not interesting to me.

      If you check the value directly through assert, then checking objects with deeper nesting, for example type, does not look very good in the code:

      assert response ["objects"] [0] ["event"] [0] ["type"] == "something"
      

      How can you check the values ​​of such a response more efficiently?

      posted in API Testing
      M
      magpie
    • RE: Asp.net core authorization check in tests

      In order to check that the page is available under a non-logged in user, it is enough to make sure that the response code will be 2xx:

      [TestFixture]
      public class HomeControllerTest
      {
          public HomeControllerTest ()
          {
              this._factory = new CustomWebApplicationFactory <Startup> ();
          }
      
          private readonly WebApplicationFactory <Startup> _factory;
      
          [Test]
          public async Task IndexPage_ForNonLoggedUser_ReturnsPageContent ()
          {
              // Arrange
              var client = this._factory.CreateClient ();
      
              // Act
              var response = await client.GetAsync ("/");
      
              // Assert
              response.EnsureSuccessStatusCode (); // Status Code 200-299
          }
      }
      

      But checking that the page is available under an authorized user is more complicated: you need to turn off automatic redirection in the client and check that we are redirected to the authorization page.

      [Test]
      public async Task AboutPage_ForNonLoggedUser_RedirectsToLoginPages ()
      {
          // Arrange
          var client = this._factory.CreateClient (
              new WebApplicationFactoryClientOptions
              {
                  AllowAutoRedirect = false
              });
      
          // Act
          var response = await client.GetAsync ("/ Home / About");
      
          // Assert
          Assert.AreEqual (HttpStatusCode.Redirect, response.StatusCode);
          StringAssert.StartsWith ("http: // localhost / Identity / Account / Login", response.Headers.Location.OriginalString);
      }
      

      (I saw examples on the net in which the 403 response was checked, maybe this worked for earlier versions of asp.net core, I just need a redirect check on 2.1)

      Exactly the same tests are required for Razor Page, they are nothing different from similar checks.

      Basically, there is a detailed description in the documentation, and there is also a link to a test application with xUnit.

      posted in Automated Testing
      M
      magpie
    • RE: What should I learn to become a Test Automation Engineer?

      I can say you about web automation. You need to know at least one of the programming languages that is widely used for automation (java, python, c#, javascript), xpath, css selectors, also you need to study Selenium WebDriver framework that contains quite a lot of functions for manipulating of web-elements on the web page, BDD TDD development approaches, development patterns, SQL queries, API requests (http protocol)

      posted in Automated Testing
      M
      magpie
    • RE: Browsers for cross browser testing?

      You should investigate and analyse the statistic about your customers browsers. After analyzing you will see for example the following: 80% of customers use Chrome, 15% Firefox Mozilla and 5% Internet Explorer.

      So you should make the effort to test only the browsers used by your customers and look at percentages of using for each browser. Time on testing should be spent accordingly

      posted in Manual Testing
      M
      magpie