How to get all network calls while performing selenium automation?

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

How to get all network calls while performing selenium automation?

Ankit Gupta-2
While performing selenium automation, I also want to get the all the APIs call so that I can get the exact failure issue either it is on Website side or on the API's side.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/c9a88dc2-d672-4b8a-839d-e7fe9a25a112%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to get all network calls while performing selenium automation?

Joe Ward
No way to do it with Selenium, you can probably use the JavaScriptExecutor to get what's produced by Window.performance if that's what you really wanted, though.


On 29 May 2018 at 13:02, ankit gupta <[hidden email]> wrote:
While performing selenium automation, I also want to get the all the APIs call so that I can get the exact failure issue either it is on Website side or on the API's side.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/c9a88dc2-d672-4b8a-839d-e7fe9a25a112%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAJPyTs1vSm_aFApPOo%2BvBwD0eJrtsaH91urrcGCVMSchvZVbbw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to get all network calls while performing selenium automation?

Ankit Gupta-2
Thanks a lot, Joe.

But I want to fetch all API's call and their request data and response data after click() or some other functionality.

On Tue, May 29, 2018 at 6:10 PM, Joe Ward <[hidden email]> wrote:
No way to do it with Selenium, you can probably use the JavaScriptExecutor to get what's produced by Window.performance if that's what you really wanted, though.


On 29 May 2018 at 13:02, ankit gupta <[hidden email]> wrote:
While performing selenium automation, I also want to get the all the APIs call so that I can get the exact failure issue either it is on Website side or on the API's side.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/c9a88dc2-d672-4b8a-839d-e7fe9a25a112%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAJPyTs1vSm_aFApPOo%2BvBwD0eJrtsaH91urrcGCVMSchvZVbbw%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKrer0DuT7TzW9-Y-%2BGU3ASm0jaMq_-Hg%2BeSA2x2JZpXPTAYhA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to get all network calls while performing selenium automation?

Krishnan Mahadevan

Route your browser traffic through a proxy server such as BrowserMobProxy or try to retrieve the logs via the Beta level performance APIs in the Selenium WebDriver code (Sample shown as below)

 

import java.util.Iterator;

import java.util.logging.Level;

import org.openqa.selenium.chrome.ChromeDriver;

import org.openqa.selenium.chrome.ChromeOptions;

import org.openqa.selenium.logging.LogEntries;

import org.openqa.selenium.logging.LogEntry;

import org.openqa.selenium.logging.LogType;

import org.openqa.selenium.logging.LoggingPreferences;

import org.openqa.selenium.remote.CapabilityType;

 

public class Sample {

 

  public static void main(String[] args) {

    LoggingPreferences preferences = new LoggingPreferences();

    preferences.enable(LogType.PERFORMANCE, Level.ALL);

    ChromeOptions options = new ChromeOptions();

    options.setCapability(CapabilityType.LOGGING_PREFS, preferences);

    ChromeDriver driver = new ChromeDriver(options);

    try {

      driver.get("http://wwww.facebook.com");

      LogEntries logs = driver.manage().logs().get(LogType.PERFORMANCE);

     Iterator<LogEntry> iterator = logs.iterator();

      while (iterator.hasNext()) {

        LogEntry entry = iterator.next();

        System.err.println(entry.toString());

      }

 

    } finally {

      driver.quit();

    }

  }

}

 

 

PS: I know for sure that this works in Chrome, but am not sure if it would work the same way in other browser flavors.

 

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 

From: <[hidden email]> on behalf of Ankit Gupta <[hidden email]>
Reply-To: <[hidden email]>
Date: Tuesday, May 29, 2018 at 7:31 PM
To: <[hidden email]>
Subject: Re: [selenium-users] How to get all network calls while performing selenium automation?

 

Thanks a lot, Joe.

 

But I want to fetch all API's call and their request data and response data after click() or some other functionality.

 

On Tue, May 29, 2018 at 6:10 PM, Joe Ward <[hidden email]> wrote:

No way to do it with Selenium, you can probably use the JavaScriptExecutor to get what's produced by Window.performance if that's what you really wanted, though.

 

 

On 29 May 2018 at 13:02, ankit gupta <[hidden email]> wrote:

While performing selenium automation, I also want to get the all the APIs call so that I can get the exact failure issue either it is on Website side or on the API's side.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/c9a88dc2-d672-4b8a-839d-e7fe9a25a112%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAJPyTs1vSm_aFApPOo%2BvBwD0eJrtsaH91urrcGCVMSchvZVbbw%40mail.gmail.com.


For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKrer0DuT7TzW9-Y-%2BGU3ASm0jaMq_-Hg%2BeSA2x2JZpXPTAYhA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/7AD72B34-D623-4973-B45C-DCE83F02FAA5%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to get all network calls while performing selenium automation?

