custom$
custom$
உங்களை browser.addLocatorStrategy
பயன்படுத்தி அறிவிக்கப்பட்ட தனிப்பயன் உத்தியைப் பயன்படுத்த அனுமதிக்கிறது.
தனிப்பயன் தேர்வி உத்திகள் பற்றி Selector docs இல் மேலும் படிக்கவும்.
பயன்பாடு
browser.custom$(strategyName, strategyArguments)
அளவுருக்கள்
பெயர் | வகை | விவரங்கள் |
---|---|---|
strategyName | string | |
strategyArguments | * |
எடுத்துக்காட்டுகள்
customStrategy.js
loading...
example.html
loading...
customStrategy.js
loading...
example.js
it('should fetch the project title', async () => {
await browser.url('https://webdriver.io')
browser.addLocatorStrategy('myStrat', (selector) => {
return document.querySelectorAll(selector)
})
const projectTitle = await browser.custom$('myStrat', '.projectTitle')
console.log(await projectTitle.getText()) // WEBDRIVER I/O
})
திருப்பி அனுப்புவது
- <WebdriverIO.Element>