-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Description
What happened?
I am navigating to a JIRA site and attempting to create a JIRA using Selenium and C# and the following configuration:
Edge Browser version 133.0.3065.82
Microsoft Edge WebDriver version: 133.0.3065.59
Selenium.WebDriver: 4.24.0
Selenium.Support: 4.24.0
.NET 8.0 Desktop - Windows Forms Application
In the code I click the “Create” button on the JIRA site and a “Create Issue” form appears. This form has a “textarea” for entering the description. When I generate the EdgeDriver using EdgeOptions containing “--headless”, the webdriver is unable to “SendKeys” or perform a copy/paste (using OpenQA.Selenium.Interactions.Actions with CTL+C and CTL+V) into the textarea.
However, if executed when NOT IN HEADLESS MODE, there are no issues performing either a SendKeys() or the Copy/Paste when interacting with the textarea.
The textarea HTML looks like this:
<div id="description-wiki-edit" class="wiki-edit-content">
<textarea class="textarea long-field wiki-textfield long-field mentionable wiki-editor-initialised wiki-edit-wrapped" id="description" name="description" wrap="virtual" data-qe-no-aria-labelled-by="true" data-use-new-endpoint="true" resolved="" style="min-height: 174px; max-height: 369px;" data-editor-id="1740509257556-5"></textarea>
<div class="rte-container">
<rich-editor contenteditable="true" data-issue-key="null" data-content-present="true" tabindex="-1" resolved=""></rich-editor>
</div>
<div class="content-inner"></div>
<div class="phantom-caret" style="top: 7.99716px; height: 0px;"></div>
<nav class="aui-navgroup aui-navgroup-horizontal editor-toggle-tabs">
<div class="aui-navgroup-inner">
<div class="aui-navgroup-primary">
<ul class="aui-nav" resolved="">
<li data-mode="wysiwyg">
<button type="button" class="aui-button" aria-pressed="false" resolved="">Visual</button>
</li>
<li data-mode="source" class="aui-nav-selected">
<button type="button" class="aui-button" aria-pressed="true" resolved="">Text</button>
</li>
</ul>
</div>
</div>
</nav>
<span class="aui-label editor-toggle-tooltip"></span>
</div>
And is within a pop-up form containing the textarea is defined like:
<section id="create-issue-dialog" class="aui-dialog2 aui-layer jira-dialog2 jira-dialog-core aui-dialog2-large jira-dialog-open jira-dialog-content-ready" role="dialog" aria-labelledby="jira-dialog2__heading" style="z-index: 3000;" data-aui-focus="false" data-aui-blanketed="true" open="" tabindex="-1">
My code to find and interact with the webelement looks like this:
IWebElement iweDescriptionText = driver.FindElement(By.Id("description"));
iweDescriptionText.Clear();
iweDescriptionText.SendKeys(“some text I want to send to the description textarea.”);
The SendKeys() command completes without issue but the text is not written to the text-area. If I attempt to access the Text property of the IWebElement afterwards it is an empty string.
Debug.WriteLine($"Set Description: \"{iweDescriptionText.Text}\"");
Again, this only fails when using the “--headless" EdgeOptions for WebDriver instantiation.
How can we reproduce the issue?
1) Using above configuration
2) Navigate to a Jira.Labs site in headless mode
3) Interact with the pop-up form displayed when clicking "Create".
4) Attempt to Set the text in the "Description" field.Relevant log output
I don't have relevant log information.Operating System
Windows 11 Pro
Selenium version
dotnet 8 - 4.24.0
What are the browser(s) and version(s) where you see this issue?
Edge Browser version 133.0.3065.82
What are the browser driver(s) and version(s) where you see this issue?
Microsoft Edge WebDriver version: 133.0.3065.59
Are you using Selenium Grid?
No response