Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Browser automation for repetitive tasks

Options
  • 28-08-2017 2:00pm
    #1
    Registered Users Posts: 16,126 ✭✭✭✭


    Hey guys,

    There's a bit of a silly question. As part of my daily tasks I have to regularly open up a jira ticket with multiple confluence pages linked. This takes up to 10 minutes. However it's really just cloning tickets and copying info from one page to another.

    What's the best way to automate it?

    Generally I'd use something like macro express. Create a menu and pop in all the info, and let it do it's thing. However half my team use MAC and half use Windows. So that's macroexpress and autohotkey out of the question.

    I'd create a webpage that would copy the info in, use some JS and automate it that way but I can't put custom JS into confluence as it's pretty much locked down.

    Any suggestions? At this point I'm thinking a custom chrome plugin but I thought I'd see if anyone had any experience in a similar situation.


Comments

  • Registered Users Posts: 1,713 ✭✭✭Bonavox


    Selenium?


  • Registered Users Posts: 16,126 ✭✭✭✭Grayson


    Bonavox wrote: »
    Selenium?

    My team aren't that technical. I've used it with eclipse for browser/php testing but it's a bit overkill for just filling out webpages.


  • Registered Users Posts: 2,401 ✭✭✭billbond4


    How about imacros on Firefox?


  • Registered Users Posts: 1,078 ✭✭✭db


    iMacros plugin for Chrome?


  • Registered Users Posts: 16,126 ✭✭✭✭Grayson


    db wrote: »
    iMacros plugin for Chrome?

    I checked it out but I was wondering about security concerns. Does it check metadata stored in the cloud?


  • Advertisement
  • Registered Users Posts: 3,945 ✭✭✭Anima


    How do you mean? It doesn't record any data and only runs locally.


  • Registered Users Posts: 16,126 ✭✭✭✭Grayson


    Anima wrote: »
    How do you mean? It doesn't record any data and only runs locally.

    I just saw that. I've been playing around with it for the last day. I've got 90% of what I want working with it. However I'm finding a couple of difficulties.

    I have a confluence page where i need to put some data into a table. It's only 3 cells but I'm having trouble identifying the cells.

    all confluence tables have a class of confluenceTable

    each cell has the following HTML.
    <td class="confluenceTd"><insert></td>

    There's a few tables on the page. And there's no option to create a table with a particular ID so I'm a bit stuck.

    Any ideas?


  • Registered Users Posts: 3,945 ✭✭✭Anima


    Sorry do you mean you're trying to automate populating the confluence page via imacros or you're trying to read a table into some text file via imacros?

    When searching for tags, you can specify the position (POS=1) of it. So if there are 3 <td> tags, you can select the 2nd occurrence by using pos=2.


  • Registered Users Posts: 2,781 ✭✭✭amen


    I think Confluence and Jira have an API.

    Can you call the API directly to do what you want to do ?


  • Registered Users Posts: 16,126 ✭✭✭✭Grayson


    Anima wrote: »
    Sorry do you mean you're trying to automate populating the confluence page via imacros or you're trying to read a table into some text file via imacros?

    When searching for tags, you can specify the position (POS=1) of it. So if there are 3 <td> tags, you can select the 2nd occurrence by using pos=2.

    I'm trying that but it's not recognizing it.
    I'm trying to populate a table on a page via imacro. Because it's a confluence page and I can't use custom HTML on it I can't even insert a HTML table onto the page. I have to use the page as it is.
    amen wrote: »
    I think Confluence and Jira have an API.

    Can you call the API directly to do what you want to do ?

    Unfortunately it's locked down. I can't even use custom JS on any of he pages either.


  • Advertisement
  • Registered Users Posts: 6,013 ✭✭✭Talisman


    You could create your own browser plugin to do the task - a plugin is simply HTML & JS.


  • Registered Users Posts: 16,126 ✭✭✭✭Grayson


    Talisman wrote: »
    You could create your own browser plugin to do the task - a plugin is simply HTML & JS.

    That might be the way to go. I was hoping to make something in imacro's that anyone could modify (If I left the team and provided enough instructions) but I'm stuck on this one last thing. I'm not sure if imacro's can insert into a table. And confluence is so limited I can't put a form element into the page.

    Time for another stupid question: I can see that you can use javascript to run an imacro's script. I can't see how to do it the otherway. That is, have a JS function that is called on by imacro's. I could use JS to insert into the table element but I can't see how to make Imacro's do this.


  • Registered Users Posts: 16,126 ✭✭✭✭Grayson


    So to update. I left the project for a while and came back when I had time. Now it turns out that imacro's won't work with the latest version of chrome/firefox.

    So i'm creating a browser extension in chrome. It's working ok except I'm having trouble getting it to recognise and switch tabs when i need to to. I'm going to keep working at t and I'll post up some of it (minus the internal URL's) when I get it working.


  • Registered Users Posts: 3,945 ✭✭✭Anima


    IMacros does work on Chrome? It doesn't work on the latest Firefox though because they dropped support for their own extension format in place of WebExtensions (what Chrome uses).

    At any rate, you mentioned running JavaScript code against the browser. I'd try using something like this maybe: https://github.com/GoogleChrome/puppeteer

    Or using WebDriver in general. I still think iMacros can probably do what you're looking for though.


Advertisement