Can not press enter key with textarea in imacros - imacros

I just tried to hit the enter key with imacros in firefox but doesnt work.
The photo of my div is:
The image of my div
I tried using the following code:
EVENT TYPE=KEYPRESS SELECTOR="HTML>BODY>#number>DIV:nth-of-type(5)>DIV:nth-of-type(3)>DIV:nth-of-type(2)>textarea" KEY=13
But not work why is not working keypress with imacros.
my version is:
8.9.7

Sometimes other key event types might help:
EVENT TYPE=KEYDOWN SELECTOR="HTML>BODY>#number>DIV:nth-of-type(5)>DIV:nth-of-type(3)>DIV:nth-of-type(2)>textarea" KEY=13
or
EVENT TYPE=KEYUP SELECTOR="HTML>BODY>#number>DIV:nth-of-type(5)>DIV:nth-of-type(3)>DIV:nth-of-type(2)>textarea" KEY=13

Related

How to scroll down inside followers popup on Instagram?

How can i properly use scroll function inside Instagram popup.
I used js function to scroll , which didnt worked
window.scrollBy(0,800);
via Imacros
EVENT TYPE=KEYPRESS SELECTOR="HTML>BODY" KEY=34
As well before scroll event used to click between users to make popup active and then used scroll, before it worked but for now it's not.
Is there any proper way to scroll inside popup?
I think the following command may be helpful:
EVENT TYPE=KEYPRESS SELECTOR="div.j6cq2" KEY=34
This works for me in 2019... Don't change anything!
FList = driver.find_element_by_css_selector('div[role=\'dialog\'] ul')
numberOfFollowersInList = len(FList.find_elements_by_css_selector('li'))
FList.click()
actionChain = webdriver.ActionChains(driver)
time.sleep(random.randint(2,4))
while (numberOfFollowersInList < max):
actionChain.key_down(Keys.SPACE).key_up(Keys.SPACE).perform()
numberOfFollowersInList = len(FList.find_elements_by_css_selector('li'))
time.sleep(0.4)
print(numberOfFollowersInList)
actionChain.key_down(Keys.SPACE).key_up(Keys.SPACE).perform()
time.sleep(1)

How to trigger tooltip using iMacros

I want to capture the screenshots of tooltip which appears when I mouseover the image. The image contains title attribute. The code mentioned below is higlighting the image with a border but its not showing the tooltip.
TAG POS=3 TYPE=IMG ATTR=HREF:http://* CONTENT=EVENT:MOUSEOVER
You should use the EVENT commant instead of TAG in this case, e.g.:
EVENT TYPE=MOUSEDOWN XPATH=".//body/descendant::img[3]" BUTTON=0
more info: Imacros wiki > EVENT

imacros: submitting textarea form (enter key maybe?)

Question: How to simulate an ENTER (to submit a text in a live chat)?
(if there is an alternative to using the ENTER key, like using javascript in imacros to trigger an event, that would be great too)
Explanation:
I am trying to submit a comment in a live chat that uses a <textarea> element for input. Here is the source code:
<form class="chatbox nolabel">
<textarea class="textbox" type="text" size="70" autocomplete="off" name="message" style="resize: none; overflow-y: hidden;"></textarea>
</form>
I have attempted various different approaches of inputting the word "hello" and pressing the ENTER key (so that hello is sent to the users reading), however the only thing I am capable of doing is inputting the word "hello".
Attempt 1:
TAG POS=1 TYPE=TEXTAREA FORM=NAME:NoFormName ATTR=NAME:message CONTENT=hi
Results from Attempt 1:
When recording, this is the code that appeared when I started typing in the text area, and it successfully places the content into the textarea, however I didn't see any code being recorded when I press the ENTER key, so I assume that is the issue in this case.
Attempt 2: (event recording mode)
EVENTS TYPE=KEYPRESS SELECTOR="HTML>BODY>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>DIV>DIV:nth-of-type(2)>FORM>TEXTAREA:nth-of-type(2)" CHARS="hi"
WAIT SECONDS=1
EVENT TYPE=KEYPRESS SELECTOR="HTML>BODY>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>DIV>DIV:nth-of-type(2)>FORM>TEXTAREA:nth-of-type(2)" KEY=13
Results from Attempt 1:
In this case, I tried using the Keypress type with events to simulate hitting the ENTER key, however what resulted was getting a "hi(newline)".
Any ideas?
Sometimes other key event types may help:
EVENT TYPE=KEYDOWN SELECTOR="HTML>BODY>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>DIV>DIV:nth-of-type(2)>FORM>TEXTAREA:nth-of-type(2)" KEY=13
or
EVENT TYPE=KEYUP SELECTOR="HTML>BODY>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>DIV>DIV:nth-of-type(2)>FORM>TEXTAREA:nth-of-type(2)" KEY=13

Enter key not working in imacros

I want my form to submit when I hit the Enter key in the search input control, because the submit button is not available.
When I hit Enter manually it's working properly: the search keyword is submitted successfully. But when I record the successful keypress event using iMacros, it does not do anything during the replay. The event is recorded as KEY=13.
The iMacros code I'm using:
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV>DIV>SECTION>ASIDE>DIV>DIV>UL>LI:nth-of-type(7)>DIV>UL>LI:nth-of-type(2)>BUTTON" BUTTON=0
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV>DIV>SECTION>ASIDE>DIV>DIV>UL>LI:nth-of-type(7)>DIV>FORM:nth-of-type(2)>TEXTAREA" BUTTON=0
EVENTS TYPE=KEYPRESS SELECTOR="HTML>BODY>DIV>DIV>SECTION>ASIDE>DIV>DIV>UL>LI:nth-of-type(7)>DIV>FORM:nth-of-type(2)>TEXTAREA" CHARS="2nd search"
EVENT TYPE=KEYPRESS SELECTOR="HTML>BODY>DIV>DIV>SECTION>ASIDE>DIV>DIV>UL>LI:nth-of-type(7)" KEY=13
Here is the test page of my case: http://zeccartourisme.com/test.html

APEX: How to Submit page when 'Enter' pressed on field

I have a page with one field only. How can user submit the page by pressing 'Enter' without having to click the 'Submit' button? User should therefore be able to either press 'Enter' or click 'Submit'. Thank you.
APEX text items have a property "Submit when Enter pressed". Set this to Yes and you are almost done. The APEX request is set to the name of the item so that you can, if you need to, have submit processing that depends on this e.g. PL/SQL Condition:
:request in ('SUBMIT','P1_MY_TEXT_ITEM')
What is your APEX version ?
If you are using APEX 4, you can try this JQuery code :
$('#YOUR_TEXTFIELD_ID').keyup(function(e) {
if (e.keyCode == '13')
$('#YOUR_BUTTON').trigger('click');
});
It works only if any onclick event has been defined for the button, else simply call apex.submit(...) instead.