Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"Code for Checkbox Status"
#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


Messages In This Thread
"Code for Checkbox Status" - by suresz449 - 12-19-2011, 10:01 AM
RE: "Code for Checkbox Status" - by Munna.Sarfraz - 12-19-2011, 03:12 PM
RE: "Code for Checkbox Status" - by suresz449 - 12-19-2011, 04:29 PM

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,253 11-01-2019, 10:25 PM
Last Post: jayraocourts
Sad Click checkbox using its label name. venkatesh9032 1 3,196 08-10-2015, 10:33 PM
Last Post: kotaramamohana
  Childobject return wrong checkbox count.. VpnQTP 1 2,865 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)