முக்கிய உள்ளடக்கத்திற்குச் செல்லவும்

custom$

custom$ உங்களை browser.addLocatorStrategy பயன்படுத்தி அறிவிக்கப்பட்ட தனிப்பயன் உத்தியைப் பயன்படுத்த அனுமதிக்கிறது. தனிப்பயன் தேர்வி உத்திகள் பற்றி Selector docs இல் மேலும் படிக்கவும்.

பயன்பாடு
$(selector).custom$(strategyName, strategyArguments)
அளவுருக்கள்
பெயர்வகைவிவரங்கள்
strategyNamestring
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')
await browser.addLocatorStrategy('myStrat', (selector) => {
return document.querySelectorAll(selector)
})

const header = await browser.custom$('myStrat', 'header')
const projectTitle = await header.custom$('myStrat', '.projectTitle')

console.log(projectTitle.getText()) // WEBDRIVER I/O
})
திரும்பப் பெறுகிறது
  • <WebdriverIO.Element>

Welcome! How can I help?

WebdriverIO AI Copilot