Ankit Gupta-2
Thanks,  Krishnan

But it also does not have data of all the API's calls 

On Tue, May 29, 2018 at 7:56 PM, Krishnan Mahadevan <[hidden email]> wrote:

Route your browser traffic through a proxy server such as BrowserMobProxy or try to retrieve the logs via the Beta level performance APIs in the Selenium WebDriver code (Sample shown as below)

 

import java.util.Iterator;

import java.util.logging.Level;

import org.openqa.selenium.chrome.ChromeDriver;

import org.openqa.selenium.chrome.ChromeOptions;

import org.openqa.selenium.logging.LogEntries;

import org.openqa.selenium.logging.LogEntry;

import org.openqa.selenium.logging.LogType;

import org.openqa.selenium.logging.LoggingPreferences;

import org.openqa.selenium.remote.CapabilityType;

 

public class Sample {

 

  public static void main(String[] args) {

    LoggingPreferences preferences = new LoggingPreferences();

    preferences.enable(LogType.PERFORMANCE, Level.ALL);

    ChromeOptions options = new ChromeOptions();

    options.setCapability(CapabilityType.LOGGING_PREFS, preferences);

    ChromeDriver driver = new ChromeDriver(options);

    try {

      driver.get("http://wwww.facebook.com");

      LogEntries logs = driver.manage().logs().get(LogType.PERFORMANCE);

     Iterator<LogEntry> iterator = logs.iterator();

      while (iterator.hasNext()) {

        LogEntry entry = iterator.next();

        System.err.println(entry.toString());

      }

 

    } finally {

      driver.quit();

    }

  }

}

 

 

PS: I know for sure that this works in Chrome, but am not sure if it would work the same way in other browser flavors.

 

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 

From: <[hidden email]> on behalf of Ankit Gupta <[hidden email]>
Reply-To: <[hidden email]>
Date: Tuesday, May 29, 2018 at 7:31 PM
To: <[hidden email]>
Subject: Re: [selenium-users] How to get all network calls while performing selenium automation?

 

Thanks a lot, Joe.

 

But I want to fetch all API's call and their request data and response data after click() or some other functionality.

 

On Tue, May 29, 2018 at 6:10 PM, Joe Ward <[hidden email]> wrote:

No way to do it with Selenium, you can probably use the JavaScriptExecutor to get what's produced by Window.performance if that's what you really wanted, though.

 

 

On 29 May 2018 at 13:02, ankit gupta <[hidden email]> wrote:

While performing selenium automation, I also want to get the all the APIs call so that I can get the exact failure issue either it is on Website side or on the API's side.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/c9a88dc2-d672-4b8a-839d-e7fe9a25a112%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAJPyTs1vSm_aFApPOo%2BvBwD0eJrtsaH91urrcGCVMSchvZVbbw%40mail.gmail.com.


For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKrer0DuT7TzW9-Y-%2BGU3ASm0jaMq_-Hg%2BeSA2x2JZpXPTAYhA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/7AD72B34-D623-4973-B45C-DCE83F02FAA5%40gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKrer0DthdOE5AtZ__jSni83YdftO%3DgrB1jPAXRtHBA4%2BgXnew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to get all network calls while performing selenium automation?

Krishnan Mahadevan
What did you try ? Can you elaborate ?

On Wed 30 May, 2018, 12:19 Ankit Gupta, <[hidden email]> wrote:
Thanks,  Krishnan

But it also does not have data of all the API's calls 

On Tue, May 29, 2018 at 7:56 PM, Krishnan Mahadevan <[hidden email]> wrote:

Route your browser traffic through a proxy server such as BrowserMobProxy or try to retrieve the logs via the Beta level performance APIs in the Selenium WebDriver code (Sample shown as below)

 

import java.util.Iterator;

import java.util.logging.Level;

import org.openqa.selenium.chrome.ChromeDriver;

import org.openqa.selenium.chrome.ChromeOptions;

import org.openqa.selenium.logging.LogEntries;

import org.openqa.selenium.logging.LogEntry;

import org.openqa.selenium.logging.LogType;

import org.openqa.selenium.logging.LoggingPreferences;

import org.openqa.selenium.remote.CapabilityType;

 

public class Sample {

 

  public static void main(String[] args) {

    LoggingPreferences preferences = new LoggingPreferences();

    preferences.enable(LogType.PERFORMANCE, Level.ALL);

    ChromeOptions options = new ChromeOptions();

    options.setCapability(CapabilityType.LOGGING_PREFS, preferences);

    ChromeDriver driver = new ChromeDriver(options);

    try {

      driver.get("http://wwww.facebook.com");

      LogEntries logs = driver.manage().logs().get(LogType.PERFORMANCE);

     Iterator<LogEntry> iterator = logs.iterator();

      while (iterator.hasNext()) {

        LogEntry entry = iterator.next();

        System.err.println(entry.toString());

      }

 

    } finally {

      driver.quit();

    }

  }

}

 

 

