How can i count no.of links on a web page using VBA programmability

hi,
could anybody help me in getting the no.of links,no.of images in e-tester using custom programmability test.
i'm new to e-tester.
earlier i was using QTP. i know VBScript and how to getitemscount in QTP

Hi pasumarthi,
Great question! Try putting the following code in the Private Sub RSWVBAPage_afterPlay(). If you run into problems, please reply to this message. This code can also be copied into a custom vba test if you wanted to test the number of links and images on the page against a specific number.
'Variable declarations
Dim images As Collection
Dim links As Collection
Dim resultbImages As Boolean
Dim resultbLinks As Boolean
Dim item As Object
'Initialize variables
resultbImages = False
resultbLinks = False
'Get all the elements that have a tag of IMG
resultbImages = RSWApp.om.FindElements(images, , "IMG")
'Get all the elements that have a tag of A
resultbLinks = RSWApp.om.FindElements(links, , "A")
Call RSWApp.WriteToLog(, , "There are " & images.count & " images on the page")
Call RSWApp.WriteToLog(, , "There are " & links.count & " links on the page")
Message was edited by: kgehrke

Similar Messages

  • How can I change a minus figure on a web page to show in red? Firefox3.6.8 winXP

    How can I change a minus figure on a web page to show in red?

    I would assume that the website sends negative number with a special CSS class code or uses JavaScript to to change the style afterward.
    Did it ever work in Firefox?
    Do you see a error in the Tools > Error Console regarding this problem?
    "Clear the Cache": Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove the Cookies" from sites that cause problems: Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]

  • How to show modal window without popup in a web page using javascript

    Hi,
    How to show modal window without popup in a web page using javascript, means when the modalwindow is opened it should not ask for popup blocker alert......
    pls help me.....

    Thanx for ur reply,
    Actually the senario is when i click on a button, another jsp page should be displayed in a modal window without popup, but the functions alert() and confirm() will not accept the url path of the another jsp page...

  • How can I refresh only a section of a web Page

    Hi,
    I am generating a web page using pl/sql. This web page has
    multiple sections in it. Only first ten records of each
    sections are displayed and the user can click on <prev> <next>
    button to display the prev/next 10 records. e.g.,
    Section 1 - Previous Names
    Smith
    Owen
    McDonald
    <<Prev 10 Next 10>>
    Section 2 - Previous Addresses
    111 State St.
    121 Altamont Ave.
    48 Apt 1., Bleeker St.
    <<Prev 10 Next 10>>
    Section 3 and so on ...
    My dilemma is that if a user wants to display the next ten
    records of a Section (e.g. Previous Names), I only want that
    part of the page to refresh instead of the entire page to reload
    again (similar to an ASP using Remote Scripting).
    Can this be done in Oracle using PL/Sql?
    Thanks
    Vic

    Each Section is independent of the other i.e., the change in the
    contents of one section shouldn't affect the contents of another
    section. This works fine. I am able to change the contents of
    a section without affecting the contents of another section. I
    basically keep track of each sections starting position.
    Though this works fine and gets me what I want, it's not very
    efficient. Each time a section's contents change (by clicking
    prev/next) the whole page needs to be reloaded. I want only the
    section that was clicked on to reload.
    In Active Server Pages (asp), a person can use "remote
    scripting" to reload only a part of the page without reloading
    the entire page. I was wondering if this could be done using
    PL/Sql as well?
    I could certainly use frames but that's not an option. Frames
    are a big no no here.
    Vic

  • How Can I Remove the Home Link on the Main Page

    I am using PT 8.49 and I am creating a custom page where the only options I'd like to show on the page are my custom menu option and "Sign out" at the top right. I'd like to remove the "Home" link on the top right menu because I am doing the selection for them. I don't want them to be able to go back to the Home menu once they've entered my custom page. I have everything working the way I'd like except that I cannot get rid of the "Home" link. Can anyone help with that?
    I am also using a template in portal called HOMEPAGE_DESIGNER_TEMPLATE as this causes the page to display without the left menu, as I want it to be.
    Thanks for your help!

    Restore the default home page
    * https://support.mozilla.com/en-US/kb/How%20to%20set%20the%20home%20page#w_restore-the-default-home-page
    Now, set a single web site as your home page
    * https://support.mozilla.com/en-US/kb/How%20to%20set%20the%20home%20page#w_set-a-single-web-site-as-your-home-page
    Check and tell if its working.

  • How can I create a working link from the home page to other pages?

    Using iWeb, I created links on the Home page directed to other pages within my web site. The links are located in the main body of the Home page (on the right side) and are not included in the Navigation Menu. The links function correctly when I test them in iWeb, however, the links do not function at all after publishing to the internet.
    Within the inspector, I have chosen, Link To: "One of my pages" and the appropriate page is selected.
    The links within the gray rectangles do not function. The same links below the gray rectangle links go to a "Page Not Found" page.
    See the home page at http://www.daleenstrom.com
    How can I make these links function correctly?

    Welcome to the Apple Discussions. I've found that using the "One of my pages" often doesn't work. Since you've published the site go to each page, copy its URL and use it for the hyperlink. I've found that to me more reliable.
    Are those two links inside the shapes or just on top? Both of those items are one large image file. If you inserted the link in the shape be sure you've selected the text (might take a few clicks to get inside and select it) to use for the hyperlink. Also make sure there are no other objects overlapping each of the shaped with the hyperlinked text.
    Also it appears that the entire text box is an image. Turn on iWeb's preferences to display the text image indicator:
    Click to view full size
    and then you'll see the following on any object that will be converted to text once published:
    Click to view full size
    The two links below work for me. Be sure to clear your browsers cache (CommandOptionE for Safari) and reload the page.
    OT

  • How can I embed a Keynote presentation on a web page?

    I created a Keynote presentation using Keynote version 6.5 (OS X Yosemite). I found the "export as html" option, which creates an entire web page named index.html. I opened that web page in Dreamweaver, but I'm not talented enough to figure out how to turn that page into a proper index.html page, including the graphics, background, and links (etc.) that I want on my sites home page.
    I have also tried to embed the presentation onto a web page that I've already created, but I can't figure out how to do that, either.
    Can someone tell me if it's possible to embed a custom-sized Keynote presentation onto a web page and, if so, how?
    OR can you tell me how to edit the page that Keynote created when I open it up in Dreamweaver?
    I think the former would be easier, given what I've seen when I try to do the latter.
    I have been using Dreamweaver for many years - since before Adobe bought it - and the site I'm currently updating is already in Dreamweaver. That's why I'm asking about Dreamweaver (if you were curious).
    Of course, I've probably not provided all the information you would need to help me, so please ask questions. I won't be offended if they point out my ignorance!
    Thank you for any help you might provide.

    The only workaround I found was to use the desktop version of Keynote, which allowed me to export the presentation as a set of images to iPhoto. From there, they show up as an album and can be brought back to the iPad, and then played as a looping slide show in the pictures app. It worked perfectly.

  • How can I display XSLT transformer errors on a web page ?

    Hi,
    I have some JSP pages that access DB, create an XML based on DB data and then transform it into HTML through an XSLT stylesheet. Developing the XSL code it's easy to make mistakes and generate errors on trasformation, but what I receive on the web page is only a "Could not compile stylesheet" TransformerConfigurationException, while the real cause of the error is displayed only on tomcat logs. This is the code for transformation:
    static public void applyXSLT(Document docXML, InputStream isXSL, PrintWriter pw) throws TransformerException, Exception {
            // instantiate the TransformerFactory.
            TransformerFactory tFactory = TransformerFactory.newInstance();
            // creates an error listener
            XslErrorListener xel = new XslErrorListener();
            // sets the error listener for the factory
            tFactory.setErrorListener(xel);
            // generate the transformer
            Transformer transformer = tFactory.newTransformer(new SAXSource(new InputSource(isXSL)));
            // transforms the XML Source and sends the output to the HTTP response
            transformer.transform(new DOMSource(docXML), new StreamResult(pw));
    }If an exception is thrown during the execution of this code, its error message is displayed on the web page.
    This is the listener class:
    public class XslErrorListener implements ErrorListener {
        public XslErrorListener() {
        public void warning(TransformerException ex) {
            // logs on error log
            System.err.println("\n\nWarning on XEL: " + ex.getMessage());
        public void error(TransformerException ex) throws TransformerException {
            // logs on error log
            System.err.println("\n\nError on XEL: " + ex.getMessage());
            // and throws it
            throw ex;
        public void fatalError(TransformerException ex) throws TransformerException {
            // logs on error log
            System.err.println("\n\nFatal Error on XEL: " + ex.getMessage());
            // and throws it
            throw ex;
    }When I have an error in the XSL stylesheet (for examples a missing closing tag), I can find on tomcat logs the real cause of the error:
    [Fatal Error] :59:10: The element type "table" must be terminated by the matching end-tag "</table>".
    Error on XEL: The element type "table" must be terminated by the matching end-tag "</table>".but on my web page is reported just the TransformerConfigurationException message that is:
    "Could not compile stylesheet".
    How can I display the real cause of the error directly on the web page?
    Thanks,
    Andrea

    This code is part of a bigger project that let developers edit XSL stylesheets through a file upload on the system and we can't impose the use of any tool for checking the xsl. So, I need to display the transformer error on the web page.I see. This code is part of an editorial/developmental tool for developers to create and edit XSL stylesheets.
    As part of the editorial process, XSL errors during editing can be considered a normal condition. In other words, it is normal to expect that the developers will generate XSL errors as they are developing stylesheets.
    In this light, handling the XSL transformation errors is a business requirement that you need to handle. Using the Java Exceptions mechanisms, e.g. try / catch are inappropriate to handle business requirements, in my opinion.
    I suggest that you look at how you handle the occurence of XSL errors differently than what you currently have. You need to:
    (1) capture the Transformation exception on the server;
    (2) extract the message from the exception and put it into a message that can be easily understood by the user;
    The current error message that you have going to the web browser is not useful.
    And you should not have the Transformation exception sent to the web browser either.
    What you are attempting to do with the exception is not appropriate.
    Handle the Transformation exception on the Business tier and use it to create a useful message that is then sent to the Presentation tier. In other words, do not send Java exceptions to web browser.
    />

  • How can I disable html5 videos from displaying on web pages?

    I use yahoo.com as my "news" page. In the last month or so there are more and more small format videos next to the new article. Used to be just a still pic, but now more "invasive". If I had my way I'd still click on "text only" like the old modem days. I want to READ an article, and I find the video images on their main page, before clicking on a story, to be distracting. Also, I'm on a limited data usage plan so don't appreciate them shoving data down my throat.
    Using Firefox 32.0 and Windows 8.1
    Yesterday I installed the "No Script" extension thinking I could block Just these videos, but doesn't seem to work that way. It blocks most everything including interactions like clicking on a button.
    If I examine the "object" (video) it appears to be an "html5" item. This seems to be something new from what I can google.
    There are a few help screens for html5, but these are "how do I play them" instead of "how can I block them".

    Try to set the media.autoplay.enabled pref to false on the <b>about:config</b> page.
    You can open the <b>about:config</b> page via the location/address bar.
    You can accept the warning and click "I'll be careful" to continue.
    *http://kb.mozillazine.org/about:config
    You can also see if this extension works (Flash Block is currently broken).
    *FlashStopper: https://addons.mozilla.org/en-US/firefox/addon/flashstopper/

  • How can I put a check out in a web page?

    Im trying to validate a credit card and send money from a credit card to another credit card.
    Now, I know there are a few examples of validating a credit card, but what about transfering money?
    Any help is appresiated. Thanks.

    Validation is very easy, both server side and client side. Check the ColdFusion Exchange section for "credit card validation" -- you should find several server side tags. You can Google "credit card javascript validation" and find many client side methods.
    Now for the second part of your question, transferring money from one card to another: This is forbidden in the credit card regulations and most likely illegal due to various money laundering laws. You can move money from a credit card to a merchant account to pay for goods or services, but you can't move it from credit card to credit card.
    Now you can have a credit card linked to your merchant account (actually a debit card) -- but you need a merchant account.

  • How can I make Firefox go back to same web page position

    How can I set Firefox to go back to same web page position

    Just wait till Firefox ends loading web page. Then it'll be automatically set in to position when you have been leaving web page

  • How can I demo my mobile app on a web page? or standalone

    Is there a way to show my Flex mobile app in a browser?  either on a web page or standalone is ok.
    I'm using Flash Builder 4.6 to build a mobile app for iOs (iphone 4) and when I debug it, it shows the program in a window like the phone,
    Is there a way to wrap this up and give it to someone to run in a Flash-player-browser-like window? 
    thanks!
    steve

    You can do something similar to this by using Export Release Build and instructing FB to Export as "Signed AIR Package for installation on desktop"
    This will create a file that can be installed on a computer and behaves much like a debugger execution.  A few caveats are that the user will need to resize the window manually to match a "phone size" and mobile features (camera, gps, accelerometer, etc) will either be unavailable or behave very differently than on an actual phone (depending on your code implementation).
    Still, for most apps, this will give your audience a good feel of what your app will be like when released on the phone market/store.

  • How can I type over existing text on a web page?

    I would like to be able to type over existing text on a web page. This can be done by hitting the "insert" key in several applications; however, it does not work in Firefox.
    I'm running Firefox 31.0 and Windows 7.

    Unfortunately that is not possible in Firefox.
    The insert key is not supported (i.e. Firefox is always in insert mode), so you will have to delete the old text and type the new text.

  • How can I add a Last Update to a web page with a web app.

    I would like to know how to update a webpage whenever a web app item has been added or updated last.
    I have the tag {tag_lastupdatedate}  but it only works is only for the web app list or details page.
    I want to be able to add the date and time as to when the entire list was last updated. Any suggestions? thanks!

    Hi DLSAgency,
    There is a module called {module_lastupdated} and it will display the date when the web page it's on has been last updated, but there is no module that will display when the web app list inside that page was last updated. There no such functionality in BC.
    Cheers,
    Mario

  • How can I  make my own design for a web page instead of using a template?

    Need to ask the question again. I tried using the blank template, but could not get it to work. I could not insert images and copy where I wanted and in size I wanted.

    rapcom wrote:
    A general question: Is it possible to change the dimensions of the web page? Or even its positioning as a horizontal or vertical format?
    Yes — it's done via iWeb Inspector's Page tab (the second one at the top), editing the values in the +Page Size+ fields. After entering a new value, click the Return key to make it take effect...
    ..By the way, the above image is taken from a tutorial ~ click on the image above to read the tutorial.
    rapcom wrote:
    I also would prefer to edit the copy on the blank web page, and cannot do that either. Is it possible to do so?
    Yes, it's possible. But it's difficult to know what exact difficulty you're having, and I perhaps risk stating the obvious... One thing to be aware of is that clicking once inside a text box will simply select that box (you'll see eight +"grab handles"+ for re-sizing). But to edit the text inside, you need to click once more. Experiment with clicking inside and outside text boxes and you'll learn.
    And iWeb's Help menu has several resources ~ the Help viewer, a +Getting Started+ PDF and a link to ten video tutorials. One of the videos briefly demonstrates adding a text box towards the end; click here...
    If after the above you still need help, post back with step-by-step details of the problem.

Maybe you are looking for