मुख्य सामग्री पर जाएं
🇺🇦  We stand with the people of Ukraine. We encourage compassion, and hope for peace.   🇺🇦
Please support humanitarian efforts for the Ukraine crisis through the International Committee of the Red Cross! #StandWithUkraine

overwriteCommand

ब्राउज़र विधि overwriteCommand आपको ब्राउज़र और एलिमेंट के मूल कमांड जैसे pause और click को ओवरराइट करने में मदद करती है।

जानकारी

आप इस पर अधिक जानकारी कस्टम कमांड अनुभाग में देख सकते हैं।

उपयोग
browser.overwriteCommand(name, callback, elementScope)
पैरामीटर्स
नामप्रकारविवरण
namestringमूल कमांड का नाम
callbackFunctionमूल फंक्शन पास करें
elementScope
वैकल्पिक
BooleanBrowser ऑब्जेक्ट के बजाय Element ऑब्जेक्ट का विस्तार करें
उदाहरण
execute.js
// print milliseconds before pause and return its value.
await browser.overwriteCommand('pause', function (origPauseFunction, ms) {
console.log(`Sleeping for ${ms}`)
origPauseFunction(ms)
return ms
})

// usage
it('should use my overwrite command', async () => {
await browser.url('https://webdriver.io')
await browser.pause(1000) // outputs "Sleeping for 1000"
})

Welcome! How can I help?

WebdriverIO AI Copilot
Morty Proxy This is a proxified and sanitized view of the page, visit original site.