Hi Isomorphic,
We have a few questions relating to AutoTest and scLocator that I am hoping you can help clarify.
We have an scLocator, like follows.
Code:
//autoID[Class=Window||index=181||length=309||classIndex=1||classLength=2||roleIndex=1||roleLength=2||title=Windows%20Task%20Details%3A%20Ping||scRole=dialog]/item[0][Class="SectionStack"]/section[Class=SectionHeader||index=0||length=1||classIndex=0||classLength=1||roleIndex=0||roleLength=1||scRole=tab||name=isc_OpswisePanelDetailsSection_2]/item[Class=VLayout||index=0||length=1||classIndex=0||classLength=1]/member[Class=TabSet||index=0||length=1||classIndex=0||classLength=1]/tabPane[title=Windows%20Task||index=0]/member[Class=VLayout||index=0||length=9||classIndex=0||classLength=8]/member[Class=DynamicForm||index=0||length=1||classIndex=0||classLength=1]/item[name=name||title=Task%20Name||value=Ping||index=0||Class=TextItem]/element
Code:
isc.AutoTest.getElement('scLocator=//autoID[Class=Window||index=181||length=309||classIndex=1||classLength=2||roleIndex=1||roleLength=2||title=Windows%20Task%20Details%3A%20Ping||scRole=dialog]/item[0][Class="SectionStack"]/section[Class=SectionHeader||index=0||length=1||classIndex=0||classLength=1||roleIndex=0||roleLength=1||scRole=tab||name=isc_OpswisePanelDetailsSection_2]/item[Class=VLayout||index=0||length=1||classIndex=0||classLength=1]/member[Class=TabSet||index=0||length=1||classIndex=0||classLength=1]/tabPane[title=Windows%20Task||index=0]/member[Class=VLayout||index=0||length=9||classIndex=0||classLength=8]/member[Class=DynamicForm||index=0||length=1||classIndex=0||classLength=1]/item[name=name||title=Task%20Name||value=Ping||index=0||Class=TextItem]/element')
Code:
Evaluator: result of 'isc.AutoTest.getElement('scLocator=//autoID[Class=Window||index=181||length=309||classIndex=1||classLength=2||roleIndex=1||roleLength=2||title=Windows%20Task%20Details%3A%20Ping||scRole=dialog]/item[0...' (2ms): INPUT{name:name}{autocomplete: "off", form: [FORMElement]{name:[object HTMLInputElement]}, height: 14, maxLength: -1, size: 20, type: "text", value: "Ping", valueAsNumber: NaN, width: 296, willValidate: true, validity: [object ValidityState], selectionEnd: 4, selectionDirection: "forward", controllers: [object XULControllers], textLength: 4, dataset: [object DOMStringMap], properties: [object HTMLPropertiesCollection], tabIndex: 3870, spellcheck: true, style: [object CSS2Properties], className: "opswiseTextItem", offsetParent: [TDElement]{ID:isc_ML}, offsetTop: 2, offsetLeft: 2, offsetWidth: 302, offsetHeight: 22, tagName: "INPUT", id: "isc_MJ", classList: opswiseTextItem, attributes: [object MozNamedAttrMap], children: [object HTMLCollection], scrollWidth: 300, scrollHeight: 20, clientTop: 1, clientLeft: 1, clientWidth: 300, clientHeight: 20, outerHTML: "<input name="name" id="isc_MJ" handlenat..."[382], nodeType: 1, nodeName: "INPUT", baseURI: "http://127.0.0.1:7081/opswise/", ownerDocument: [object HTMLDocument], parentNode: [TDElement]{ID:isc_ML}, parentElement: [TDElement]{ID:isc_ML}, childNodes: [object NodeList], namespaceURI: "http://www.w3.org/1999/xhtml", localName: "input", }
https://www.smartclient.com/smartcli...ocatorStrategy
https://www.smartclient.com/smartcli...orTypeStrategy
By default we use the following strategies in order to identify a component from a list of candidates:
name: Does not apply in all cases but in cases where a specified name attribute has meaning we will use it - for example for sections in a section stack.
title: If a title is specified for the component this may be used as a legitimate identifier if it is unique within the component - for example differently titled tabs within a tabset.
index: Locating by index is typically less robust than by name or title as it is likely to be affected by layout changes on the page.
If an explicit strategy is specified, that will be used to locate the component if possible. If no matching component is found using that strategy, we will continue to try the remaining strategies in order as described above.
name: Does not apply in all cases but in cases where a specified name attribute has meaning we will use it - for example for sections in a section stack.
title: If a title is specified for the component this may be used as a legitimate identifier if it is unique within the component - for example differently titled tabs within a tabset.
index: Locating by index is typically less robust than by name or title as it is likely to be affected by layout changes on the page.
If an explicit strategy is specified, that will be used to locate the component if possible. If no matching component is found using that strategy, we will continue to try the remaining strategies in order as described above.
Code:
item[name=name||title=Task%20Name||value=Ping||index=0||Class=TextItem]
Code:
item[name=nameNoMatch||title=Task%20Name||value=Ping||index=0||Class=TextItem]
However, if we remove the name strategy completely from the scLocator, as follows.
Code:
item[title=Task%20Name||value=Ping||index=0||Class=TextItem]
Questions:
1) How come it is not continuing on with the title and index strategies when the name strategy is not a match, as described above?
2) What tool do you use internally for testing the framework?
3) If it is Selenium, are you using IDE+Selenium RC (Selenium 1.0) as described in the user doc or are you using the Webdriver (Selenium 2.0 and 3.0)?
Thanks in advance!
Comment