I am currently working on automating a feature for our web application, specifically a form of @mentioning similar to Facebook. On the front end, when a user types @ into a text input, the API is called to retrieve the list of users and display them in a box that appears. This element is located at the end of the DOM and remains invisible until triggered by Javascript upon typing @.
Despite using send_keys in my selenium code to populate the @username, the user window element does not appear, even if I do it manually while the browser is open via selenium.
I have attempted various methods such as the upkey event from Action Chains, injecting JavaScript to trigger the event, clicking back onto the text input to ensure focus, but nothing seems to work. This issue persists in both Chrome and Firefox.
I have searched extensively for solutions, but no luck so far. Any suggestions?
Feature step:
And I create a post titled "@James"
Implementation:
@when('I create a post titled "([^"]*)"')
def step_impl(context, text):
page = ActivityStreamPage.NewPost(context)
page.post_input.click()
page.post_input.send_keys(text)
Element:
'post_input': (By.CLASS_NAME, "js-post-textarea")
Web Element:
<div class="js-post-textarea js-edit-content editor__editable"
contenteditable="true" autocomplete="off" autocorrect="off"
autocapitalize="off" placeholder="Write a post or @mention to notify
someone"><span class="atwho-query">@</span><br></div>
User Box:
<div class="atwho-view" id="at-view-64" style="display: none; top:
135px; left: 440px;">
<ul class="atwho-view-ul">
<li class="mention__item cur">
<p class="mention__notice">
<span>@Group</span>
"Notify everyone in this Group."
</p>
</li>
</ul>
</div>