How To Test Mobile & Desktop Browser? Playwright tutorial - Part 73

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ม.ค. 2025

ความคิดเห็น • 56

  • @henricksbrasil
    @henricksbrasil 2 ปีที่แล้ว +2

    Awesome video and channel. Subscribed.

    • @letcode
      @letcode  2 ปีที่แล้ว +1

      Thanks and welcome

  • @kylebradshaw5418
    @kylebradshaw5418 2 ปีที่แล้ว +2

    Great stuff 👏

  • @vikrantchaudhari7017
    @vikrantchaudhari7017 ปีที่แล้ว +2

    Nice video Koushik. How do we achieve the same mobile browser automation which you have shown in your this video using playwright cucumber type script? I have seen your videos on cucumber playwright, but you have not covered mobile browser automation. My project needs it. Can you please make a video on it. Please😢

    • @letcode
      @letcode  ปีที่แล้ว +1

      It will be simple, I'll try to make a video or I'll update the code in git

    • @vikrantchaudhari7017
      @vikrantchaudhari7017 ปีที่แล้ว

      Thanks @@letcode Koushik. I am eagerly waiting for your video. Thanks a lot

    • @vikrantchaudhari7017
      @vikrantchaudhari7017 ปีที่แล้ว +1

      @@letcode Hi Koushik. Any idea by when you will be able to make the video?

    • @letcode
      @letcode  ปีที่แล้ว

      Give me some time, I'm not able to make videos nowadays.

    • @shahwarfathima937
      @shahwarfathima937 ปีที่แล้ว

      @@letcode waiting for this update

  • @seenamathew6523
    @seenamathew6523 ปีที่แล้ว +1

    Hi @Koushik if i want to launch a desktop app with Playwright how should the projects configuration be?

    • @letcode
      @letcode  ปีที่แล้ว

      Only the electron window application is possible

    • @seenamathew6523
      @seenamathew6523 ปีที่แล้ว

      @@letcode it's an electron based desktop application, is it possible then?

    • @letcode
      @letcode  ปีที่แล้ว

      I'll try to make a video.

    • @seenamathew6523
      @seenamathew6523 ปีที่แล้ว +1

      @@letcode thank u Koushik. It would be of great help as I am blocked with this csenario

  • @mytest-sv1bp
    @mytest-sv1bp ปีที่แล้ว +2

    Hi very helpful video! Do you know if we can run test on real iOS mobile device browser by playwright?

    • @letcode
      @letcode  ปีที่แล้ว

      I have done for Android, i guess you can do it for iOS as well.
      Reference video. th-cam.com/video/Nte3PIffyYk/w-d-xo.html

    • @mytest-sv1bp
      @mytest-sv1bp ปีที่แล้ว +1

      @@letcode yes for android works, but not sure about iOS, do you know any references or guidelines for running test on physical iOS devices ? Thanks

    • @letcode
      @letcode  ปีที่แล้ว

      I think not possible, as there's no documentation.

  • @chandanav1290
    @chandanav1290 8 หลายเดือนก่อน +1

    Sir we are also working in our project Mobile/tap we have to click on hamburger option but the design is different from Desktop and locators also changing so we are wrighting support test cases, do u have any other idea? U would like to suggest

    • @letcode
      @letcode  8 หลายเดือนก่อน

      As I mentioned in this video, that should work fine right? R u facing any issue?

    • @chandanav1290
      @chandanav1290 8 หลายเดือนก่อน +1

      @@letcode Ya working now I figured it out, thanks for replying 😀

    • @letcode
      @letcode  8 หลายเดือนก่อน +1

      Super 👍

  • @zhangwill9595
    @zhangwill9595 ปีที่แล้ว +1

    Hi Koushik, I check your codes, but I do not see where you set isMobile to true, how come Playwright sets isMobile to true when testing on Pixel? Thanks

    • @letcode
      @letcode  ปีที่แล้ว

      It takes from the project configuration in the playwright.config.ts.

    • @zhangwill9595
      @zhangwill9595 ปีที่แล้ว

      @@letcode import { devices, PlaywrightTestConfig } from "@playwright/test";
      const config: PlaywrightTestConfig = {
      // workers: 4,
      // fullyParallel: true,
      // projects: [
      // {
      // name: 'chromium',
      // use: { ...devices['Desktop Chrome'] },
      // },
      // {
      // name: 'Pixel',
      // use: { ...devices['Pixel 5'] },
      // },
      // // {
      // // name: 'firefox',
      // // use: { ...devices['Desktop Firefox'] },
      // // },
      // // {
      // // name: 'webkit',
      // // use: { ...devices['Desktop Safari'] },
      // // },
      // ],
      use: {
      viewport: null,
      headless: !true,
      // browserName: "chromium",
      screenshot: "on",
      video: "on",
      // trace: "on",
      baseURL: "www.letcode.in",
      // baseURL: "dev107189.service-now.com/api/now/table/incident",
      extraHTTPHeaders: {
      "Authorization": "Basic YWRtaW46U0NxN2pDb2tDbFI4"
      }
      // baseURL: "letcode.in",
      // contextOptions: {
      // permissions: ["clipboard-read"]
      // }
      ,
      launchOptions: {
      args: ["--start-maximized"],
      // logger: {
      // // isEnabled: (name, severity) => true,
      // // log: (name, severity, message, args) => console.log(name, severity)
      // }
      }
      },
      // timeout: 60000,
      // grep: [new RegExp("@smoke"), new RegExp("@reg")],
      // testMatch: ["harDemo/trackRequest.test.ts"],
      retries: 0,
      // reporter: "./customReport/myReporter.ts"
      reporter: [
      ["dot"], // -> console
      ["json", { outputFile: "test-result.json" }], // -> JSON
      ['html', {
      open: "always"
      }] // -> HTML
      ],
      // globalTeardown: './helper/globalsetup.ts'
      }
      export default config;
      Sorry, I checked again carefully, but I still cannot find it, I could only see pixel and pixel 5 inside projects.

  • @gthjunior
    @gthjunior 2 ปีที่แล้ว +1

    What about creating two header classes where one is for mobile and the other for desktop? Couldn't we use an abstract class to have common methods and keep mobile/desktop methods in different classes. That seems cleaner than have if/else conditions in each method. Can you make that video? Maybe you already have it?

    • @letcode
      @letcode  2 ปีที่แล้ว

      Even though we have 2 classes we have to maintain 2 tests to use those methods right?

  • @ClearlyChrist
    @ClearlyChrist 2 ปีที่แล้ว +2

    Hey bruda, do you know if there is a way to re-create touch gestures in playwright? Like swipe, drag, tap, etc.

    • @letcode
      @letcode  2 ปีที่แล้ว

      No idea buddy

  • @ranselynigrel8714
    @ranselynigrel8714 7 หลายเดือนก่อน +1

    Hey Koushik
    I am getting isMob value as undefined even after doing configurations

    • @letcode
      @letcode  7 หลายเดือนก่อน

      Hi, have you set the project configuration with mobile like pixel or iPhone?

  • @ashaniranjan2974
    @ashaniranjan2974 2 ปีที่แล้ว +1

    Hey very helpful video!! thanks man!! wanted to know how to test in different browser versions or different OS!! if so which browser versions are supported by playwright. I checked in there official website but its ltl confusing!!!

    • @letcode
      @letcode  2 ปีที่แล้ว

      Playwright comes with browser engine like chromium, firefox and webkit (safari)
      Local browser can also be used what ever installed in your machine.
      Any OS that supports node js can be used.

  • @samsuthenakbarali1115
    @samsuthenakbarali1115 2 ปีที่แล้ว +2

    is the playwright supports native Andriod & iOS mobile app?

    • @letcode
      @letcode  2 ปีที่แล้ว +1

      No, only emulation

  • @jyothilakshminagaraja3057
    @jyothilakshminagaraja3057 ปีที่แล้ว +1

    How to test mobile web files and desktop files separately in playwright, basically i want to pic only desktop files when view port is desktop, vise-versa

    • @letcode
      @letcode  ปีที่แล้ว

      If both are different test files then you can have different directories, and within the project you can specify that directory.

    • @jyothilakshminagaraja3057
      @jyothilakshminagaraja3057 ปีที่แล้ว

      @@letcode in case if we have n number of desktop tests and mobile, how to segregate it

  • @aliadnan38
    @aliadnan38 ปีที่แล้ว +1

    Hey @Koushik, great stuff as always. Just wondering what is your take on following scenario.
    "Two users are joining a call, one from mobile browser(default) and other one from desktop edge browser"
    Is it possible to achieve this in automation especially in Playwright where your test would basically invoke two different browsers during the time of the test execution. Off-course this is doable if you are executing this scenario on a single browser i.e both callers are joining from same browser but I was thinking if we can join each of the caller from different browser.
    Any lead would be helpful
    Thanks,

    • @letcode
      @letcode  ปีที่แล้ว

      Hi, yes it is possible, you can use the browser context to achieve this.

  • @emnaben-nahia1793
    @emnaben-nahia1793 2 ปีที่แล้ว +1

    Hello, thanks for the video, you know how to run mobile view with cucumber JS please? thanks

    • @letcode
      @letcode  2 ปีที่แล้ว +1

      Hi,
      From the hooks you can set in the browser context.

    • @emnaben-nahia1793
      @emnaben-nahia1793 2 ปีที่แล้ว

      @@letcode thanks, you have an example of such configuration please?

  • @shridevimoole249
    @shridevimoole249 2 ปีที่แล้ว +1

    Hi , I tried using webkit for applepay automation, and did not work, because Applepay only works for Safari browser, is there a way we could use Safari browser in automation with playwright?

    • @letcode
      @letcode  2 ปีที่แล้ว

      Not directly , but i guess you can use the grid concept to execute in safari.

    • @shridevimoole249
      @shridevimoole249 2 ปีที่แล้ว +1

      @@letcode Thank you, Is there any like which I can refer to?

    • @letcode
      @letcode  2 ปีที่แล้ว

      @@shridevimoole249 you can refer to this video
      th-cam.com/video/Mb-bkyGK9Ss/w-d-xo.html

  • @varsharani849
    @varsharani849 2 ปีที่แล้ว

    How to automate footer links like in a column more than 10 link so how to perform click one by one plz tell me

    • @varsharani849
      @varsharani849 2 ปีที่แล้ว +1

      Sir i need this one plz help me

    • @letcode
      @letcode  2 ปีที่แล้ว

      Join our discord and share the screenshot then i might help.
      hey join me on Discord! Invite expires in 7 days. discord.gg/EEzXmcMT

  • @putrinadiyah4746
    @putrinadiyah4746 2 ปีที่แล้ว +1

    maybe next video can you explain using js? thx u

    • @letcode
      @letcode  2 ปีที่แล้ว

      There is no difference in js and ts, both same only.

  • @varsharani849
    @varsharani849 2 ปีที่แล้ว +1

    Hello sir i have a doubt