Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reusing SearchElement #2589

Closed
NivedhaSenthil opened this issue May 17, 2022 Discussed in #2586 · 1 comment
Closed

Reusing SearchElement #2589

NivedhaSenthil opened this issue May 17, 2022 Discussed in #2586 · 1 comment

Comments

@NivedhaSenthil
Copy link
Member

Discussed in #2586

Originally posted by lufton May 16, 2022
I have a step definition that is failing:

step("Enter <value> into <fieldLabel> text field", async function(value, fieldLabel) {
	let txtBox = await textBox(below(text(fieldLabel)), near(text(fieldLabel)));
	await scrollTo(txtBox, { blockAlignment: 'center', inlineAligment: 'center' });
	await write(value, into(txtBox));
});

But it fails at await write(value, into(txtBox)) line:

Error: TextBox below Element with text THE TEXT NEXT TO ELEMENT and near Element with text THE TEXT NEXT TO ELEMENT not found

This is weird, because await scrollTo(txtBox, { blockAlignment: 'center', inlineAligment: 'center' }) works as expected, so there is corresponding element.
Also if I replace txtBox with textBox(below(text(fieldLabel)), near(text(fieldLabel))) inside scrollTo and write method calls, then this code words. So it looks like as soon as I used txtBox variable it is not holding actual element anymore.

@zabil
Copy link
Member

zabil commented May 17, 2022

Duplicate of #2590

@zabil zabil marked this as a duplicate of #2590 May 17, 2022
@zabil zabil closed this as completed May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants