Привіт!
Є така структура класів:
this.rfqItem1 = new RFQItem('(//*[
@frmattr="item"])[position()=1]', browser);
this.rfqItem2 = new RFQItem('(//*[
@frmattr="item"])[position()=2]', browser);
export class RFQItem {
private item: Element;
description: Input;
constructor(locator: string, context: Browser| Element) {
this.item = context.element(locator);
this.description = new Input('//*[
@frmattr="descriptionTextArea"]', this.item);
}
}
export class Input {
locator: string;
control: Element;
constructor(locator: string, context: Browser| Element, timeout=20000) {
this.control = context.element(locator, {timeout:timeout});
}
}
в тесті використовую так:
app.RFQPage.rfqItem1.description.getInputValue();
app.RFQPage.rfqItem2.description.getInputValue();
В результаті дістається одне й те ж саме значення (хоча в контролах різні значення). Тобто підозрюю що в обоз випадках воно дістає з вебелементу description з інтексом 0
Проблема в тому вебелемент description витягується не з батьківського вебелементу (rfqItem1, rfqItem2) а з корреня (browser)
Не можу визначити де в коді проблема (