How to use setTimeouts method in Webdriverio

Best JavaScript code snippet using webdriverio-monorepo

Run Webdriverio automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

LastMinuteBet.js

Source: LastMinuteBet.js Github

copy
1const Env = require('../Env.js').Env;
2const util = require('util');
3
4function LastMinuteBet(matchbookApi, symfonyApi, saveData = false) {
5    this.matchbookApi = matchbookApi;
6    this.symfonyApi = symfonyApi;
7    this.saveData = saveData;
8    this.events = [];
9
10    this.watch = function () {
11        console.log("===================");
12        const $this = this;
13        const now = parseInt(new Date().getTime() / 1000);
14        const nowTimeOut = new Date().getTime();
15        let setTimeoutS = 1000;//s
16        const data = [
17            {name: "sport-ids", value: 24735152712200},
18            {name: "after", value: (now - 1200)},
19        ];
20        console.log(1);
21        $this.matchbookApi.getEventsView(data, function (events) {
22            console.log(2);
23            if (typeof events === "object" && Array.isArray(events.events)) {
24                console.log(3);
25                events.events = events.events.filter(x => x["allow-live-betting"] === true);
26            }
27            console.log(4);
28            if ((typeof events === "object" && events.events.length > 0) || $this.events.length > 0) {
29                console.log(5);
30                let eventStart = 0;
31                if (typeof events === "object" && events.events.length > 0) {
32                    console.log(51);
33                    eventStart = parseInt(new Date(events.events[0].start).getTime() / 1000);
34                } else {
35                    console.log(52);
36                    events = {
37                        events: [],
38                    }
39                }
40                if ((eventStart - now < 70 && eventStart - now > 5) || $this.events.length > 0) {
41                    console.log(6);
42                    $this.addEventsToThisEvents(events.events, now, function () {
43                        console.log(7);
44                        $this.updateThisEvents(events.events, now, function () {
45                            console.log(8);
46                            const beforeTimeOut = new Date().getTime();
47                            console.log(setTimeoutS, beforeTimeOut, nowTimeOut, "before");
48                            setTimeoutS = setTimeoutS - (beforeTimeOut - nowTimeOut);
49                            console.log(setTimeoutS, "before2");
50                            if (setTimeoutS < 0) {
51                                setTimeoutS = 0;
52                            }
53                            setTimeout(function () {
54                                console.log(9);
55                                $this.watch();
56                            }, setTimeoutS);
57                        });
58                    });
59                } else {
60                    console.log(10);
61                    setTimeoutS = 1000 * 60;
62                    console.log("timeOut1", setTimeoutS);
63                    setTimeout(function () {
64                        $this.watch();
65                    }, setTimeoutS);
66                }
67            } else {
68                console.log(13, $this.events.length);
69                if (events !== false) setTimeoutS = 60 * 1000;
70                console.log("timeOut2", setTimeoutS);
71                setTimeout(function () {
72                    $this.watch();
73                }, setTimeoutS);
74            }
75        }, true);
76    };
77
78    this.updateThisEvents = function (events, now, callback) {
79        const $this = this;
80        const indexToDelete = [];
81        console.log($this.events.length);
82        $this.events.map(function (myEvent, indexEvent) {
83            const event = events.find(x => x.id === myEvent.id);
84            const time = myEvent.start - now;
85            if (typeof event !== "undefined") console.log(typeof event, event.status, myEvent.name);
86            else console.log(typeof event, myEvent.name);
87            if (typeof event !== "undefined" && event.status === "open") {
88                if (event["in-running-flag"] === true) {
89                    myEvent.runners.map(function (myRunner) {
90                        const market = event.markets[0];
91                        if (typeof market !== "undefined") {
92                            const runner = market.runners.find(x => x.id === myRunner.id);
93                            let push = {
94                                time: time,
95                                back: null,
96                                back2: null,
97                                lay: null,
98                                lay2: null,
99                            };
100                            if (typeof runner !== "undefined") {
101                                const backs = runner.prices.filter(x => x.side === "back");
102                                const lays = runner.prices.filter(x => x.side === "lay");
103                                if (backs.length > 0) {
104                                    const back = backs.reduce(function (prev, current) {
105                                        return (prev.odds > current.odds) ? prev : current
106                                    });
107                                    const back2 = backs.reduce(function (prev, current) {
108                                        return (prev.odds < current.odds) ? prev : current
109                                    });
110                                    if (typeof back !== "undefined") {
111                                        push.back = back.odds;
112                                    }
113                                    if (typeof back2 !== "undefined") {
114                                        push.back2 = back2.odds;
115                                    }
116                                }
117                                if (lays.length > 0) {
118                                    const lay = lays.reduce(function (prev, current) {
119                                        return (prev.odds < current.odds) ? prev : current
120                                    });
121                                    const lay2 = lays.reduce(function (prev, current) {
122                                        return (prev.odds > current.odds) ? prev : current
123                                    });
124
125                                    if (typeof lay !== "undefined") {
126                                        push.lay = lay.odds;
127                                    }
128                                    if (typeof lay2 !== "undefined") {
129                                        push.lay2 = lay2.odds;
130                                    }
131                                }
132                                myRunner.prices.push(push);
133                            } else {
134                                myRunner.prices.push(push);
135                            }
136                        }
137                    });
138                }
139            } else {
140                if (typeof event !== "undefined") {
141                    console.log(indexEvent, "index to delete");
142                    indexToDelete.push(indexEvent);
143                }
144            }
145        });
146        indexToDelete.map(function (index) {
147            const eventToSave = JSON.parse(JSON.stringify($this.events[index]));
148            console.log("delete", $this.events[index].name);
149            $this.events.splice(index, 1);
150            $this.saveEvent(eventToSave);
151        });
152        callback();
153    };
154
155    this.saveEvent = function (event) {
156        const $this = this;
157        if ($this.saveData === true) {
158            $this.symfonyApi.saveEvent(event, true);
159        }
160    };
161
162    this.addEventsToThisEvents = function (events, now, callback) {
163        const $this = this;
164        events.map(function (event) {
165            const eventStart = parseInt(new Date(event.start).getTime() / 1000);
166            if (eventStart - now > 5 && eventStart - now < 70 && event["allow-live-betting"] === true) {
167                if (typeof $this.events.find(x => x.id === event.id) === "undefined") {
168                    let newEvent = {
169                        id: event.id,
170                        name: event.name,
171                        start: eventStart,
172                        "category-id": event["category-id"],
173                    };
174                    newEvent.runners = [];
175                    event.markets[0].runners.map(function (runner) {
176                        if (runner.status === "open") {
177                            const newRunner = {
178                                id: runner.id,
179                                name: runner.name,
180                                prices: [],
181                            };
182                            newEvent.runners.push(newRunner);
183                        }
184                    });
185                    if (newEvent.runners.length > 0) {
186                        console.log(newEvent.name, "start to record soon");
187                        $this.events.push(newEvent);
188                    }
189                }
190            }
191        });
192        callback();
193    };
194}
195
196module.exports = {
197    LastMinuteBet,
198};
Full Screen

