overwriteCommand
உலாவியின் overwriteCommand
முறை உலாவி மற்றும் உறுப்புகளின் இயல்பான கட்டளைகளான pause
மற்றும் click
போன்றவற்றை மேலெழுத உதவுகிறது.
தகவல்
இதுபற்றிய மேலும் தகவலை தனிப்பயன் கட்டளை பிரிவில் காணலாம்.
பயன்பாடு
browser.overwriteCommand(name, callback, elementScope)
அளவுருக்கள்
பெயர் | வகை | விவரங்கள் |
---|---|---|
name | string | அசல் கட்டளையின் பெயர் |
callback | Function | அசல் செயல்பாட்டை அனுப்புகிறது |
elementScope விருப்பத்தேர்வு | Boolean | உலாவி பொருளுக்குப் பதிலாக உறுப்பு பொருளை நீட்டிக்கவும் |
எடுத்துக்காட்டு
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"
})