Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

switch window

const assert = require('assert')

describe('v5.webdriver.io', () => {

    it('should switch to another window', async () => {

         // open url
        await browser.url('https://google.com')

        // create new window
         await browser.newWindow('https://v5.webdriver.io');
         await browser.pause(2000);

        // switch back via url match
        await browser.switchWindow('google.com')
        await browser.pause(2000);

         // switch back via title match
         await browser.switchWindow('Next-gen WebDriver test framework for Node.js')
        
         await browser.pause(2000);

        })
    
})
Comment

PREVIOUS NEXT
Code Example
Javascript :: print in javascript 
Javascript :: how to use post method in react 
Javascript :: jquery slider 
Javascript :: 10 javascript interview questions 
Javascript :: switch javascript 
Javascript :: js add timestamp clg 
Javascript :: redirect to dashboard after login in vue 
Javascript :: get datepicker value date 
Javascript :: jquery select element with class 
Javascript :: csurf in express 
Javascript :: html call variable javascript 
Javascript :: react if event.target is input 
Javascript :: node fs 
Javascript :: TypeError: path must be absolute or specify root to res.sendFile 
Javascript :: cm to inches 
Javascript :: accesing jest from bin 
Javascript :: breakout to external link in react js 
Javascript :: test each jest 
Javascript :: installing babel from command line 
Javascript :: knex.raw postgres how to add multiple parameters 
Javascript :: check if alpine js is activated in website 
Javascript :: javascript get the screen color depth 
Javascript :: querySelectorAll multiple lists 
Javascript :: how to use datepicker apply to send a get request 
Javascript :: leave page 
Javascript :: load jquery in console 
Javascript :: javascript get all elements of an id 
Javascript :: jsfuck 
Javascript :: api streamelements watchtime 
Javascript :: delay / sleep program in js 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =