Make cell into a Checkbox?
Make cell into a Checkbox?
Hi I have a grid with checkboxes and need to make a cell into a "Checkbox" adapter. How would I do that? Doing .As<Checkbox> returns null
Re: Make cell into a Checkbox?
Hi,
Could you please post a Ranroex snapshot of the problematic table/cell and describe in more details, what exactly you are trying to achieve? I don't think you can easily convert 'cell' to 'checkbox', if cell does not have such capability? But I may be wrong and I will learn something new today?
Could you please post a Ranroex snapshot of the problematic table/cell and describe in more details, what exactly you are trying to achieve? I don't think you can easily convert 'cell' to 'checkbox', if cell does not have such capability? But I may be wrong and I will learn something new today?
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Make cell into a Checkbox?
Yea no you can't convert a cell element to a checkbox.. So I was kindof wondering if there's some sort of "CellCheckbox" , apparently not . Here's a workaround I did, might help someone in the future:
Code: Select all
private readonly Cell context;
public bool Ticked
{
get
{
var state = this.context.Element.GetAttribute<string>(AttributeType.AccessibleValue);
if(state == "Checked")
{
return true;
}
if(state == "Unchecked")
{
return false;
}
throw new Exception("This isn't a checkbox");
}
}
public CheckboxCell(Cell context)
{
this.context = context;
}
public void Tick()
{
if(!this.Ticked)
{
this.context.Click();
}
}
public void Untick()
{
if(this.Ticked)
{
this.context.Click();
}
}
}