I am facing a challenge with resizing a textarea that has a dynamic xpath. I am unable to use the following JavascriptExecutor commands:
(JavascriptExecutor) driver.executeScript("document.getElementById('someID').setAttribute('rows', '50')");
(JavascriptExecutor) driver.executeScript("document.getElementById('someID').setAttribute('cols', '60')");
due to the dynamic nature of attributes such as ID, value, and class. Is there an alternative method to resize the textarea? The HTML code for the element in question is:
<textarea name="comments" id="isc_4G3" $89="isc_TextAreaItem_25" $9a="$9b" class="textItem" style="margin:0px;WIDTH:1132px;HEIGHT:60px;" autocomplete="OFF" spellcheck="true" wrap="SOFT" tabindex="1863" oninput="isc_TextAreaItem_25.$43g()" handlenativeevents="false"></textarea>
I also attempted to resize the textarea using the following approach:
Actions action = new Actions(driver);
action.moveToElement(getInternalNotesTextArea()).clickAndHold().moveByOffset(xOffset, yOffset).release().perform();
However, this method was unsuccessful in resizing the textarea.