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

export python assert ${val} become a string #1244

Open
FuckyouBB opened this issue Jun 10, 2021 · 6 comments
Open

export python assert ${val} become a string #1244

FuckyouBB opened this issue Jun 10, 2021 · 6 comments

Comments

@FuckyouBB
Copy link

when i use ide , assert text equal ${val} like this
image
it work ,but when i export python code,this code become

assert self.driver.find_element(By.CSS_SELECTOR, ".h-table-body-column-left:nth-child(2) span").text == "self.vars["bs"]"

it doesnt work become it become string,i should manual elimenate the double quote

its a bug

Environment

OS:
Selenium IDE Version: 3.17
Selenium SIDE Runner Version:
Node version:
Browser:Chrome
Browser Version:

@toddtarsi
Copy link
Contributor

@FuckyouBB - It sounds like you have it quite well figured out. Would you be able to clone this repo, switch to the v3 branch and test a fix?

I think the line you want to edit is here: https://github.com/SeleniumHQ/selenium-ide/blob/v3/packages/code-export-python-pytest/src/command.js#L187

Please let me know if I can help any more.

@Lava-Iris
Copy link

Hi! I'm encountering the same issue in a number of places...if no one is working on it, can I pick it up? It's kinda breaking my workflow.

@toddtarsi
Copy link
Contributor

@Lava-Iris - Absolutely, but I will warn you that v3 is pretty close to like fully being shuttered. It uses webextension manifest v2, which is on super borrowed time. You might want to look into saving your stuff as a side file, and doing this move:

#1839 (comment)

That way there aren't concerns of putting out a new v3 version, which involves deploying to the extension stores and is harder to test too.

The python package is here:

https://github.com/SeleniumHQ/selenium-ide/tree/trunk/packages/code-export-python-pytest

Also, I actually wrap it as an example project here, in case you want to see how you could modify the export language easily:

https://github.com/SeleniumHQ/selenium-ide/blob/bc18c88153d2245ae8b35e98487a0da51460ae46/packages/side-example-suite/src/formats/custom-python.ts

@toddtarsi
Copy link
Contributor

Lemme know how I can help. I have been taking a hiatus here for my health, as you can probably tell from the issue's list, but people willing to put in work to fix things will always have my full support.

@Lava-Iris
Copy link

@toddtarsi

Got it. Thanks for your support! I'm actually new to this field so I'll probably be super slow to work this out (also coz I'm kinda packed rn), but I'll try to be as quick as possible about it. The npm tool is super cool and I personally will be using it, but the problem is I'm trying to make something people without much coding knowledge can use (and the ide is perfect for it) and my target users don't have the permission or the knowledge to use npm...

Just to confirm, this is the code behind the selenium browser extension right?
(Sorry if it's a stupid question)

@toddtarsi
Copy link
Contributor

@Lava-Iris - Nope! This is the code behind v4. If you go to the branch called 'v3', that's the webextension.

Also, for authorship, you can download v4 binaries directly here without using npm.

https://github.com/SeleniumHQ/selenium-ide/releases/tag/v4.0.1-beta.12

The npm stuff is meant to play very nicely with a CI system, and also is meant to be an easy way to share and publish plugins for the IDE, but absolute and relative paths work for plugins as well so you can go without the package managers.

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

3 participants