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

getValue பெறுதல்

கொடுக்கப்பட்ட தேர்வியால் கண்டறியப்பட்ட <textarea>, <select> அல்லது <input> உரை-ன் மதிப்பைப் பெறுங்கள். கொடுக்கப்பட்ட தேர்வியால் பல உறுப்புகள் கண்டறியப்பட்டால், மதிப்புகளின் வரிசை திருப்பி அனுப்பப்படும். செக்பாக்ஸ் அல்லது ரேடியோ வகை உள்ளீட்டிற்கு isSelected பயன்படுத்துங்கள்.

பயன்பாடு
$(selector).getValue()
எடுத்துக்காட்டுகள்
index.html
<input type="text" value="John Doe" id="username">
getValue.js
it('should demonstrate the getValue command', async () => {
const inputUser = await $('#username');
const value = await inputUser.getValue();
console.log(value); // outputs: "John Doe"
});
திரும்பப் பெறுபவை
  • <String> return: கோரப்பட்ட உறுப்பு(கள்) மதிப்பு

Welcome! How can I help?

WebdriverIO AI Copilot