PS: I know for sure that this works in Chrome, but am not sure if it would work the same way in other browser flavors.

 

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 

From: <[hidden email]> on behalf of Ankit Gupta <[hidden email]>
Reply-To: <[hidden email]>
Date: Tuesday, May 29, 2018 at 7:31 PM
To: <[hidden email]>
Subject: Re: [selenium-users] How to get all network calls while performing selenium automation?

 

Thanks a lot, Joe.

 

But I want to fetch all API's call and their request data and response data after click() or some other functionality.

 

On Tue, May 29, 2018 at 6:10 PM, Joe Ward <[hidden email]> wrote:

No way to do it with Selenium, you can probably use the JavaScriptExecutor to get what's produced by Window.performance if that's what you really wanted, though.

 

 

On 29 May 2018 at 13:02, ankit gupta <[hidden email]> wrote:

While performing selenium automation, I also want to get the all the APIs call so that I can get the exact failure issue either it is on Website side or on the API's side.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/c9a88dc2-d672-4b8a-839d-e7fe9a25a112%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAJPyTs1vSm_aFApPOo%2BvBwD0eJrtsaH91urrcGCVMSchvZVbbw%40mail.gmail.com.


For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKrer0DuT7TzW9-Y-%2BGU3ASm0jaMq_-Hg%2BeSA2x2JZpXPTAYhA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKrer0DthdOE5AtZ__jSni83YdftO%3DgrB1jPAXRtHBA4%2BgXnew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANikZLmWuaa1eKO%2BZF6faVCpOR2GpxADTG8otgnpRsWcS%3DBvjQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to get all network calls while performing selenium automation?

cassian
Did you try with fiddler?

On Wed, May 30, 2018, 1:02 PM ⇜Krishnan Mahadevan⇝ <[hidden email]> wrote:
What did you try ? Can you elaborate ?

On Wed 30 May, 2018, 12:19 Ankit Gupta, <[hidden email]> wrote:
Thanks,  Krishnan

But it also does not have data of all the API's calls 

On Tue, May 29, 2018 at 7:56 PM, Krishnan Mahadevan <[hidden email]> wrote:

Route your browser traffic through a proxy server such as BrowserMobProxy or try to retrieve the logs via the Beta level performance APIs in the Selenium WebDriver code (Sample shown as below)

 

import java.util.Iterator;

import java.util.logging.Level;

import org.openqa.selenium.chrome.ChromeDriver;

import org.openqa.selenium.chrome.ChromeOptions;

import org.openqa.selenium.logging.LogEntries;

import org.openqa.selenium.logging.LogEntry;

import org.openqa.selenium.logging.LogType;

import org.openqa.selenium.logging.LoggingPreferences;

import org.openqa.selenium.remote.CapabilityType;

 

public class Sample {

 

  public static void main(String[] args) {

    LoggingPreferences preferences = new LoggingPreferences();

    preferences.enable(LogType.PERFORMANCE, Level.ALL);

    ChromeOptions options = new ChromeOptions();

    options.setCapability(CapabilityType.LOGGING_PREFS, preferences);

    ChromeDriver driver = new ChromeDriver(options);

    try {

      driver.get("http://wwww.facebook.com");

      LogEntries logs = driver.manage().logs().get(LogType.PERFORMANCE);

     Iterator<LogEntry> iterator = logs.iterator();

      while (iterator.hasNext()) {

        LogEntry entry = iterator.next();

        System.err.println(entry.toString());

      }

 

    } finally {

      driver.quit();

    }

  }

}

 

 

PS: I know for sure that this works in Chrome, but am not sure if it would work the same way in other browser flavors.

 

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 

From: <[hidden email]> on behalf of Ankit Gupta <[hidden email]>
Reply-To: <[hidden email]>
Date: Tuesday, May 29, 2018 at 7:31 PM
To: <[hidden email]>
Subject: Re: [selenium-users] How to get all network calls while performing selenium automation?

 

Thanks a lot, Joe.

 

But I want to fetch all API's call and their request data and response data after click() or some other functionality.

 

On Tue, May 29, 2018 at 6:10 PM, Joe Ward <[hidden email]> wrote:

No way to do it with Selenium, you can probably use the JavaScriptExecutor to get what's produced by Window.performance if that's what you really wanted, though.

 

 

On 29 May 2018 at 13:02, ankit gupta <[hidden email]> wrote:

