Hi All, from now on, I want to share “Selenium Webdriver Tips and Tricks” series. I hope and believe that it will be a very exciting and interesting series and this post is the first episode of this appealing series. In this episode we will go over below headlines:

1) How to overcome “:” css selector problem for JFS web applications?

Answer: instead of : we should use its hexadecimal equivalent which is \3A


Invalid: #basicInformationForm:propertyName:propertyName_sub:propertyName_sub_inp

Valid: #basicInformationForm\3ApropertyName\3ApropertyName_sub\3ApropertyName_sub_inp

Reference: http://stackoverflow.com/questions/122238/handling-a-colon-in-an-element-id-in-a-css-selector

2) How to do Human-Like Typing in Selenium?

Answer: You can use below method to do human-like writing

3) How to get a web element by text with Selenium WebDriver?

Answer: CSS does not allow this, you need to use XPath.


Check also CSS/Xpath reference from below link.

4) How to interrogate an element by XPath using JavaScript get element method?

Answer: You can use below code template to get element bt xpath using JavaScript

For example logo of Kariyer.net’s Xpath is “.//*[@id=’Header’]/div[2]/div[1]/a/img”


5) How to upload an image with Robot Class?

Answer: You can use below utility method to upload images with Robot Class.

First episode’s end.

Note: Special thanks to Canberk Akduygu for his contributions.