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

Variables aren't recognized in Assert Text and Assert Not Text #1836

Open
edvinjunda opened this issue Jun 3, 2024 · 6 comments
Open

Variables aren't recognized in Assert Text and Assert Not Text #1836

edvinjunda opened this issue Jun 3, 2024 · 6 comments

Comments

@edvinjunda
Copy link

edvinjunda commented Jun 3, 2024

🐛 Bug Report

Assert Text and Assert Not Text don't recognize variables written in target xpath in following way: "xpath=//div[${variable}]" same like in this issue I think #1690. Error text: "invalid selector: Unable to locate an element with the xpath expression /html/body/div[1]/div[3]/div/div/div[3]/div/div/div[${i}]/div/div/div/div[2]/div[8] because of the following error: SyntaxError: Failed to execute 'evaluate' on 'Document': The string '/html/body/div[1]/div[3]/div/div/div[3]/div/div/div[${i}]/div/div/div/div[2]/div[8]' is not a valid XPath expression.".

To Reproduce

Use variable in target xpath with Assert Text and Assert Not Text commands.

Expected behavior

Variables are available for use in those commands target xpaths without problems.

Project file reproducing this issue (highly encouraged)

Just use Assert Text and Assert Not Text commands which have variable written in target xpath.

Environment

OS: Windows 10 OS
Selenium IDE Version: 4.0.1-beta.12
Browser: Google Chrome

@edvinjunda edvinjunda changed the title Variables aren't recognized in Assert Text and Assert Not Variables aren't recognized in Assert Text and Assert Not Text Jun 3, 2024
@toddtarsi
Copy link
Contributor

Ah! My mistake, will fix later tonight. For the moment, you can work around this with wait for text / not text

@toddtarsi
Copy link
Contributor

@edvinjunda - Okay, I checked out the assert stuff. I think assert text is looking okay. For the other assert commands, a TON of them were missing preprocessors, so I went through and added those back. Honestly, I think in v5, I'm going to have a migrate script to collapse all assert and verify commands into the waitFor variants. I think having a smaller set of hardened commands will be better for users.

Screenshot 2024-06-05 at 4 21 36 AM

@toddtarsi
Copy link
Contributor

@edvinjunda - Alright, new version is going up for testing here. Will probably just release after CI passes

#1837

@toddtarsi
Copy link
Contributor

@edvinjunda - Could you confirm if this works on latest?

@toddtarsi
Copy link
Contributor

@edvinjunda - 🤦 I realized I hadn't been publishing the latest versions. I just published the latest binary x.14. Please test at your convenience. My mistake

@edvinjunda
Copy link
Author

@toddtarsi sorry for not responding for so long, I'm quite busy with other stuff, when I will have time I'll check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants