;test with: ;http://www.w3schools.com/html/tryit.asp?filename=tryhtml_form_checkbox ;in Internet Explorer
int w=wait(3 WV win("Tryit Editor v1.8 - Windows Internet Explorer""IEFrame")) Acc a.Find(w "CHECKBUTTON""""a:value=Bike"0x30043) if a.State&STATE_SYSTEM_CHECKED ,out"checked" else ,out"unchecked"
a.DoDefaultAction;;toggle
;Insert factory order number in website field int w=wait(3 WV win("Find Orders - Windows Internet Explorer""IEFrame")) Htm e=htm("INPUT""fromValue""" w "0"280x1213)
e.SetText(factoryOrderNum) ;Click Search Button Htm e1=htm("NOBR""Search""" w "0"200x213)
e1.Click ;Click Maintain Orders button int w2=wait(10 WV win("View Order - Windows Internet Explorer""IEFrame")) Htm e2=htm("NOBR""Maintain Order """ w2 "0"70x213)
e2.Click ;Click Configurator button int w3=wait(3 WV win("Maintain Order - Windows Internet Explorer""IEFrame")) Htm e3=htm("NOBR""Configurator """ w3 "0"20x213)
e3.Click
;;;;;checking variable content and changing website values accordingly
int w4=wait(3 WV win("Vehicle Configuration - Windows Internet Explorer""IEFrame")) ;changing exterior colour Htm e4=htm("SELECT""sel3""" w4 "0"80x1213)
int w=wait(3 WV win("Tryit Editor v1.8 - Windows Internet Explorer""IEFrame")) Htm e=htm("INPUT""Bike""" w "2"00x4213) if e.Checked ,out"checked" else ,out"unchecked"
e.Click;;toggle
But it must be "INPUT", not "IMG". Look for "INPUT" somewhere near the IMG.
I just noticed that the whole checkbox item is clickable including the description against the check box.
When I drag the control on to the description, it gives me the SPAN tag.
How do I go about this?
I mean how do I know if the this element is checked or not.
The only visual way is that the box is checked or not and the description turns red if unchecked...black if checked
check box is an image and it's name changes each time
Notice how the index number changes before and after the item is clicked:
Don't use the index, it will be unreliable.
Look maybe something in HTML of the element (IMG, SPAN, maybe some other) is different when checked and unchecked. Then can get HTML and use string functions.
If not, try "Find Image" dialog.
Also can try accessible object functions.
However, when running the code, it does not seem to find the object:
Could you please check on this website and suggest me the best method.
I really need your help on this.
I am bound by over 500 orders....
int w8=wait(3 WV win("Vehicle Configuration - Windows Internet Explorer""IEFrame")) Acc a.Find(w8 "TEXT"" 088EH Grand Black Wood (12) ""state=0x40 0x20000040"0x30053)
At first see if it has "checked" state when checked. In "Find Accessible Object" dialog click Properties. If not, accessible object functions cannot be used. If yes, you can find HTML element and convert to accessible object.
I tried. The accessible object is not found...
I get stuck in the begining itself so can't go further to test the checkboxes
I tried the test button when the item is visible; it finds the object. But when I scroll to the begining of the page, 'test' does not find the accessible object.
How can I work around this limitation?
Below is the exact code that I am using.
I am using the object name as is from what I got while using the drag method
I even tried using * as well but no luck...
I have been successfully using the codes mentioned in this post for a very long time now.
However, some text and elements changed in this website recently and I don't seem to get things working.
The ones in green (accessible objects) was working perfectly previously but it does not now.
Instead, I have used htm objects now and it finds the checkbox image perfectly.
So, how do I substitute the .webattribute part?
int w=wait(3 WV win("msn - Internet Explorer""IEFrame")) Htm e=htm("IMG""Carnufex carolinensis, or the ''Carolina butcher.''""" w "0"580x3213) str s=e.Attribute("src") out s
Error "Type mismatch" when the element cannot have src attribute.