@@ -26,7 +26,7 @@ The following example shows how to use the Tracing class with Selenium Webdriver
2626
2727``` js
2828
29- import { CDPSession , Tracing } from " cdp-utils" ;
29+ import { CDPClient , Tracing } from " cdp-utils" ;
3030
3131test (' Test tracing' , async () => {
3232 const options = new chrome.Options ();
@@ -40,11 +40,11 @@ test('Test tracing', async () => {
4040 const googlePage = new GooglePage (driver);
4141
4242 // Initializes the CDP client connection
43- const cdpSession = new CDPSession ();
44- await cdpSession .init (port);
43+ const cdpClient = new CDPClient ();
44+ await cdpClient .init (port);
4545
4646 // Instantiates the class and produces a file as result of the trace
47- const tracing = new Tracing (cdpSession , ' tracing.json' );
47+ const tracing = new Tracing (cdpClient , ' tracing.json' );
4848
4949 // start tracing
5050 await tracing .startTrace ();
@@ -57,7 +57,7 @@ test('Test tracing', async () => {
5757 // do whatever with trace
5858
5959 // Close the CDP client connection
60- await cdpSession .close ()
60+ await cdpClient .close ()
6161
6262 await driver .quit ();
6363
@@ -71,7 +71,7 @@ An example using the Performance class with Selenium Webdriver.
7171
7272` ` ` js
7373
74- import { CDPSession , Performance } from " cdp-utils" ;
74+ import { CDPClient , Performance } from " cdp-utils" ;
7575
7676test (' Test performance' , async () => {
7777 const options = new chrome.Options ();
@@ -85,11 +85,11 @@ test('Test performance', async () => {
8585 const googlePage = new GooglePage (driver);
8686
8787 // Initializes the CDP client connection
88- const cdpSession = new CDPSession ();
89- await cdpSession .init (port);
88+ const cdpClient = new CDPClient ();
89+ await cdpClient .init (port);
9090
9191 // Instantiates the class and produces two files as result of the trace
92- const performance = new Performance (cdpSession , ' startTrace.json' , ' endTrace.json' );
92+ const performance = new Performance (cdpClient , ' startTrace.json' , ' endTrace.json' );
9393
9494 // start tracing
9595 const perfStartResults = await performance .startTrace ();
@@ -103,7 +103,7 @@ test('Test performance', async () => {
103103 // Perform assertions or do whatever with perfStartResults or perfEndResults
104104
105105 // Close the CDP client connection
106- await cdpSession .close ()
106+ await cdpClient .close ()
107107
108108 await driver .quit ();
109109}
0 commit comments