Before you jump the gun and refer me to other threads, please read through my objective and challenge at least once.
What is my aim? - I am trying to upload 1 column csv file into PeopleSoft ERP page. Unfortunately, I cannot share the screen but will attempt to describe my challenge in detail.
What have I accomplished? - I can input the file successfully. No problems there
My challenge - After every row of upload, I need to have a tab or enter key to activate another hyperlink on the same row on the page. I have the code working on what I need to do post activating that hyperlink but being able to simulate the tab or enter key is the main challenge. Somehow I am not able to find the element ID of the field where the file rows are being uploaded.
My code looks like this:
Code: Select all
SET !DATASOURCE C:\myMenus.csv
SET !DATASOURCE_COLUMNS 1
SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}}
SET !VAR2 {{!LOOP}}
ADD !VAR2 1
FRAME NAME="TargetContent"
TAG POS={{!LOOP}} TYPE=IMG ATTR=SRC:http://11.25.32.175/cs/finsnd91/cache/PT_ADD_1.gif
wait seconds=0.5
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:win0 ATTR=ID:PSACLMENU_VW2_MENUNAME${{!LOOP}} CONTENT={{!COL1}}
wait seconds=0.5
'Simulating enter or tab key code here. Following line does not work but just opens in a new window
'URL GOTO=javascript:var<SP>e=document.createEvent("KeyboardEvent");e.initKeyEvent("keypress",1,1,window,0,0,0,0,13,13);document.body.dispatchEvent(e);
TAG POS=1 TYPE=A ATTR=ID:DERIVED_MENU2_SELECT_FLAG${{!LOOP}}
TAG POS=1 TYPE=INPUT:BUTTON FORM=NAME:win0 ATTR=ID:SELECT_ALL_BTN$0
wait seconds=0.5
TAG POS=1 TYPE=INPUT:BUTTON FORM=NAME:win0 ATTR=ID:#ICSave
wait seconds=0.5
TAG POS={{!VAR2}} TYPE=IMG ATTR=SRC:http://11.25.32.175/cs/finsnd91/cache/PT_ADD_1.gif
wait seconds=0.5
http://forum.imacros.net/viewtopic.php?f=6&p=53355
http://www.webdeveloper.com/forum/showt ... Simulation
Details of my machine and setup:
1. What version of iMacros are you using? - 6060703
2.What operating system are you using? - Windows 7 English
3. Which browser(s) are you using? IE 9, Firefox 17 and Chrome 30.0.1599.69 m
4. Do the included demo macros work ok? - Yes
5. If reporting a problem with the Scripting Interface, please also test if the included VBS sample scripts run ok. - Yes. these work fine
6. If recording or replay fails on a specific website:- Not applicable
7. Do you encounter the same problem with the iMacros Browser, iMacros for Internet Explorer and iMacros for Firefox? - Well, technically not applicable as the code hasnt been figured out.
Thank you in advance.