While performing selenium automation, I also want to get the all the APIs call so that I can get the exact failure issue either it is on Website side or on the API's side.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/c9a88dc2-d672-4b8a-839d-e7fe9a25a112%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAJPyTs1vSm_aFApPOo%2BvBwD0eJrtsaH91urrcGCVMSchvZVbbw%40mail.gmail.com.


For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKrer0DuT7TzW9-Y-%2BGU3ASm0jaMq_-Hg%2BeSA2x2JZpXPTAYhA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKrer0DthdOE5AtZ__jSni83YdftO%3DgrB1jPAXRtHBA4%2BgXnew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANikZLmWuaa1eKO%2BZF6faVCpOR2GpxADTG8otgnpRsWcS%3DBvjQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CABh6KKuBnUj%2BrQCH985afGb%3DG7Pfoo7_YRrhCW51EXRu-fgEuQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to get all network calls while performing selenium automation?

Ankit Gupta-2
In reply to this post by Krishnan Mahadevan
The same code which you shared, 
It does not have API's (GET, POST,PUT) request and response data.

On Wed, May 30, 2018 at 1:01 PM, ⇜Krishnan Mahadevan⇝ <[hidden email]> wrote:
What did you try ? Can you elaborate ?

On Wed 30 May, 2018, 12:19 Ankit Gupta, <[hidden email]> wrote:
Thanks,  Krishnan

But it also does not have data of all the API's calls 

On Tue, May 29, 2018 at 7:56 PM, Krishnan Mahadevan <[hidden email]> wrote:

Route your browser traffic through a proxy server such as BrowserMobProxy or try to retrieve the logs via the Beta level performance APIs in the Selenium WebDriver code (Sample shown as below)

 

import java.util.Iterator;

import java.util.logging.Level;

import org.openqa.selenium.chrome.ChromeDriver;

import org.openqa.selenium.chrome.ChromeOptions;

import org.openqa.selenium.logging.LogEntries;

import org.openqa.selenium.logging.LogEntry;

import org.openqa.selenium.logging.LogType;

import org.openqa.selenium.logging.LoggingPreferences;

import org.openqa.selenium.remote.CapabilityType;

 

public class Sample {

 

  public static void main(String[] args) {

    LoggingPreferences preferences = new LoggingPreferences();

    preferences.enable(LogType.PERFORMANCE, Level.ALL);

    ChromeOptions options = new ChromeOptions();

    options.setCapability(CapabilityType.LOGGING_PREFS, preferences);

    ChromeDriver driver = new ChromeDriver(options);

    try {

      driver.get("http://wwww.facebook.com");

      LogEntries logs = driver.manage().logs().get(LogType.PERFORMANCE);

     Iterator<LogEntry> iterator = logs.iterator();

      while (iterator.hasNext()) {

        LogEntry entry = iterator.next();

        System.err.println(entry.toString());

      }

 

    } finally {

      driver.quit();

    }

  }

}

 

 

PS: I know for sure that this works in Chrome, but am not sure if it would work the same way in other browser flavors.

 

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 

From: <[hidden email]> on behalf of Ankit Gupta <[hidden email]>
Reply-To: <[hidden email]>
Date: Tuesday, May 29, 2018 at 7:31 PM
To: <[hidden email]>
Subject: Re: [selenium-users] How to get all network calls while performing selenium automation?

 

Thanks a lot, Joe.

 

But I want to fetch all API's call and their request data and response data after click() or some other functionality.

 

On Tue, May 29, 2018 at 6:10 PM, Joe Ward <[hidden email]> wrote:

No way to do it with Selenium, you can probably use the JavaScriptExecutor to get what's produced by Window.performance if that's what you really wanted, though.

 

 

On 29 May 2018 at 13:02, ankit gupta <[hidden email]> wrote:

While performing selenium automation, I also want to get the all the APIs call so that I can get the exact failure issue either it is on Website side or on the API's side.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/c9a88dc2-d672-4b8a-839d-e7fe9a25a112%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAJPyTs1vSm_aFApPOo%2BvBwD0eJrtsaH91urrcGCVMSchvZVbbw%40mail.gmail.com.


For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKrer0DuT7TzW9-Y-%2BGU3ASm0jaMq_-Hg%2BeSA2x2JZpXPTAYhA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKrer0DthdOE5AtZ__jSni83YdftO%3DgrB1jPAXRtHBA4%2BgXnew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANikZLmWuaa1eKO%2BZF6faVCpOR2GpxADTG8otgnpRsWcS%3DBvjQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKrer0Bp9B8P2OBP4KFedCZHMZEKiuTXswUdWYgc3A7DmAs3HQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to get all network calls while performing selenium automation?

Krishnan Mahadevan
I believe I shared two alternatives. The log API in selenium is "Beta" so it's still work in progress and may not give you all aspects. 

What happens when you try using a proxy server such as browsermobproxy or fiddler ?

