473,326 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Testing webpage with accordion object not pointing to all controls

Hi there

I'm doing some assertion tests on a page containing a number of checkboxes surrounded by an accordion object which someone else has given me.
If you don't know what this looks like; here's a picture of an example: http://bit.ly/RdDcKu

When you click on one of the panes to open it, the one that you had opened is closed, that's how it works.

Anyway, In the web page, I am calling a number of other test methods contained in a .js test class

The checkbox object is being picked up from the first pane in the accordion, but not in any of the other panes.
I know this because I have placed alert() popups in each of these other objects to assert whether the checkbox is being hit or not, and, only the first one is returning the 'option checked' or 'option unchecked' messages.

Has anyone else run into this problem; testing html web controls that are split over multiple div's or span's???

Just for reference, the code in my web page looks like this:

Expand|Select|Wrap|Line Numbers
  1. function RunTests()
  2.     {
  3.         // Get working for the Principal Beneficiary first
  4.         alert('Run Tests for Test Rail Case C141697');
  5.  
  6.         TestOptionalBenefits_Maternity();
  7.  
  8.         TestOptionalBenefits_Dental();
  9.  
  10.         alert('Test Run Completed');
  11.     }
  12.  

And the way I am checking whether the checkbox is disabled or enabled and checked web pages looks like this:

Expand|Select|Wrap|Line Numbers
  1. function TestOptionalBenefits_Maternity()
  2. {
  3.     alert("Test OptionalBenefits_Maternity started");
  4.  
  5.     var maternityPrinMember = "12576_HasBenefit_0_False_100000";
  6.     var myObjmaternityPrinMember = document.getElementById(maternityPrinMember);
  7.  
  8.     if (myObjmaternityPrinMember.disabled) {
  9.         alert('Member not eligible for Maternity benefit so, option disabled');
  10.     }
  11.     if (myObjmaternityPrinMember.checked) {
  12.         alert('User has selected Maternity benefit');
  13.     }
  14. }
  15.  
Sep 6 '12 #1
3 1495
gits
5,390 Expert Mod 4TB
hmmm - how is the accordion created? are you sure the non-displayed nodes are already created in the dom or are they created on the fly when the corresponding accordion-panel is opened?

does firefox's firebug-console display any errors?

PS: when you add:
Expand|Select|Wrap|Line Numbers
  1. alert(myObjmaternityPrinMember);
into line 7 of the posted TestOptionalBenefits_Maternity-method-code - what does it show?
Sep 7 '12 #2
Hi gits, thanks for your quick response.

The non-display nodes appear to be created when the user navigates to this page (Benefits) from the previous web form page (Apply) in the form. This is because in the previous page, the options the user selects affect how many rows of checkboxes the user can see. I.e. - if they select 5 people, then columns of checkboxes are shown for each row / criteria within each accordion pane. I could go into more details, but it would make this reply excessively long!

I've tried the page on firebug and it doesn't appear to show any errors but a few items are displayed in red like, for example:
- outer HTNL: "<a tabindex="-1" href="#">Dental</a>"
- path name: "/Apply/ReQuote"

Normally red text = errors but I don't think these are errors.

And when I add this alert box into the function of the code I posted, we get the message:
'[objectHTMLInputElement]'.
Sep 7 '12 #3
gits
5,390 Expert Mod 4TB
ok - so what does the alert say when you put:

Expand|Select|Wrap|Line Numbers
  1. alert(myObjmaternityPrinMember.disabled);
Sep 7 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: PMB | last post by:
Thank you in advance for any and all assistance. It is greatly appreciated. I was wondering how do you refer to controls in a Module, in a private or public function? I've tried...
0
by: Carlos E. Hernandez | last post by:
I am creating a control that has an imagelist and a toolbar. The control has default buttons and images. I want the users of the control to be able at design time, to add more images or more...
6
by: Lance | last post by:
Hi, How do you test for an object existing in C#? C# seems to differentiate between 'null' and non-existance. In other languages I could test as so: if(ex.InnerException.StackTrace != null)...
0
by: Michael Murschell | last post by:
I have two folders in my main web folder: Images and UserControls. In the UserControls, I have an ascx that has an image object on it. If I want to make it's source point to a JPG in the Images...
2
by: Arjen | last post by:
Hello, I have multiplpe web user controls on one webpage. The web user controls have database interaction. When I click on one of the web user control actions then it does'nt show the data...
0
by: Bernard Lebel | last post by:
Hello, First, this is my first post on this list! A little about myself: I'm the lead technical director in a 3D animation studio, in Montreal. A lot of the Python code I write is to be used in...
2
by: Claus Tondering | last post by:
If I want to test if an object, x, is an integer, I can call isinstance(x, int). But what do I do if I want to test if x is a function? I can do this: if isinstance(x, type(lambda: None)):...
4
by: rn5a | last post by:
Assume that a ASPX page uses a user control named Address.ascx which has 2 TextBoxes. This ASCX page creates 2 properties named 'Address' & 'City' using the Get & Set statements: <script...
1
by: LintDiggy | last post by:
My vb6 application has a nasty memory leak that I can't trace for the life of me. I have an ActiveX object that I've created called an Operation. The control has the following components : ...
5
by: Matthew | last post by:
Hi Guys, On a Windows PC it's easy enough to test how a webpage looks in Firefox, IE, and Opera, but what about Apple's Safari? Unless you have an Apple as well, which I do not. Is there some...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.