How to retrieve result when using execute_script with jquery commands?

Hi guys,

Can somebody give me a complete python example to retrieve result of jquery command ?

Thank you,

Max

Hi,

I have finally find the answer :smile:

For instance, you have an object #Sample .toto (css selector) that can be hidden in your page.
If you can access it by this jquery command : $('#Sample .toto').is(':visible') in debug mode of your browser, so with Appium/Selenium it’s very simple :
result = self.driver.execute_script("return $('#Sample .toto').is(':visible')")
In this case, result is a boolean. If Appium doesn’t find anything, result will be None.

The same if #Sample .toto is a text field:
result = self.driver.execute_script("return $('#Sample .toto').text()")
In this case, result will be a string, and so on. The keyword here is return !

Hope that can help some people.

Max