On Wed 30 May, 2018, 13:11 Ankit Gupta, <[hidden email]> wrote:
The same code which you shared, 
It does not have API's (GET, POST,PUT) request and response data.

On Wed, May 30, 2018 at 1:01 PM, ⇜Krishnan Mahadevan⇝ <[hidden email]> wrote:
What did you try ? Can you elaborate ?

On Wed 30 May, 2018, 12:19 Ankit Gupta, <[hidden email]> wrote:
Thanks,  Krishnan

But it also does not have data of all the API's calls 

On Tue, May 29, 2018 at 7:56 PM, Krishnan Mahadevan <[hidden email]> wrote:

Route your browser traffic through a proxy server such as BrowserMobProxy or try to retrieve the logs via the Beta level performance APIs in the Selenium WebDriver code (Sample shown as below)

 

import java.util.Iterator;

import java.util.logging.Level;

import org.openqa.selenium.chrome.ChromeDriver;

import org.openqa.selenium.chrome.ChromeOptions;

import org.openqa.selenium.logging.LogEntries;

import org.openqa.selenium.logging.LogEntry;

import org.openqa.selenium.logging.LogType;

import org.openqa.selenium.logging.LoggingPreferences;

import org.openqa.selenium.remote.CapabilityType;

 

public class Sample {

 

  public static void main(String[] args) {

    LoggingPreferences preferences = new LoggingPreferences();

    preferences.enable(LogType.PERFORMANCE, Level.ALL);

    ChromeOptions options = new ChromeOptions();

    options.setCapability(CapabilityType.LOGGING_PREFS, preferences);

    ChromeDriver driver = new ChromeDriver(options);

    try {

      driver.get("http://wwww.facebook.com");

      LogEntries logs = driver.manage().logs().get(LogType.PERFORMANCE);

     Iterator<LogEntry> iterator = logs.iterator();

      while (iterator.hasNext()) {

        LogEntry entry = iterator.next();

        System.err.println(entry.toString());

      }

 

    } finally {

      driver.quit();

    }

  }

}

 

 

PS: I know for sure that this works in Chrome, but am not sure if it would work the same way in other browser flavors.

 

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 

From: <[hidden email]> on behalf of Ankit Gupta <[hidden email]>
Reply-To: <[hidden email]>
Date: Tuesday, May 29, 2018 at 7:31 PM
To: <[hidden email]>
Subject: Re: [selenium-users] How to get all network calls while performing selenium automation?

 

Thanks a lot, Joe.

 

But I want to fetch all API's call and their request data and response data after click() or some other functionality.

 

On Tue, May 29, 2018 at 6:10 PM, Joe Ward <[hidden email]> wrote:

No way to do it with Selenium, you can probably use the JavaScriptExecutor to get what's produced by Window.performance if that's what you really wanted, though.

 

 

On 29 May 2018 at 13:02, ankit gupta <[hidden email]> wrote:

While performing selenium automation, I also want to get the all the APIs call so that I can get the exact failure issue either it is on Website side or on the API's side.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/c9a88dc2-d672-4b8a-839d-e7fe9a25a112%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAJPyTs1vSm_aFApPOo%2BvBwD0eJrtsaH91urrcGCVMSchvZVbbw%40mail.gmail.com.


For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKrer0DuT7TzW9-Y-%2BGU3ASm0jaMq_-Hg%2BeSA2x2JZpXPTAYhA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKrer0DthdOE5AtZ__jSni83YdftO%3DgrB1jPAXRtHBA4%2BgXnew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANikZLmWuaa1eKO%2BZF6faVCpOR2GpxADTG8otgnpRsWcS%3DBvjQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKrer0Bp9B8P2OBP4KFedCZHMZEKiuTXswUdWYgc3A7DmAs3HQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANikZLkyzJ%2BrQHb2xJRg%2B1q_2Xaen6ahY1eETbv%3Dv82a4YB5CA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to get all network calls while performing selenium automation?

Joe Ward
What issue are you actually trying to solve by doing this? Selenium doesn't really have a programmatic way to do what you're asking. Fiddler and BrowserMob are probably OK for exploratory testing but a bit outside what this group is "for". If you explained your reasons for wanting to do this then maybe we can suggest alternatives?

On 30 May 2018 at 08:46, ⇜Krishnan Mahadevan⇝ <[hidden email]> wrote:
I believe I shared two alternatives. The log API in selenium is "Beta" so it's still work in progress and may not give you all aspects. 

What happens when you try using a proxy server such as browsermobproxy or fiddler ?


On Wed 30 May, 2018, 13:11 Ankit Gupta, <[hidden email]> wrote:
The same code which you shared, 
It does not have API's (GET, POST,PUT) request and response data.

