Use selenium to find size of [li] list - perl

I'm new to selenium and html, so forgive me if I ask something silly.
I'm using perl. There's a list of links on a sidebar. I have a list of links that should be present in this list once it's entirely expanded. Expanding was easy, i just did while elemnt is present link=[+], then click. I need to see if there are any extra that shouldn't be there. I'm not too sure how to do this. My plan was to compare the size of the list to what I expect it to be, but I'm not sure how to do this either.
Is there a simple way to do that, or perhaps a different way that also works?

Here is workaround http://www.eviltester.com/index.php/2010/03/13/a-simple-getcsscount-helper-method-for-use-with-selenium-rc/

Related

Is there an easy way to search Snippets in SQL Developer?

I find that my collection of snippets has grown far beyond what can be managed by assigning a Category and Name. "I know I wrote this code before, it's probably in one of these three categories but it definitely hit table T and used function F; should my time be spent clicking thru each likely category and dragging out each snippet, reinventing it, or searching the snippets.xml?" is a conversation I have with myself far too often.
I tend to copy the snippet body into the tag so I can hover and see some of what's in there but still, being able to actually search the snippets (like we can do with SQL History) would be amazing. Is there a way?
No, there is no way today.
I'm happy to log an enhancement request on your behalf for that feature.
In the meantime, maybe consider trying the Code Templates instead?
You can 'search' either by the name of your code template, or by the first word of the code template 'source'
type the word, and then ctrl+enter to bring up the list of 'hits'

how to mark/check a checkbox in Moodle

I have a lot of checkboxes and their names are generated with the help of the resource id they are associated with, which in turn is fetched from the database.
$mform->addElement('checkbox', 'incres'.$coursename.$sec->section.$record3->instance);
The second parameter is the name of the checkbox.
I need to know how to mark this checkbox as checked.I have a feeling this can be done by the setDefault method but I cant figure out how. I tried
$mform->setDefault('reqdres'.$coursename.$sec->section.$record3->instance,1);
But that doesnt work. I dont wish to use Javascript or the advancecheckbox element for this since that will require me doing a lot of changes in other dependant modules
Did you try using the Advanced Check Box? $mform->setDefault() should work with this.

How to determine correct files and blocks to be edited in Magento2?

this might seem like a strange question but I am learning Magento 2 at the moment and could use some guidance when it comes to figuring out an easier way than guessing to determine what are the correct files and blocks to edit. Let me demonstrate what I mean.
Say I want to edit template and layout of the customer review section of the customer account page.
I figured out after a while of searching around that vendor/magento/module-review/view/frontend/templates/customer/list.html was the correct template file I need to override, and I turned out to be correct, but it was kind of a lucky guess. There were a lot of other files around there that it seemed it could also possibly be.
Alright, we are getting somewhere. Now I need to change the layout, so which layout file do I need to edit? I tried vendor/magento/module-review/view/frontend/layout/review_customer_list.xml but this doesn't seem to be the correct one. Actually, there seems to be about 4/5 files in this same folder it could potentially be, and I don't seem to have any context to go off other than vague file names. Is trial and error, and guessing what we rely on to figure this out or is there a much easier way to determine this. I know this might be a really stupid, newbie question but I'm a little confused.
Additionally, when testing if this is the correct file I am trying to remove the pager at the bottom right and move the toolbar under the page title. How do I know what the correct names of these blocks are? I tried:
<move element="products.reviews.toolbar" destination="column.main" after="page.title"/>
<referenceBlock name="pager" remove="true" />
which didn't work, but I am also kind of just guessing the names of these blocks if I am honest. I have no idea if this is what these blocks are called.
Are there any easy ways to determine all these things instead of guessing? ID's in the DOM or something like this that reveal the names of the blocks/layouts I need to edit? Something like this?
Thanks for the help

confluence display content by user

I am trying to get specific content on a confluence cloud wiki to display content based on a specific user. The scenario here is that there are links on a page but only 1 should display, the one that displays is based on whom ever is logged in.
I have been told how a macro is the way forward, but I have read the documentation and I am at a loss. I do not understand what I have to do or how to write a confluence macro. could someone help me out with either an example or some links? I have searched like crazy, but maybe i am not asking the right questions but hopfully you can all help me out?
There's a plugin for this:
https://marketplace.atlassian.com/plugins/net.customware.confluence.plugin.visibility
But I'm not sure how thoroughly it hides the content. It might still be visible if users view the page source. If you're trying to hide content which needs to be really protected, you'll probably need to do something else.
Depending on how many users are going to be using the page, you could also just make separate spaces for them, add the permissions to those spaces, and then use a page-include on your "main" page to display the content. If they don't have access it shouldn't show up. You might experience some formatting issues with that solution, however.
Finally, you could grab the username with jquery and display stuff based on that. This solution will be pretty easy if you are familiar with javascript/jquery.
Edit: Here are some helpful resources on how to use javascript and jquery within confluence:
https://confluence.atlassian.com/display/CONFKB/How+to+Use+JavaScript+in+Confluence
https://developer.atlassian.com/confdev/confluence-plugin-guide/writing-confluence-plugins/including-javascript-and-css-resources

How can I auto-modify an image?

The question I am asking is a little bit abstract, so I will try to make it more clear. There are websites where you sign up and get a signature in the format of an image. It has a general format, say a few boxes that are empty, and a logo in the middle. Now, say you gain the "Overachiever" badge, which looks like a pen. You signature is then updated, automatically, to include that pen badge in one of the blank boxes. I am completely clueless as to how to do this, and in what language to do this is, so can anyone help? I have been thinking about PHP as an option, but I do not know if that would work. Any suggestions?
You can do this with PHP (imagecreate) and for the updates in your images you can use cronjobs.
Is this for a forum? Depending on the platform, I know some hosts already have "addon's" that provide similar functionality to what you're after. (Karma addons etc.)
Maybe one of these will help? phpBB has some stuff like that.
https://www.phpbb.com/community/viewtopic.php?t=2147118
http://www.concrete5.org/
If you can execute an external process, you can do this using Image Magick.