BLiTzKrIeGx1337 wrote: ↑Tue May 25, 2021 2:56 pm
Code: Select all
Windows 10 64b
FF 88.0.1 (64-bit)
iMacros 10101485 PE
I have a large macro that reads from a csv to create new products on the e-commerce site that I manage, the macro stats like this -
Code: Select all
SET !DATASOURCE C:\Users\forms\Desktop\AFDmacroCSVs\AFDUpdateNewTest.csv
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}
SET !TIMEOUT_STEP 100
URL GOTO=https://heraldpg.myprintdesk.net/DSF/Admin/ManageProducts.aspx?forcedToLoadOldClassic=true
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:aspnetForm ATTR=ID:ctl00_ctl00_C_M_ButtonCreateProduct
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:aspnetForm ATTR=ID:ctl00_ctl00_C_M_txtName CONTENT={{!COL1}}
WAIT SECONDS=1
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:aspnetForm ATTR=ID:ctl00_ctl00_C_M_btnNext
//the message would show up at this step
If a product already exists it will show a message and won't let me proceed until I change the name, so to keep the macro from stopping I have to check the list of new products, see which ones are just updates, and remove them. What I want to try to do is skip the current loop number if that message is detected on the page, but I'm not sure how to do that and have not had any luck searching for something like that.
This is the CSS Selector for the message that appears - #ctl00_ctl00_C_M__ItemNameMustBeUnique
If anyone knows how or knows a different way to do it that would be fantastic, thanks!
Hum..., and "again", your FCI is a bit "confusing", v10.1.0 is a Version for CR (and not even the "last"/"current" one (which is v10.1.1 [May 2021])), the only Version that works on FF88 is v10.0.2 for FF.
But OK, anyway, important part in your FCI is "PE", so you can indeed use a DataSource, and for that part, both v10.0.2 for FF and v10.1.x for CR should "behave" the same way...
>>>
Then, hum..., if I understand your Scenario correctly, well..., the easiest Solution I would think, is that you record once clicking/dismissing that Error Msg, and you always include it in the Script / for each Loop, and it will be clicked away if it appears, with stg like:
Code: Select all
SET !DATASOURCE C:\Users\forms\Desktop\AFDmacroCSVs\AFDUpdateNewTest.csv
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}
SET !TIMEOUT_STEP 100
URL GOTO=https://heraldpg.myprintdesk.net/DSF/Admin/ManageProducts.aspx?forcedToLoadOldClassic=true
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:aspnetForm ATTR=ID:ctl00_ctl00_C_M_ButtonCreateProduct
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:aspnetForm ATTR=ID:ctl00_ctl00_C_M_txtName CONTENT={{!COL1}}
WAIT SECONDS=1
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:aspnetForm ATTR=ID:ctl00_ctl00_C_M_btnNext
'//the message would show up at this step
SET !ERRORIGNORE YES
SET !TIMEOUT_STEP 0
TAG POS=1 TYPE=* ATTR=ID:*_ItemNameMustBeUnique
SET !ERRORIGNORE NO
SET !TIMEOUT_STEP 100
'... And proceed with the rest of your Script...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...