On Wed, May 30, 2018 at 1:01 PM, ⇜Krishnan Mahadevan⇝ <[hidden email]> wrote:
What did you try ? Can you elaborate ?

On Wed 30 May, 2018, 12:19 Ankit Gupta, <[hidden email]> wrote:
Thanks,  Krishnan

But it also does not have data of all the API's calls 

On Tue, May 29, 2018 at 7:56 PM, Krishnan Mahadevan <[hidden email]> wrote:

Route your browser traffic through a proxy server such as BrowserMobProxy or try to retrieve the logs via the Beta level performance APIs in the Selenium WebDriver code (Sample shown as below)

 

import java.util.Iterator;

import java.util.logging.Level;

import org.openqa.selenium.chrome.ChromeDriver;

import org.openqa.selenium.chrome.ChromeOptions;

import org.openqa.selenium.logging.LogEntries;

import org.openqa.selenium.logging.LogEntry;

import org.openqa.selenium.logging.LogType;

import org.openqa.selenium.logging.LoggingPreferences;

import org.openqa.selenium.remote.CapabilityType;

 

public class Sample {

 

  public static void main(String[] args) {

    LoggingPreferences preferences = new LoggingPreferences();

    preferences.enable(LogType.PERFORMANCE, Level.ALL);

    ChromeOptions options = new ChromeOptions();

    options.setCapability(CapabilityType.LOGGING_PREFS, preferences);

    ChromeDriver driver = new ChromeDriver(options);

    try {

      driver.get("http://wwww.facebook.com");

      LogEntries logs = driver.manage().logs().get(LogType.PERFORMANCE);

     Iterator<LogEntry> iterator = logs.iterator();

      while (iterator.hasNext()) {

        LogEntry entry = iterator.next();

        System.err.println(entry.toString());

      }

 

    } finally {

      driver.quit();

    }

  }

}

 

 

PS: I know for sure that this works in Chrome, but am not sure if it would work the same way in other browser flavors.

 

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 

From: <[hidden email]> on behalf of Ankit Gupta <[hidden email]>
Reply-To: <[hidden email]>
Date: Tuesday, May 29, 2018 at 7:31 PM
To: <[hidden email]>
Subject: Re: [selenium-users] How to get all network calls while performing selenium automation?

 

Thanks a lot, Joe.

 

But I want to fetch all API's call and their request data and response data after click() or some other functionality.

 

On Tue, May 29, 2018 at 6:10 PM, Joe Ward <[hidden email]> wrote:

No way to do it with Selenium, you can probably use the JavaScriptExecutor to get what's produced by Window.performance if that's what you really wanted, though.

 

 

On 29 May 2018 at 13:02, ankit gupta <[hidden email]> wrote:

While performing selenium automation, I also want to get the all the APIs call so that I can get the exact failure issue either it is on Website side or on the API's side.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/c9a88dc2-d672-4b8a-839d-e7fe9a25a112%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAJPyTs1vSm_aFApPOo%2BvBwD0eJrtsaH91urrcGCVMSchvZVbbw%40mail.gmail.com.


For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKrer0DuT7TzW9-Y-%2BGU3ASm0jaMq_-Hg%2BeSA2x2JZpXPTAYhA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKrer0DthdOE5AtZ__jSni83YdftO%3DgrB1jPAXRtHBA4%2BgXnew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANikZLmWuaa1eKO%2BZF6faVCpOR2GpxADTG8otgnpRsWcS%3DBvjQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKrer0Bp9B8P2OBP4KFedCZHMZEKiuTXswUdWYgc3A7DmAs3HQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANikZLkyzJ%2BrQHb2xJRg%2B1q_2Xaen6ahY1eETbv%3Dv82a4YB5CA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAJPyTs2%2BZA9OEsfSruahJJQSvMVUkqt5bbtMhqr%3D_gGgfp8iTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to get all network calls while performing selenium automation?

Ankit Gupta-2
I got the answer and Question is same as previous, To capture all the API's call while performing the test with selenium.

Using Fiddler and BrowserMob, the problem would solve completely.


Thanks a lot, Joe and Krishnan 

On Wed, May 30, 2018 at 1:56 PM, Joe Ward <[hidden email]> wrote:
What issue are you actually trying to solve by doing this? Selenium doesn't really have a programmatic way to do what you're asking. Fiddler and BrowserMob are probably OK for exploratory testing but a bit outside what this group is "for". If you explained your reasons for wanting to do this then maybe we can suggest alternatives?

On 30 May 2018 at 08:46, ⇜Krishnan Mahadevan⇝ <[hidden email]> wrote:
I believe I shared two alternatives. The log API in selenium is "Beta" so it's still work in progress and may not give you all aspects. 

What happens when you try using a proxy server such as browsermobproxy or fiddler ?


