I am trying to add automated Selenium unit tests to my project but I am having some trouble selecting FormItems. It's easy to locate something like a TextItem since I can easily give each TextItem a unique name and then locate it with the SCLocator. However, FormItems like SelectItems and CheckboxItems don't have a name property in their generated html code so it's much more challenging for me to select them.
Would it be possible to set the id of the form item and have it appear in the generated html code for that item?
In other words, I would like to set an id like this...
id=user_selection
And have it it appear in the div for the SelectItem like this...
<div id="user_selection" $89="isc_SelectItem_30" $9a="$9d" class="selectItemText" style="width:153px;height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:12px;" tabindex="2386" role="presentation" eventproxy="user_selection" ></div>
And then I can find it in my Selenium test case like this....
By userSelection = ByScLocator.scLocator("//DynamicForm[ID="login_page_dynamic_form"]/item[id=user_selection]/element;
Is it possible for me to do this?
Would it be possible to set the id of the form item and have it appear in the generated html code for that item?
In other words, I would like to set an id like this...
id=user_selection
And have it it appear in the div for the SelectItem like this...
<div id="user_selection" $89="isc_SelectItem_30" $9a="$9d" class="selectItemText" style="width:153px;height:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:12px;" tabindex="2386" role="presentation" eventproxy="user_selection" ></div>
And then I can find it in my Selenium test case like this....
By userSelection = ByScLocator.scLocator("//DynamicForm[ID="login_page_dynamic_form"]/item[id=user_selection]/element;
Is it possible for me to do this?
Comment