How do I click either of two links the SAME row of a table

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
evanspj1
Posts: 2
Joined: Sat Oct 29, 2011 6:38 am

How do I click either of two links the SAME row of a table

Post by evanspj1 » Mon Nov 07, 2011 12:55 pm

Hello,

I am using iMacros to automate uploading feedback files and updating the gradebook in the Moodle Learnign Management system.

Below is an image of the gradebook with the important columns being the student username and the status column. The status column will show either "Grade" or "Update" depending on if some feebback ahs already been given.
gradebookinmoodle.jpg
the gradebook in Moodle
The macro searches for the student username and then "clicks" the next "Grade". This works find as shown below:

TAG POS=1 TYPE=TD ATTR=TXT:demo002
TAG POS=R1 TYPE=A ATTR=TXT:Grade

I then want to make is a little smarter and let it click either "Grade" or "Update" and this works with

TAG POS=1 TYPE=TD ATTR=TXT:demo002
'set !errorignore = yes allows imacros to continue even through there is an error ... effectively ORing the two links "update" or "grade"
'SET !ERRORIGNORE YES
'TAG POS=R1 TYPE=A ATTR=TXT:Update
TAG POS=R1 TYPE=A ATTR=TXT:Grade
'SET !ERRORIGNORE NO

The problem is that I want it to "click" the update or the grade link for that specific student (in that row of the table) and not click the link in the next row.

How can I use POS to search for the next link (either "grade" or "update" in the current row?

Any assistance gratefully received.

Peter Evans
eMarkingAssistant.com
MattBell7
Posts: 627
Joined: Thu Nov 26, 2009 11:07 am
Location: United Kingdom

Re: How do I click either of two links the SAME row of a tab

Post by MattBell7 » Mon Nov 07, 2011 1:07 pm

change TXT:Grade to TXT:* but please note, this will click the next link, regardless of what it says, so not just update/grade
Tom, Tech Support
Posts: 3526
Joined: Mon May 31, 2010 4:59 pm

Re: How do I click either of two links the SAME row of a tab

Post by Tom, Tech Support » Fri Nov 18, 2011 6:25 pm

Hello evanspj1,

What version of iMacros are you using? With the iMacros Browser and iMacros for IE, you can limit the search range of the TAG command by setting the !ENDOFPAGE variable.

http://wiki.imacros.net/Data_Extraction ... arch_range
Regards,

Tom, iMacros Support
Post Reply