On Wed 30 May, 2018, 13:11 Ankit Gupta, <[hidden email]> wrote:
The same code which you shared, 
It does not have API's (GET, POST,PUT) request and response data.

On Wed, May 30, 2018 at 1:01 PM, ⇜Krishnan Mahadevan⇝ <[hidden email]> wrote:
What did you try ? Can you elaborate ?

On Wed 30 May, 2018, 12:19 Ankit Gupta, <[hidden email]> wrote:
Thanks,  Krishnan

But it also does not have data of all the API's calls 

On Tue, May 29, 2018 at 7:56 PM, Krishnan Mahadevan <[hidden email]> wrote:

Route your browser traffic through a proxy server such as BrowserMobProxy or try to retrieve the logs via the Beta level performance APIs in the Selenium WebDriver code (Sample shown as below)

 

import java.util.Iterator;

import java.util.logging.Level;

import org.openqa.selenium.chrome.ChromeDriver;

import org.openqa.selenium.chrome.ChromeOptions;

import org.openqa.selenium.logging.LogEntries;

import org.openqa.selenium.logging.LogEntry;

import org.openqa.selenium.logging.LogType;

import org.openqa.selenium.logging.LoggingPreferences;

import org.openqa.selenium.remote.CapabilityType;

 

public class Sample {

 

  public static void main(String[] args) {

    LoggingPreferences preferences = new LoggingPreferences();

    preferences.enable(LogType.PERFORMANCE, Level.ALL);

    ChromeOptions options = new ChromeOptions();

    options.setCapability(CapabilityType.LOGGING_PREFS, preferences);

    ChromeDriver driver = new ChromeDriver(options);

    try {

      driver.get("http://wwww.facebook.com");

      LogEntries logs = driver.manage().logs().get(LogType.PERFORMANCE);

     Iterator<LogEntry> iterator = logs.iterator();

      while (iterator.hasNext()) {

        LogEntry entry = iterator.next();

        System.err.println(entry.toString());

      }

 

    } finally {

      driver.quit();

    }

  }

}

 

 

PS: I know for sure that this works in Chrome, but am not sure if it would work the same way in other browser flavors.

 

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 

From: <[hidden email]> on behalf of Ankit Gupta <[hidden email]>
Reply-To: <[hidden email]>
Date: Tuesday, May 29, 2018 at 7:31 PM
To: <[hidden email]>
Subject: Re: [selenium-users] How to get all network calls while performing selenium automation?

 

Thanks a lot, Joe.

 

But I want to fetch all API's call and their request data and response data after click() or some other functionality.

 

On Tue, May 29, 2018 at 6:10 PM, Joe Ward <[hidden email]> wrote:

No way to do it with Selenium, you can probably use the JavaScriptExecutor to get what's produced by Window.performance if that's what you really wanted, though.

 

 

On 29 May 2018 at 13:02, ankit gupta <[hidden email]> wrote:

While performing selenium automation, I also want to get the all the APIs call so that I can get the exact failure issue either it is on Website side or on the API's side.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/c9a88dc2-d672-4b8a-839d-e7fe9a25a112%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAJPyTs1vSm_aFApPOo%2BvBwD0eJrtsaH91urrcGCVMSchvZVbbw%40mail.gmail.com.


For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKrer0DuT7TzW9-Y-%2BGU3ASm0jaMq_-Hg%2BeSA2x2JZpXPTAYhA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKrer0DthdOE5AtZ__jSni83YdftO%3DgrB1jPAXRtHBA4%2BgXnew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANikZLmWuaa1eKO%2BZF6faVCpOR2GpxADTG8otgnpRsWcS%3DBvjQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKrer0Bp9B8P2OBP4KFedCZHMZEKiuTXswUdWYgc3A7DmAs3HQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANikZLkyzJ%2BrQHb2xJRg%2B1q_2Xaen6ahY1eETbv%3Dv82a4YB5CA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAJPyTs2%2BZA9OEsfSruahJJQSvMVUkqt5bbtMhqr%3D_gGgfp8iTA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKrer0DZVataT%3DYSwCEh5tGF8M1VEYqJDcgWnURwuhrwGkVg%3DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to get all network calls while performing selenium automation?

Ankit Gupta-2
Hi Krishnan,

Did you try with  BrowserMobProxy to get the logs? because it is not working for HTTPS website.
Could you please share the code if you did.

On Wed, May 30, 2018 at 2:39 PM, Ankit Gupta <[hidden email]> wrote:
I got the answer and Question is same as previous, To capture all the API's call while performing the test with selenium.

Using Fiddler and BrowserMob, the problem would solve completely.


Thanks a lot, Joe and Krishnan 

