நீண்ட அழுத்தம்
திரையில் கொடுக்கப்பட்ட கூறுவில் நீண்ட அழுத்த சைகையை செய்கிறது.
இது தேர்ந்தெடுக்கப்பட்ட கூறுவிற்கு WebDriver action
கட்டளையை வழங்குகிறது. இது click
கட்டளையை அடிப்படையாகக் கொண்டது.
தகவல்
இந்த கட்டளை பின்வரும் புதுப்பிக்கப்பட்ட கூறுகளுடன் மட்டுமே செயல்படுகிறது:
- Appium சர்வர் (பதிப்பு 2.0.0 அல்லது அதற்கு மேல்)
appium-uiautomator2-driver
(Android-க்கு)appium-xcuitest-driver
(iOS-க்கு)
இணக்க சிக்கல்களைத் தவிர்க்க உங்கள் உள்ளூர் அல்லது கிளவுட் அடிப்படையிலான Appium சூழல் வழக்கமாக புதுப்பிக்கப்படுவதை உறுதிசெய்யவும்.
பயன்பாடு
$(selector).longPress({ x, y, duration })
அளபுருக்கள்
பெயர் | வகை | விவரங்கள் |
---|---|---|
options விருப்பத்தேர்வு | LongPressOptions | நீண்ட அழுத்த விருப்பங்கள் (விருப்பத்தேர்வு) |
options.x விருப்பத்தேர்வு | number | எண் (விருப்பத்தேர்வு) |
options.y விருப்பத்தேர்வு | number | எண் (விருப்பத்தேர்வு) |
options.duration விருப்பத்தேர்வு | number | ms-ல் அழுத்தத்தின் கால அளவு, இயல்புநிலை 1500 ms MOBILE-மட்டும் |
எடுத்துக்காட்டுகள்
longpress.offset.js
it('should demonstrate a longPress using an offset on the iOS Contacts icon', async () => {
const contacts = $('~Contacts')
// opens the Contacts menu on iOS where you can quickly create
// a new contact, edit your home screen, or remove the app
// clicks 30 horizontal and 10 vertical pixels away from location of the icon (from center point of element)
await contacts.longPress({ x: 30, y: 10 })
})
longpress.example.js
it('should be able to open the contacts menu on iOS by executing a longPress of 5 seconds', async () => {
const contacts = $('~Contacts')
// opens the Contacts menu on iOS where you can quickly create
// a new contact, edit your home screen, or remove the app
await contacts.longPress({ duration: 5 * 1000 })
})