test2.js

Source: test2.js Github

copy
1const { By, Key, Builder } = require("selenium-webdriver");
2require("chromedriver");
3
4//this is THE test
5async function test() {
6
7  const whatISearchFor = "jope";
8
9  //launch the browser
10  let driver = await new Builder().forBrowser("chrome").build();
11
12  //open the webpage
13  await driver.get("https://www.weekendshoes.ee/naistele/saapad.html");
14  console.log('\x1b[33m%s\x1b[0m',"Avasin veebilehe!");
15
16  //get the page title and log it
17  const pageTitle = await driver.getTitle();
18  console.log('\x1b[33m%s\x1b[0m',"Lehekülje nimi on:", pageTitle);
19
20  //set timeout for 10 seconds
21  //await driver.manage().setTimeouts({ implicit: 10000 });
22
23  //add item to wishlist
24  await driver.manage().setTimeouts({ implicit: 10000 });
25  const addToWishlist = await driver
26    .findElement(
27      By.xpath(
28        '//*[@id="amasty-shopby-product-list"]/div[3]/ol/li[14]/div/div[3]/div/div/a'
29      )
30    );
31    driver.executeScript('arguments[0].click();',addToWishlist);
32  console.log('\x1b[33m%s\x1b[0m',"Lisasin ägedad saapad lemmikute nimekirja!");
33
34  // open wishlist menu
35  await driver.manage().setTimeouts({ implicit: 10000 });
36  const openWishlistMenu = await driver.findElement(By.xpath(`//*[@id="wishlist-link"]`));
37  driver.executeScript('arguments[0].click();',openWishlistMenu);
38  console.log('\x1b[33m%s\x1b[0m',"Leidsin südame ja klikin sellele");
39
40  //open my wishlist
41  await driver.manage().setTimeouts({ implicit: 10000 });
42  await driver.findElement(By.className(`action primary go-to-wishlist`)).click();
43  console.log('\x1b[33m%s\x1b[0m',"Lähen vaatan oma lemmikute nimekirja");
44
45  //open item page
46  await driver.manage().setTimeouts({ implicit: 10000 });
47  await driver
48    .findElement(By.className(`page hover-image hover-image-product-id-471445`))
49    .click();
50  console.log('\x1b[33m%s\x1b[0m',"Avan selle toote, mida osta soovin");
51
52  //open dropdown menu to choose size
53  await driver.manage().setTimeouts({ implicit: 10000 });
54  await driver
55    .findElement(
56      By.className(
57        `selectric-wrapper selectric-super-attribute-select selectric-hover selectric-open selectric-below`
58      )
59    )
60    .click();
61  console.log('\x1b[33m%s\x1b[0m',"Hakkan suurust valima");
62
63  //choose the shoe size
64  await driver.manage().setTimeouts({ implicit: 10000 });
65  await driver
66    .findElement(
67      By.xpath(
68        '//*[@id="product-options-wrapper"]/div/div/div/div/div[3]/div/ul/li[4]/div[1]'
69      )
70    )
71    .click();
72  console.log('\x1b[33m%s\x1b[0m',"Valisin nr 38 saapad");
73
74  //add product to cart
75  await driver.manage().setTimeouts({ implicit: 10000 });
76  await driver.findElement(By.id(`product-addtocart-button`)).click();
77  console.log('\x1b[33m%s\x1b[0m',"Lisan need imelised saapad ostukorvi");
78
79  //navigate to cart
80  await driver.manage().setTimeouts({ implicit: 10000 });
81  await driver.findElement(By.className(`action showcart active`)).click();
82  await driver
83    .findElement(
84      By.xpath('//*[@id="minicart-content-wrapper"]/div[2]/div[4]/div/a/span')
85    )
86    .click();
87  console.log('\x1b[33m%s\x1b[0m',"Lähen oma ostukorvi vaatama");
88
89  //increase the quantity by 1
90  await driver.manage().setTimeouts({ implicit: 10000 });
91  await driver.findElement(By.id(`increase-cart-qty-btn-5611753`)).click();
92  console.log('\x1b[33m%s\x1b[0m',"Lisan ühed saapad veel juurde");
93
94  //remove item from cart
95  await driver.manage().setTimeouts({ implicit: 10000 });
96  await driver
97    .findElement(
98      By.xpath(`//*[@id="shopping-cart-table"]/tbody/tr[1]/td[6]/a/span`)
99    )
100    .click();
101  console.log('\x1b[33m%s\x1b[0m',"Mõtlesin ümber, eemaldan need saapad ostukorvist");
102
103  //search for "jope"
104  await driver.manage().setTimeouts({ implicit: 10000 });
105  await driver
106    .findElement(By.id(`search`))
107    .sendKeys(whatISearchFor, Key.RETURN);
108  console.log('\x1b[33m%s\x1b[0m',"Otsisin parem jopesid");
109
110  //sort search result by popularity
111  await driver.manage().setTimeouts({ implicit: 10000 });
112  await driver.findElement(By.css(`#sorter [value="bestsellers"]`)).click();
113  console.log('\x1b[33m%s\x1b[0m',"Reastasin joped populaarsuse järgi");
114
115}
116
117test();
118
Full Screen

