#5 - How to extract Network Responses and status codes with Selenium Listeners Implementation

Поділитися
Вставка
  • Опубліковано 15 жов 2024
  • In this video, I have explained how to extract Network responses,headers and status codes with Selenium for better Integration testing.
    Please check out Selenium 4 Latest Features Playlist to watch all the concepts in sequence
    Get Lifetime access to all 30+ Automation courses with one single Subscription from below link.
    rahulshettyaca...
    *****************************************************************************
    Thanks
    Rahul Shetty - QA Trainer/entrepreneur
    Website : rahulshettyaca...
    LinkedIn : / rahul-she. .
    FB QA Group : / rahul. .
    Telegram Group for Interview Prep
    t.me/rahulshet...

КОМЕНТАРІ • 30

  • @mohamedilyas8610
    @mohamedilyas8610 9 місяців тому

    Very useful. Thanks for sharing. Will it work for Post call as well? need to get response after clicking final button in the UI

  • @santoshchoudhury852
    @santoshchoudhury852 Рік тому

    Great content....but where we need to add this in a bdd framework?

  • @harshakumarnomula6648
    @harshakumarnomula6648 Рік тому

    Hi sir,
    How can i get preview of that request

  • @eaglesight143
    @eaglesight143 3 роки тому

    Hi .can you please let me know What is the java version you have used for this .

  • @atulmojar221
    @atulmojar221 2 роки тому

    Is there any video of python selenium for same issue.?

  • @mohammadmhaidat8752
    @mohammadmhaidat8752 3 роки тому

    Great, can you access the actual response date like error message returned from the back-end

  • @nguyenhonggiang5796
    @nguyenhonggiang5796 2 роки тому

    Hello, I want to get the size out, how do I do that?

  • @TarekFaham
    @TarekFaham 2 роки тому

    Can you do the same using poweshell and selenium webdriver DLL?

  • @davidtalturejman9185
    @davidtalturejman9185 Рік тому

    Thank you so much!

  • @WaqasAhmad-tq8pz
    @WaqasAhmad-tq8pz 2 роки тому +2

    Hi,
    I am trying to add "DevTools devtools = driver.getDevTools(). But it is giving me an error. I tried to import different devtools library version but not working

    • @HenryLeu
      @HenryLeu 2 роки тому +1

      same with me. Did you find out the solution?

    • @filipkostic6580
      @filipkostic6580 Рік тому

      @@HenryLeu Did you find solution?

    • @HenryLeu
      @HenryLeu Рік тому +1

      @@filipkostic6580 I only found a 3rd Java library that someone else wrote.

  • @HenryLeu
    @HenryLeu 2 роки тому

    your tititle says extract network response. But I don't see how you extract the reponse body? I want to extract the response body from the network tab under "response" section. How do I do that?

    • @mrp5249
      @mrp5249 2 роки тому +1

      Hey did you get that? Even I needed that part.. In Python!

    • @HenryLeu
      @HenryLeu 2 роки тому

      @@mrp5249 no I didn't. I searched every where on Google. Some people suggest using chrome dev tools. But that one doesn't let you get the XHR response body.

    • @vikraal6974
      @vikraal6974 2 роки тому +1

      Hey Henry bro, did you find a solution? I am also looking for python equivalent.

    • @HenryLeu
      @HenryLeu 2 роки тому

      @@vikraal6974 still searching

  • @pradiptanaskar6594
    @pradiptanaskar6594 2 роки тому

    Can we chk in edge browser

  • @raghumeda235
    @raghumeda235 3 роки тому

    Hi Sir, How to capture the traffic on a button click? In your video, does it captured the traffic when virtual Library button is clicked

    • @deyanand1955
      @deyanand1955 2 роки тому

      execute this code after the button click, it will listen to all responses received by browser.

  • @gheeno.
    @gheeno. 2 роки тому

    is there a way to assert on these responses? I can assert them inside the "addListener" method, but the test does't really quit/stop on failure.

    • @anantabuddha4426
      @anantabuddha4426 Рік тому

      do soft assertions

    • @BestHomeFind
      @BestHomeFind Рік тому

      Were you able to do the assertion I have to do this in another method so need to save response body and call somewhere else.

  • @HenryLeu
    @HenryLeu 2 роки тому

    my webdriver does not have GetDevTools() method???

  • @pulkitagrawal4372
    @pulkitagrawal4372 2 роки тому

    Getting below error while passing Optional.empty() in Network.send
    "The method enable(Optional, Optional, Optional) in the type Network is not applicable for the arguments (Optional, Optional, Optional)"
    Selenium code as below:
    import java.util.Optional;
    import org.openqa.selenium.By;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.chrome.ChromeDriver;
    import org.openqa.selenium.devtools.DevTools;
    import org.openqa.selenium.devtools.v95.network.Network;
    import io.github.bonigarcia.wdm.WebDriverManager;
    public class gdeLoginFlow {
    public static void main(String[] args) {
    WebDriverManager.chromedriver().setup();
    WebDriver driver = new ChromeDriver();
    driver.get("test/login");
    driver.findElement(By.xpath("//*[@id='loginId']")).sendKeys("username);
    driver.findElement(By.xpath("//*[@id='password']")).sendKeys("pwd@");
    driver.findElement(By.xpath("//button[@class='blue button']")).click();
    DevTools devTools = ((ChromeDriver) driver).getDevTools();
    devTools.createSession();
    devTools.send(Network.enable(Optional.empty(), Optional.empty(), Optional.empty()));
    }
    }

    • @factdebuggermind2514
      @factdebuggermind2514 2 роки тому +1

      same for me. and I think author will not provide the support unless we purchase the full course

  • @shalinikushwah4305
    @shalinikushwah4305 2 роки тому

    org.openqa.selenium.devtools.DevToolsException: You are using a no-op implementation of the CDP. The most likely reason for this is that Selenium was unable to find an implementation of the CDP protocol that matches your browser. Please be sure to include an implementation on the classpath, possibly by adding a new (maven) dependency of `org.seleniumhq.selenium:selenium-devtools-vNN:4.0.0-beta-2` where `NN` matches the major version of the browser you're using. "I am facing this error"