Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"Code for Checkbox Status"
#1
Not Solved
Hi Folks,

I am using VBScript in open source tool for window based application and it is developed by dotnet technology. In my application I need to test checkbox status but the checkbox value changes build to build so I need rectify this problem I'm trying to use Screen co-ordinates and convert into window co-ordinates then get the pixel colour from that check box and veryfy the status of checkbox so, please can any one help me to get the status of checkbox.
Reply
#2
Not Solved
Hi,
As you mentioned that you are using some open source tool which is build in Dot net technology,
So prior to identify the check box, we need to understand the Object identification mechanism of the tool, Might be they used MSHTL library for identification,
If you have the source code or tool provide the coding window (Dot Net IDE) then you need to put below mentioned code.
Single line code:

Code:
document.getElementById("myCheckbox").checked = true;

This code will search the object into whole document.
IHTMLElementClass which will return all input type control.

Code:
IHTMLElementCollection inputElements = (IHTMLElementCollection)doc.all.tags("input");
foreach (IHTMLElement el in inputElements)
{   string elementHtml = el.outerHTML;
    string termsOfServiceIdentifier = "myCheckbox";
    //  select the Terms of Service checkbox
    if (elementHtml.Contains(termsOfServiceIdentifier))  
    {
        HTMLInputElement chkTOS = (HTMLInputElement)el;
        chkTOS     //This object will return the actual status of the checkbox
    }
}


Reply
#3
Not Solved
Hi Munna,

Thanks for your replying but I'm using the autoit tool as well as autoit scripting language in this scripting language it doesn't work properly for checkbox so I decide to use vb script for that solution so can you please help me for the solution here I attached my tool identifying the objects of checkbox.I'm using the (Frozen)Autoit v3 Window info tool for spying the objects.


Attached Files Image(s)
   
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to close/restart UFT in "Not responding" status with AOM script CharlieMadrid 0 1,234 05-21-2020, 08:46 PM
Last Post: CharlieMadrid
  Help with Select checkbox from data table value jayraocourts 0 1,256 11-01-2019, 10:25 PM
Last Post: jayraocourts
Sad Click checkbox using its label name. venkatesh9032 1 3,201 08-10-2015, 10:33 PM
Last Post: kotaramamohana
  Childobject return wrong checkbox count.. VpnQTP 1 2,866 04-09-2015, 09:07 PM
Last Post: babu123
  How to select dynamic checkbox from web dropdown QA_Newbie 2 4,683 07-20-2014, 09:40 PM
Last Post: QA_Newbie

Forum Jump:


Users browsing this thread: 1 Guest(s)