On Wed, May 30, 2018 at 1:56 PM, Joe Ward <[hidden email]> wrote:
What issue are you actually trying to solve by doing this? Selenium doesn't really have a programmatic way to do what you're asking. Fiddler and BrowserMob are probably OK for exploratory testing but a bit outside what this group is "for". If you explained your reasons for wanting to do this then maybe we can suggest alternatives?

On 30 May 2018 at 08:46, ⇜Krishnan Mahadevan⇝ <[hidden email]> wrote:
I believe I shared two alternatives. The log API in selenium is "Beta" so it's still work in progress and may not give you all aspects. 

What happens when you try using a proxy server such as browsermobproxy or fiddler ?


On Wed 30 May, 2018, 13:11 Ankit Gupta, <[hidden email]> wrote:
The same code which you shared, 
It does not have API's (GET, POST,PUT) request and response data.

On Wed, May 30, 2018 at 1:01 PM, ⇜Krishnan Mahadevan⇝ <[hidden email]> wrote:
What did you try ? Can you elaborate ?

On Wed 30 May, 2018, 12:19 Ankit Gupta, <[hidden email]> wrote:
Thanks,  Krishnan

But it also does not have data of all the API's calls 

On Tue, May 29, 2018 at 7:56 PM, Krishnan Mahadevan <[hidden email]> wrote:

Route your browser traffic through a proxy server such as BrowserMobProxy or try to retrieve the logs via the Beta level performance APIs in the Selenium WebDriver code (Sample shown as below)

 

import java.util.Iterator;

import java.util.logging.Level;

import org.openqa.selenium.chrome.ChromeDriver;

import org.openqa.selenium.chrome.ChromeOptions;

import org.openqa.selenium.logging.LogEntries;

import org.openqa.selenium.logging.LogEntry;

import org.openqa.selenium.logging.LogType;

import org.openqa.selenium.logging.LoggingPreferences;

import org.openqa.selenium.remote.CapabilityType;

 

public class Sample {

 

  public static void main(String[] args) {

    LoggingPreferences preferences = new LoggingPreferences();

    preferences.enable(LogType.PERFORMANCE, Level.ALL);

    ChromeOptions options = new ChromeOptions();

    options.setCapability(CapabilityType.LOGGING_PREFS, preferences);

    ChromeDriver driver = new ChromeDriver(options);

    try {

      driver.get("http://wwww.facebook.com");

      LogEntries logs = driver.manage().logs().get(LogType.PERFORMANCE);

     Iterator<LogEntry> iterator = logs.iterator();

      while (iterator.hasNext()) {

        LogEntry entry = iterator.next();

        System.err.println(entry.toString());

      }

 

    } finally {

      driver.quit();

    }

  }

}

 

 

PS: I know for sure that this works in Chrome, but am not sure if it would work the same way in other browser flavors.

 

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 

From: <[hidden email]> on behalf of Ankit Gupta <[hidden email]>
Reply-To: <[hidden email]>
Date: Tuesday, May 29, 2018 at 7:31 PM
To: <[hidden email]>
Subject: Re: [selenium-users] How to get all network calls while performing selenium automation?

 

Thanks a lot, Joe.

 

But I want to fetch all API's call and their request data and response data after click() or some other functionality.

 

On Tue, May 29, 2018 at 6:10 PM, Joe Ward <[hidden email]> wrote:

No way to do it with Selenium, you can probably use the JavaScriptExecutor to get what's produced by Window.performance if that's what you really wanted, though.

 

 

On 29 May 2018 at 13:02, ankit gupta <[hidden email]> wrote:

While performing selenium automation, I also want to get the all the APIs call so that I can get the exact failure issue either it is on Website side or on the API's side.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/c9a88dc2-d672-4b8a-839d-e7fe9a25a112%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAJPyTs1vSm_aFApPOo%2BvBwD0eJrtsaH91urrcGCVMSchvZVbbw%40mail.gmail.com.


For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKrer0DuT7TzW9-Y-%2BGU3ASm0jaMq_-Hg%2BeSA2x2JZpXPTAYhA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKrer0DthdOE5AtZ__jSni83YdftO%3DgrB1jPAXRtHBA4%2BgXnew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANikZLmWuaa1eKO%2BZF6faVCpOR2GpxADTG8otgnpRsWcS%3DBvjQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKrer0Bp9B8P2OBP4KFedCZHMZEKiuTXswUdWYgc3A7DmAs3HQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANikZLkyzJ%2BrQHb2xJRg%2B1q_2Xaen6ahY1eETbv%3Dv82a4YB5CA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAJPyTs2%2BZA9OEsfSruahJJQSvMVUkqt5bbtMhqr%3D_gGgfp8iTA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAKrer0Bj%2BhOv_r5tUc0-j8Ritg%2BhtDWgek6MNc7vWbiD9T3cJA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.