Agile

Javascript methods – A quick way to figure out methods to use within testim

Google+ Pinterest LinkedIn Tumblr

As you may already know, Testim provides the flexibility to extend the functionalities of our platform by giving teams the ability to add their own JavaScript code. That being said, there maybe a situation where you need to use inbuilt javascript methods within the Testim JavaScript editor.  For Example – Say you want to find out of if an element is enabled on the page, you could do this

if(!element.disabled) {

 return true;

}

Now how do you know that, you could use the inbuilt method disabled() here?  The answer is simple.  Just follow the below steps-

  1. Open any web page on your Chrome browser
  2. Right click on an element and select “Inspect”
  3. Navigate to Console tab
  4. Start typing “$0.”
  5. Then observe all the inbuilt methods which are supported by Chrome

The same methods are supported by Testim as well.  Additionally, we support commonly used javascript methods such as reload(), split(), trim() and much more.  For more javascript examples check out our help document here.

Raj Subramanian a former developer, moved to testing to focus on his passion. Raj currently works as a Developer Evangelist for Testim.io, that provides AI based software testing solutions for clients. He actively contributes to the testing community by speaking at conferences, writing articles, blogging, making videos on his youtube channel and being directly involved in various testing-related activities. He currently resides in Chicago and can be reached at raj@testim.io. His website is www.rajsubra.com and twitter handle – @epsilon11. His videos on testing, leadership and productivity can be found here – http://www.rajsubra.com/my-youtube-channel/

Be smart & save time...
Simply automate.

Get Started Free