How to get value using grabAttributeFrom in codecept. It returns only object,promise. How to get the attribute value from it.
let userid_xpath = await I.grabAttributeFrom("//div[@class='mat-form-field-infix']/input[contains(@id,'mat-input')]","id");
var userid = "//*[@id='"+userid_xpath+"']";
I.fillField(userid,"username")
If i use like above and execute the test, i dont get any error. but i saw the debug panel displays like below
Emitted | step.after (I grab attribute from "//mat-label[contains(text(),'UserId')]//ancestor::label//ancestor::span//ancest...
Emitted | step.before (I fill field "//*[@id='[object Promise]']", "username")
How to get the attribute value and use it in a string. If i pass the userid_xpath variable in assert ; it works. but my requirement is to pass it in a string and then use it.