Selenium Framework for Beginners 31 | What are Headless Browsers

Поделиться
HTML-код
  • Опубликовано: 8 янв 2025

Комментарии • 18

  • @rahulsharma-xk6db
    @rahulsharma-xk6db 6 лет назад +1

    Thanks sir. Apki help ke liye bahut bahut sukriya

  • @alinawaz4034
    @alinawaz4034 6 лет назад +2

    this is a very good video why you have so many less views. VERY VERY GOOD VIDEO!

    • @RaghavPal
      @RaghavPal  6 лет назад

      Thanks Ali, looks like it needs to be discovered yet by many people.:)

  • @ram-vv5bu
    @ram-vv5bu 3 года назад +1

    Hi please share the video for how to generate testng test result for headless browser testing

    • @RaghavPal
      @RaghavPal  3 года назад +1

      Hi Ram, I will check and plan on this

    • @ram-vv5bu
      @ram-vv5bu 3 года назад

      @@RaghavPalthank you.. in my local jenkins mail report send properly but in Linux jenkins server it's failed..

    • @RaghavPal
      @RaghavPal  3 года назад +1

      Okay, will need to check, the settings, path, software on linux

  • @augustmicota
    @augustmicota 5 лет назад +1

    I liked earlier audio with continuous transmission better, but still very informative video and whole course

  • @raghadraghad8433
    @raghadraghad8433 Год назад

    Hi I am automating printing feature using selenium Java I have to deal with printing preview of chrome. I use chromeOptions to set some settings for printing like Save as PDF select landscape
    I have one question I need to change paper size to A4 instead of letter that is the default but I don’t know the attribute to set, do you have an idea or have the documentation for print_preview_sticky_settings.appState ?
    I don’t know where to ask this question I will be happy if you could help.

    • @raghadraghad8433
      @raghadraghad8433 Год назад

      My chrome options as following:
      chromeOptions.setExperimentalOption("prefs", new java.util.HashMap() {{
      put("plugins.plugins_disabled", new String[]{"Chrome PDF Viewer"});
      put("printing.default_destination_selection_rules", "{\"kind\": \"local\", \"namePattern\": \"Save as PDF\"}");
      }],\"version\":2,\"isGcpPromoDismissed\":false,\"selectedDestinationId\":\"Save as PDF\"}");
      put("printing.print_preview_sticky_settings.appState", "{\"recentDestinations\": [{\"id\": \"Save as PDF\", \"origin\": \"local\", \"account\": \"\" }],\"version\":2,\"isHeaderFooterEnabled\": true,\"paperSize\": 'A4',\"isGcpPromoDismissed\":false,\"selectedDestinationId\":\"Save as PDF\"}");
      }});

    • @RaghavPal
      @RaghavPal  Год назад

      Raghad
      The `print_preview_sticky_settings.appState` Chrome option is used to control the sticky settings of the print preview dialog. The `appState` property is a JSON object that contains the following settings:
      ```
      "appState": {
      "recentDestinations": [{
      "id": "Save as PDF",
      "origin": "local",
      "account": ""
      }],
      "version": 2,
      "isHeaderFooterEnabled": true,
      "isGcpPromoDismissed": false,
      "selectedDestinationId": "Save as PDF"
      }
      ```
      To change the paper size to A4, you can set the `paperSize` property to `A4`. For example:
      ```
      "appState": {
      "recentDestinations": [{
      "id": "Save as PDF",
      "origin": "local",
      "account": ""
      }],
      "version": 2,
      "isHeaderFooterEnabled": true,
      "isGcpPromoDismissed": false,
      "selectedDestinationId": "Save as PDF",
      "paperSize": "A4"
      }
      ```
      Here is an example of how to set the chromeOptions to print to A4 PDF:
      ChromeOptions chromeOptions = new ChromeOptions();
      chromeOptions.addArguments("--kiosk-printing");
      chromeOptions.setExperimentalOption("prefs", new java.util.HashMap() {{
      put("plugins.plugins_disabled", new String[]{"Chrome PDF Viewer"});
      put("printing.default_destination_selection_rules", "{\"kind\": \"local\", \"namePattern\": \"Save as PDF\"}");
      put("printing.print_preview_sticky_settings.appState", "{\"recentDestinations\": [{\"id\": \"Save as PDF\", \"origin\": \"local\", \"account\": \"\" }],\"version\":2,\"isHeaderFooterEnabled\": true,\"paperSize\": 'A4',\"isGcpPromoDismissed\":false,\"selectedDestinationId\":\"Save as PDF\"}");
      }});
      Once you have set the chromeOptions, you can use them to create a new ChromeDriver instance:
      ```
      ChromeDriver driver = new ChromeDriver(chromeOptions);
      ```
      You can then use the driver to automate the printing process.

    • @raghadraghad8433
      @raghadraghad8433 Год назад

      @@RaghavPal Hi thanks for replaying, I take it copy paste but unfortunately still not take paper size, still shown with Letter default value, any suggestions?...

    • @raghadraghad8433
      @raghadraghad8433 Год назад

      @@RaghavPal Does it need a default selection_rules like destination?

    • @raghadraghad8433
      @raghadraghad8433 Год назад

      @@RaghavPal I found another way by using "mediaSize": {"height_microns": 355600, "width_microns": 215900} to set the dimensions and convert to microns, or inspect the dropdown that allows you to choose the paper-size, and then search for your desired size in the options, and copy/paste the values.
      But still not work :(

  • @Deniz-ss1sv
    @Deniz-ss1sv 3 года назад +1

    :)