test.js

Source: test.js Github

copy
1const {Builder, By, Key, until} = require('selenium-webdriver');
2// const {Builder,By,Key,until} = require('selenium-webdriver'); 
3const webdriver = require('selenium-webdriver'); 
4const chrome = require('selenium-webdriver/chrome'); 
5// const chrome = require('selenium-webdriver/chrome');  
6// chrome.setDefaultService(new chrome.ServiceBuilder('D:\chromedriver.exe').build());
7
8
9(async function myFunction() {
10
11    const driver = await new webdriver.Builder().forBrowser('chrome').build(); 
12    //your code inside this block
13
14    await driver.get('http://localhost:3500/tda/'); 
15    driver.manage().window().maximize()
16	await driver.manage().setTimeouts( { implicit: 10000 } );
17			
18	await driver.findElement(By.xpath('//*[@id="tda-trace-view"]')).click();
19	
20	await driver.manage().setTimeouts( { implicit: 10000 } );
21	await driver.findElement(By.xpath('//*[@id="miApplication"]/body/tda-root/mia-home/mia-body/nz-spin/div/div/nz-tabset/div/div/div/mia-page-layer/div/tda-trace-view/div/div[2]/nz-header/div/div[1]/button[1]')).click();
22    const day = await driver.findElement(By.xpath('//*[@id="cdk-overlay-0"]/nz-modal-container/div/div/div[2]/tda-dataset-config/div/div[1]/div/input')).click();
23	await driver.manage().setTimeouts( { implicit: 10000 } );
24	await driver.findElement(By.xpath('//*[@id="cdk-overlay-0"]/nz-modal-container/div/div/div[2]/tda-dataset-config/div/div[1]/div/input')).sendKeys('150');
25	await driver.manage().setTimeouts( { implicit: 10000 } );
26    // Equipment
27    await driver.findElement(By.xpath('//*[@id="cdk-overlay-0"]/nz-modal-container/div/div/div[2]/tda-dataset-config/div/div[3]/div[6]/div/nz-select/nz-select-top-control/nz-select-placeholder')).click();
28    await driver.manage().setTimeouts( { implicit: 10000 } );
29	await driver.findElement(By.xpath('//*[@id="cdk-overlay-1"]/nz-option-container/div/cdk-virtual-scroll-viewport/div[1]/nz-option-item[1]/div')).click();
30    await driver.findElement(By.xpath('//*[@id="cdk-overlay-1"]/nz-option-container/div/cdk-virtual-scroll-viewport/div[1]/nz-option-item[4]/div[1]')).click();
31	await driver.findElement(By.xpath('//*[@id="cdk-overlay-0"]/nz-modal-container/div/div/div[2]/tda-dataset-config/div/div[3]/div[6]/div/nz-select/nz-select-top-control')).click();
32	await driver.manage().setTimeouts( { implicit: 10000 } );
33    // Chamber
34    await driver.manage().setTimeouts( { implicit: 20000 } );
35	await driver.findElement(By.xpath('//*[@id="cdk-overlay-0"]/nz-modal-container/div/div/div[2]/tda-dataset-config/div/div[3]/div[7]/div/nz-select/nz-select-top-control/nz-select-placeholder')).click();
36	await driver.findElement(By.xpath('//*[@id="cdk-overlay-2"]/nz-option-container/div/cdk-virtual-scroll-viewport/div[1]/nz-option-item[1]/div')).click();
37    await driver.manage().setTimeouts( { implicit: 20000 } );
38	await driver.findElement(By.xpath('//*[@id="cdk-overlay-0"]/nz-modal-container/div/div/div[2]/tda-dataset-config/div/div[3]/div[7]/div/nz-select/nz-select-top-control')).click();
39    // Recipe
40    await driver.manage().setTimeouts( { implicit: 20000 } );
41	await driver.findElement(By.xpath('//*[@id="cdk-overlay-0"]/nz-modal-container/div/div/div[2]/tda-dataset-config/div/div[3]/div[9]/button')).click();
42	await driver.manage().setTimeouts( { implicit: 30000 } );
43	await driver.findElement(By.xpath('//*[@id="ag-82-input"]')).click();
44	await driver.manage().setTimeouts( { implicit: 30000 } );
45	await driver.findElement(By.xpath('//*[@id="cdk-overlay-3"]/div/ul/li/button')).click();
46	await driver.findElement(By.xpath('//*[@id="cdk-overlay-0"]/nz-modal-container/div/div/div[3]/button[2]')).click();
47
48    // Parameter
49	await driver.manage().setTimeouts( { implicit: 30000 } );
50	await driver.findElement(By.xpath('//*[@id="ag-241-input"]')).click();
51	await driver.findElement(By.xpath('//*[@id="ag-237-input"]')).click();
52
53	// Step
54	await driver.manage().setTimeouts( { implicit: 20000 } );
55	await driver.findElement(By.xpath('//*[@id="miApplication"]/body/tda-root/mia-home/mia-body/nz-spin/div/div/nz-tabset/div/div/div/mia-page-layer/div/tda-trace-view/div/div[2]/nz-layout/nz-sider/div/tda-trace-view-condition-config/div[2]/div/form/nz-form-item/nz-form-control/div/div/input')).click();
56	await driver.findElement(By.xpath('//*[@id="miApplication"]/body/tda-root/mia-home/mia-body/nz-spin/div/div/nz-tabset/div/div/div/mia-page-layer/div/tda-trace-view/div/div[2]/nz-layout/nz-sider/div/tda-trace-view-condition-config/div[2]/div/form/nz-form-item/nz-form-control/div/div/input')).sendKeys('1,2,3,4');
57
58	// Filter
59	await driver.manage().setTimeouts( { implicit: 20000 } );
60	await driver.findElement(By.xpath('//*[@id="miApplication"]/body/tda-root/mia-home/mia-body/nz-spin/div/div/nz-tabset/div/div/div/mia-page-layer/div/tda-trace-view/div/div[2]/nz-layout/nz-sider/div/tda-trace-view-condition-config/div[1]/h3/button')).click();
61	// await driver.manage().setTimeouts( { implicit: 10000 } );
62	// await driver.findElement(By.xpath('//*[@id="cdk-overlay-4"]/nz-modal-container/div/div/div[2]/tda-trace-view-context-filter/div/div[1]/nz-radio-group/label[2]/span[1]/input')).click();
63	await driver.manage().setTimeouts( { implicit: 20000 } );
64	await driver.findElement(By.xpath('//*[@id="ag-501-input"]')).click();
65	await driver.findElement(By.xpath('//*[@id="cdk-overlay-4"]/nz-modal-container/div/div/div[3]/button[2]')).click();
66
67    // Run
68    await driver.manage().setTimeouts( { implicit: 20000 } );
69    await driver.findElement(By.xpath('//*[@id="miApplication"]/body/tda-root/mia-home/mia-body/nz-spin/div/div/nz-tabset/div/div/div/mia-page-layer/div/tda-trace-view/div/div[2]/nz-header/div/div[1]/button[2]')).click();
70
71	// chart option
72	await driver.manage().setTimeouts( { implicit: 10000 } );
73	await driver.findElement(By.xpath('//*[@id="miApplication"]/body/tda-root/mia-home/mia-body/nz-spin/div/div/nz-tabset/div/div/div/mia-page-layer/div/tda-trace-view/div/div[2]/nz-layout/nz-content/tda-trace-view-main/div/nz-tabset/div/div/div[1]/div/div[1]/div/button[1]')).click();
74	await driver.findElement(By.xpath('//*[@id="cdk-overlay-5"]/div/div/label/span[1]/input')).click();
75	await driver.findElement(By.xpath('//*[@id="cdk-overlay-5"]/div/div/div[2]/input[1]')).click();
76	await driver.findElement(By.xpath('//*[@id="cdk-overlay-5"]/div/div/div[2]/input[1]')).clear();
77	await driver.findElement(By.xpath('//*[@id="cdk-overlay-5"]/div/div/div[2]/input[1]')).sendKeys('-5');
78	await driver.manage().setTimeouts( { implicit: 10000 } );
79	await driver.findElement(By.xpath('//*[@id="cdk-overlay-5"]/div/div/div[3]/button[2]')).click();
80	await driver.manage().setTimeouts( { implicit: 10000 } );
81	await driver.findElement(By.xpath('//*[@id="miApplication"]/body/tda-root/mia-home/mia-body/nz-spin/div/div/nz-tabset/div/div/div/mia-page-layer/div/tda-trace-view/div/div[2]/nz-layout/nz-content/tda-trace-view-main/div/nz-tabset/div/div/div[1]/div/div[1]/div/button[1]')).click();
82	await driver.findElement(By.xpath('//*[@id="cdk-overlay-5"]/div/div/label/span[1]/input')).click();
83	await driver.findElement(By.xpath('//*[@id="cdk-overlay-5"]/div/div/div[3]/button[2]')).click();
84	
85	// Show Step Filter
86	await driver.manage().setTimeouts( { implicit: 10000 } );
87	await driver.findElement(By.xpath('//*[@id="miApplication"]/body/tda-root/mia-home/mia-body/nz-spin/div/div/nz-tabset/div/div/div/mia-page-layer/div/tda-trace-view/div/div[2]/nz-layout/nz-content/tda-trace-view-main/div/nz-tabset/div/div/div[1]/div/div[1]/div/button[3]')).click();
88	await driver.manage().setTimeouts( { implicit: 20000 } );
89	await driver.findElement(By.xpath('//*[@id="cdk-overlay-6"]/div/div/div[2]/div/div[2]/div/div[1]/div[2]/label/span[1]/input')).click();
90	await driver.manage().setTimeouts( { implicit: 10000 } );
91	await driver.findElement(By.xpath('//*[@id="cdk-overlay-6"]/div/div/div[2]/div/div[2]/div/div[2]/button')).click();
92
93	// Trace Context List
94	await driver.manage().setTimeouts( { implicit: 10000 } );
95	await driver.findElement(By.xpath('//*[@id="miApplication"]/body/tda-root/mia-home/mia-body/nz-spin/div/div/nz-tabset/div/div/div/mia-page-layer/div/tda-trace-view/div/div[2]/nz-layout/nz-content/tda-trace-view-main/div/nz-tabset/div/div/div[1]/div/div[1]/div/button[4]')).click();
96	await driver.manage().setTimeouts( { implicit: 10000 } );
97	await driver.findElement(By.xpath('//*[@id="ag-664-input"]')).click();
98	await driver.manage().setTimeouts( { implicit: 20000 } );
99	await driver.findElement(By.xpath('/html/body/div/div[2]/div/nz-modal-container/div/div/div[3]/button[2]')).click();
100
101	// View Data
102	await driver.manage().setTimeouts( { implicit: 10000 } );
103	await driver.findElement(By.xpath('//*[@id="miApplication"]/body/tda-root/mia-home/mia-body/nz-spin/div/div/nz-tabset/div/div/div/mia-page-layer/div/tda-trace-view/div/div[2]/nz-layout/nz-content/tda-trace-view-main/div/nz-tabset/div/div/div[1]/div/div[1]/div/button[5]')).click();
104	await driver.manage().setTimeouts( { implicit: 10000 } );
105	await driver.findElement(By.xpath('/html/body/div/div[2]/div/nz-modal-container/div/div/div[3]/button[2]')).click();
106
107	// show legend
108	await driver.manage().setTimeouts( { implicit: 10000 } );
109	await driver.findElement(By.xpath('//*[@id="miApplication"]/body/tda-root/mia-home/mia-body/nz-spin/div/div/nz-tabset/div/div/div/mia-page-layer/div/tda-trace-view/div/div[2]/nz-layout/nz-content/tda-trace-view-main/div/nz-tabset/div/div/div[1]/div/div[1]/div/button[2]')).click();
110	await driver.manage().setTimeouts( { implicit: 10000 } );
111	await driver.findElement(By.xpath('/html/body/div/div[2]/div/div/div/ul/li/label/span[1]/input')).click();
112	await driver.manage().setTimeouts( { implicit: 10000 } );
113	await driver.findElement(By.xpath('/html/body/div/div[2]/div/div/div/ul/li/label/span[1]/input')).click();
114	// await driver.manage().setTimeouts( { implicit: 20000 } );
115	// await driver.findElement(By.xpath('//*[@id="cdk-overlay-7"]/div/div/ul/li/label/span[1]/input')).click();
116	await driver.manage().setTimeouts( { implicit: 10000 } );
117	// await driver.findElement(By.xpath('//*[@id="miApplication"]/body/tda-root/mia-home/mia-body/nz-spin/div/div/nz-tabset/div/div/div/mia-page-layer/div/tda-trace-view/div/div[2]/nz-layout/nz-content/tda-trace-view-main/div/nz-tabset/div/div/div[1]/div/div[1]/div/button[2]')).click();
118	await driver.findElement(By.xpath('//*[@id="miApplication"]/body/div/div[1]')).click();
119	// groupview
120	await driver.manage().setTimeouts( { implicit: 10000 } );
121	await driver.findElement(By.xpath('//*[@id="miApplication"]/body/tda-root/mia-home/mia-body/nz-spin/div/div/nz-tabset/div/div/div/mia-page-layer/div/tda-trace-view/div/div[2]/nz-layout/nz-content/tda-trace-view-main/div/nz-tabset/nz-tabs-nav/div/div/div[2]/div')).click();
122	// await driver.findElement(By.xpath('')).click();
123
124	// chamber to chamber
125	// await driver.manage().setTimeouts( { implicit: 10000 } );
126	// await driver.findElement(By.xpath('//*[@id="ag-487-input"]')).click();
127	// await driver.findElement(By.xpath('//*[@id="ag-489-input"]')).click();
128	// await driver.manage().setTimeouts( { implicit: 10000 } );
129	// await driver.findElement(By.xpath('//*[@id="miApplication"]/body/tda-root/mia-home/mia-body/nz-spin/div/div/nz-tabset/div/div/div/mia-page-layer/div/tda-summary/div/nz-layout/div[2]/nz-layout/nz-content/div/nz-tabset/div/div/div[2]/div/tda-summary-group-main/div[2]/div[1]/div[1]/dl/dd[7]/button')).click();
130	// // expand
131	// await driver.manage().setTimeouts( { implicit: 10000 } );
132	// await driver.findElement(By.xpath('//*[@id="idx"]/div[1]/span/i')).click();
133	// await driver.findElement(By.xpath('//*[@id="cdk-overlay-5"]/nz-modal-container/div/div/div[3]/button[2]')).click();
134	
135	// recipe to recipe
136	await driver.manage().setTimeouts( { implicit: 10000 } );
137	await driver.findElement(By.xpath('/html/body/tda-root/mia-home/mia-body/nz-spin/div/div/nz-tabset/div/div/div/mia-page-layer/div/tda-trace-view/div/div[2]/nz-layout/nz-content/tda-trace-view-main/div/nz-tabset/div/div/div[2]/div/tda-group-main/div[1]/div/button')).click();
138	await driver.findElement(By.xpath('/html/body/div/div[2]/div/div/ul/li[2]')).click();
139	await driver.findElement(By.xpath('//*[@id="ag-617-input"]')).click();
140	await driver.manage().setTimeouts( { implicit: 10000 } );
141	await driver.findElement(By.xpath('/html/body/tda-root/mia-home/mia-body/nz-spin/div/div/nz-tabset/div/div/div/mia-page-layer/div/tda-trace-view/div/div[2]/nz-layout/nz-content/tda-trace-view-main/div/nz-tabset/div/div/div[2]/div/tda-group-main/div[2]/div[1]/div[1]/dl/dd[7]/button')).click();
142	// Step Filter
143	await driver.manage().setTimeouts( { implicit: 10000 } );
144	await driver.findElement(By.xpath('//*[@id="miApplication"]/body/tda-root/mia-home/mia-body/nz-spin/div/div/nz-tabset/div/div/div/mia-page-layer/div/tda-trace-view/div/div[2]/nz-layout/nz-content/tda-trace-view-main/div/nz-tabset/div/div/div[2]/div/tda-group-main/div[2]/div[2]/div/tda-group-recipe-chart/div[1]/div/button[2]')).click();
145	await driver.manage().setTimeouts( { implicit: 10000 } );
146	await driver.findElement(By.xpath('/html/body/div/div/div/div/div/div[2]/div/div[2]/div/div[1]/div[2]/label/span[1]/input')).click();
147	await driver.manage().setTimeouts( { implicit: 10000 } );
148	await driver.findElement(By.xpath('/html/body/div/div/div/div/div/div[2]/div/div[2]/div/div[2]/button')).click();
149	// X Axis
150	await driver.manage().setTimeouts( { implicit: 10000 } );
151	await driver.findElement(By.xpath('/html/body/tda-root/mia-home/mia-body/nz-spin/div/div/nz-tabset/div/div/div/mia-page-layer/div/tda-trace-view/div/div[2]/nz-layout/nz-content/tda-trace-view-main/div/nz-tabset/div/div/div[2]/div/tda-group-main/div[2]/div[2]/div/tda-group-recipe-chart/div[2]/div/div[1]/div/span[1]/select')).click();
152	await driver.manage().setTimeouts( { implicit: 20000 } );
153	await driver.findElement(By.xpath('/html/body/tda-root/mia-home/mia-body/nz-spin/div/div/nz-tabset/div/div/div/mia-page-layer/div/tda-trace-view/div/div[2]/nz-layout/nz-content/tda-trace-view-main/div/nz-tabset/div/div/div[2]/div/tda-group-main/div[2]/div[2]/div/tda-group-recipe-chart/div[2]/div/div[1]/div/span[1]/select/option[2]')).click();
154	await driver.manage().setTimeouts( { implicit: 10000 } );
155	await driver.findElement(By.xpath('/html/body/tda-root/mia-home/mia-body/nz-spin/div/div/nz-tabset/div/div/div/mia-page-layer/div/tda-trace-view/div/div[2]/nz-layout/nz-content/tda-trace-view-main/div/nz-tabset/div/div/div[2]/div/tda-group-main/div[2]/div[2]/div/tda-group-recipe-chart/div[2]/div/div[1]/div/span[1]/select')).click();
156	// await driver.findElement(By.xpath('//*[@id="cdk-overlay-12"]/div/div/div[2]/div/div[2]/div/div[2]/button')).click();
157	// show lengend
158	await driver.manage().setTimeouts( { implicit: 10000 } );
159	await driver.findElement(By.xpath('//*[@id="miApplication"]/body/tda-root/mia-home/mia-body/nz-spin/div/div/nz-tabset/div/div/div/mia-page-layer/div/tda-trace-view/div/div[2]/nz-layout/nz-content/tda-trace-view-main/div/nz-tabset/div/div/div[2]/div/tda-group-main/div[2]/div[2]/div/tda-group-recipe-chart/div[1]/div/button[1]')).click();
160	await driver.findElement(By.xpath('//*[@id="cdk-overlay-12"]/div/div/ul/li/label/span[1]/input')).click();
161	await driver.manage().setTimeouts( { implicit: 10000 } );
162	await driver.findElement(By.xpath('/html/body/div/div[1]')).click();
163    
164	
165	// setTimeout(async () => { 
166    //     await driver.quit(); 
167    //     process.exit(0); }
168    //     , 3000); 
169
170})();
171
172
173
174
175  
Full Screen

Accelerate Your Automation Test Cycles With LambdaTest

Leverage LambdaTest’s cloud-based platform to execute your automation tests in parallel and trim down your test execution time significantly. Your first 100 automation testing minutes are on us.

Try LambdaTest

Run JavaScript Tests on LambdaTest Cloud Grid

Execute automation tests with Webdriverio on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free
LambdaTestX

We use cookies to give you the best experience. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. Learn More in our Cookies policy, Privacy & Terms of service

Allow Cookie
Sarah

I hope you find the best code examples for your project.

If you want to accelerate automated browser testing, try LambdaTest. Your first 100 automation testing minutes are FREE.

Sarah Elson (Product & Growth Lead)