Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

fcus on element

const assert = require('assert')

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

    it('should detect the focus of an element', async () => {
        await browser.url('https://v5.webdriver.io');

        const inputsearch  = await $('#search_input_react');
        console.log('Search is focused befor click' + await inputsearch.isFocused()); // outputs: false
    
        await inputsearch.click();
        console.log ('Search is focused after click' +await inputsearch.isFocused()); // outputs: true
    })

})
 
PREVIOUS NEXT
Tagged: #fcus #element
ADD COMMENT
Topic
Name
4+7 =