How to use Puppeteer Framework in aiTest

Language

  • JavaScript
Automation Framework
  • Puppeteer

How Puppeteer Framework is going to be used in aiTest

By supporting the Puppeteer Framework within aiTest, you can expand its capabilities and offer a more comprehensive testing solution. This integration enables efficient Multi-Browser Testing, Load Testing, and Stress Testing.

  1. Sign up using your E-mail or Google account.
  2. Once you have reached the URL Test dashboard, navigate to the left-side menu and select the Multi-Browser Test.
  3. Hit the Create Test button.
  4. Configure your test:
    • Name the testrun: Give the name of testrun whatever you want or which is related to your application, So that it will be easy to get that particular testrun details whenever you want. i.e. test-example.com, test-demo.com, etc.
    • Project: Select a project in which you want to run your test or you can create a project by clicking on the red colored plus sign(+) button.
    • Testrun Description: Write some testrun description to make your testrun more informative.
    • AUT URL: Application Under Test URL. e.g. https://example.com
    • Now here you can choose Repo Details or Your Automation Code.
    • Repo Details: Provide the repo details User’s Git Repository URL, User’s Git Username, User’s Git Token or Password, Report File Location and Testrun Command.
    • Your Automation Code: If you select “Your Automation Code” in the previous step, you will need to upload your automation code in a zip file.
    • Testrun Command: Write testrun Command to Run your testrun Testcases npm run.
    • Report Location: Write Report Location to Stored your testrun Testcases Report Files Report/Test_Report.html, Report/Test_Report.json and Report/Test_Report.xml
  5. Select Browsers: At the end select the browser on which you want to run your test. Currently, we have 3 browsers such as, Google Chrome, Mozilla Firefox and Microsoft Edge with their different browser versions.
  6. Once you are done with the above steps you can do either of the following:
    • Run It Now: Immediately run the automation code to test the browser compatibility of your apps with across browsers and versions.
    • Save: Save the configuration for later run as draft testrun.
    • Cancel: Reset and go back to previous page.
    • Update: Update the configurations of the test and run new.
AUT code and can be accessed in aiTest through
  • GIT
  • .zip file

Code Snippets for Reference

Use the code snippet provided below:

JavaScript

  
  const puppeteer = require("puppeteer"),
should = require("should");
let browser = null,
    page = null;
describe("marXeed", function (){
    this.timeout(60 *1000);
    before(async () => {
      //  browser = await puppeteer.launch({headless:false})
       browser = await puppeteer.launch({
       args: ['--no-sandbox', '--disable-setuid-sandbox'], headless:true
        });
        page = await browser.newPage();
        await page.setViewport({ width: 1280, height: 800 })
    });
    after(async () => {
    await browser.close()
 });


it("Should show Page title", async function() {
   await page.goto('https://app.dev.marxeed.com/home');
   this.timeout(60 * 1000);
   let title = await page.title();
   title.should.equal("marXeed");
   await page.screenshot({path: 'marxeedpage.png'});
   await page.pdf({path: 'marxeedpage.pdf', format: 'A4'});

});
it("Should show Trending Blogs Page title", async function() {
   await page.goto('https://app.dev.marxeed.com/home');
   this.timeout(60 * 1000);

   await page.type('#trendingBlogs > div > p');
   this.timeout(60 * 1000);
   await page.keyboard.type('#root > div > div.jss2.ps > div.jss3.Main_contentMT__35B-v > div > div > div > div > div > div:nth-child(1) > div > div:nth-child(1) > h4');
   this.timeout(60 * 1000);
   title.should.notequal("Trending Blogs");
   await page.screenshot({path: 'Trendingpage.png'});
   await page.pdf({path: 'Trendingpage.pdf', format: 'A4'});
});
 });
  

Questions Answered

  • How Puppeteer Framework is going to be used in aiTest?
×

Subscribe

The latest tutorials sent straight to your inbox.