-2

I have a selenium script which creates a financial profile on a financial web application. Now i need to check whether added financial stuff appears in the profile.

For example i added a Retirement account to the profile and want to see if added retirement account appears in the profile. I have checked UI elements to verify that it appears in the profile. But i am wondering if there is a way to check same using javascript variables.

I found javascript executor function that can be used in Selenium but i am not sure how to check which variable or function to check for a particular account(Retirement).

I also read about some extensions that can show you java script variables called real time but have had no luck with using those efficiently.

Any help would be appreciated and an example small code would be very helpful. Thanks!

garima
  • 111
  • 1
  • 15
  • Possible duplicate of [Reading JavaScript variables using Selenium WebDriver](http://stackoverflow.com/questions/13994393/reading-javascript-variables-using-selenium-webdriver) – Andrew Regan Mar 09 '16 at 23:07

1 Answers1

1

This seems like a duplicate question. But if executeScript doesn't return the variable to whichever language you are running Selenium in, then you can always dump the contents of the object to a DOM element and use Selenium to inspect it there.

Community
  • 1
  • 1
illvm
  • 1,336
  • 13
  • 28
  • my question also include- how to check what javascript function and variable can be used to verify added value. I need a direction to look on how to see all javascript functions and variables in real time – garima Mar 09 '16 at 17:34
  • I don't really know what you mean by "show you java script variables called real time." As far as I know there is now event in JS which one can hook to show executing code. If you're trying to determine which functions are called and which objects are touched during execution, perhaps you could try using the developer tools in Chrome or your favorite browser and tracing the event from there. That should give you enough information on what to check in your Selenium script. – illvm Mar 09 '16 at 20:35
  • I have been trying developer tools to see which function and object are touched while execution but somehow i am not getting a good answer. My web app is built in ember js. I am reading how to use firebug to check my javascript functions . Thanks! – garima Mar 09 '16 at 20:44