Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 905011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:08:42+00:00 2026-05-15T16:08:42+00:00

I’ve used the free edition of the WebAii test framework [the one released by

  • 0

I’ve used the free edition of the WebAii test framework [the one released by Art Of Test before they were acquired by Telerik] quite a bit, so I know it basically works. So the problem I’m having now is completely baffling to me.

I’m trying to test navigation in an existing site, and going through a sequence of pages. I get to a page that has (among other things) two buttons. One is a “back” button that is an input element of type button with an onclick handler that calls a javascript function that just calls history.back(). The other is a submit button.

WebAii has no problem finding the submit button. But when I tell it to click it, it is, to all appearances, clicking the back button.

Here’s the relevant HTML from the site:

<div align="right"> 
    <table border="0" width="200" cellpadding="8" style="border-collapse: collapse" bordercolor="#E0DFE3"> 
        <tr> 
            <td> 
                <input type="button" value="<- Back" name="B2" onclick="cancelChange()" > 
            </td> 
            <td> 
                <input type="submit" value="Maint Details ->" name="lnkSubmit"> 
            </td> 
        </tr> 
    </table> 
</div> 

And here’s the test code:

        HtmlInputSubmit maintDetailsButton = Find.ByAttributes<HtmlInputSubmit>("value=Maint Details ->"); 
        maintDetailsButton.Click(); 

        Assert.IsTrue(ActiveBrowser.Url.Contains(expectedPage), "URL {0} does not contain expected page {1}", ActiveBrowser.Url, expectedPage); 

The sequence of operations is working just fine when I click it manually, so I can see no evidence that it’s the site’s problem. I’ve seen abundant evidence that it is, in fact, clicking the “Back” button and not the “Maint Details” button. (Fiddler shows no request issued when the click request is sent – consistent with executing history.back(), since the browser simply redisplays from it’s cache. When I click, it does, in fact, go to the previous page. And finally, if I remove the “onclick” attribute from the back button, so that clicking on the button does nothing, then when execute the test code, the site does nothing – simply stays on the current page.)

I am completely baffled. Can anyone give me a hint?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T16:08:42+00:00Added an answer on May 15, 2026 at 4:08 pm

    Well, it’s taken me a week of beating my head against the wall, but I did figure this out.

    First, I discovered something. From what I’ve been able to deduce, when you do a Find., WebAii keeps track of that element as an index into a list of all the elements of that type in the document. Then, whenever you access a found element, WebAii will generate a JavaScript function of the form “document.GetElementsByTag(”)[].” I discovered this accidentally when I trying to find a way to identify the element that WebAii had found, and inadvertently generated a javascript error which displayed the function it was trying to execute in the exception.
    So, then I reasoned that if it’s accessing the element by index, and somehow or another its index is off, then it would make sense that it was clicking the input element before the one I wanted it to.
    So I did a Find.AllByTagName(“input”), and looked through the resulting ReadOnlyCollection in the VS debugger, and started matching the input elements that it found with what I could identify looking at a View Source of the page. I discovered that I was finding one that WebAii wasn’t listing, way up near the top of the page, and, on closer examination discovered that the input element that was missing was missing it’s closing angle bracket.
    So, apparently WebAii did not find that as an input element, but javascript did. So when my test said “maintDetails.Click()”, that was being converted into something like “document.GetElementsByTag(‘input’)[20].click()”, when, because of the missing element, it should have been “document.GetElementsByTag(‘input’)[21].click()”.

    I fixed up the missing closing angle bracket in the site source code, and the test ran.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used javascript for loading a picture on my website depending on which small
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm making a simple page using Google Maps API 3. My first. One marker
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.