Skip to main content

Posts

Showing posts from July, 2016

Highlight Element in Selenium WebDriver

  I missed highlighting object feature of QTP when I used to debug my selenium API call on webelement. Number of times I wondered, why didn't by default any method is provided to perform highlight action. But I no longer wish for same as I have found work around.         Remember this - ‘JavaScript comes in handy to perform any fancy tasks on DOM.’ Logic to perform highlight WebElement in Selenium WebDriver:-        To create highlight effect, as in QTP, we don't just need to highlight the element but also have to de-emphasize/play down the same element. Highlighting element once is not enough, as the operation would be fast and we may don't realise highlighting effect. Better we break down logic as in below steps:- Highlight element using javascript. Play-down same element using javascript. Perform above two actions in a loop for significant time. Below code demonstrate use of JavascriptExecutor to perform highlight element in Selenium WebDriver. As you can see

Object Repository in Selenium/Webdriver

From last 6 month or so, I am happily playing with Selenium API. Earlier, I invested more than 3 years in QTP / UFT . After spending that much of time in QTP, it’s very obvious that moving to selenium is not easy game and you cannot help yourself but compare this two things. You missed a lot of things from QTP when you move to Selenium, I can enlist few of those as follows:- Actions Datatables Checkpoints Smart Identifications Recovery scenarios Readily available test execution results and Object Repository and OR Manager This is not the complete list but still this are the majors which I have missed. “Journey becomes easy and better when you have good companion .” I went through many forums to find out good companion for learning selenium and finally settled on a book Selenium Testing Tools Cookbook by Unmesh Gundecha . When I started to learn selenium, I thought of  creating Object Repository in selenium. The book by Unmesh, itself was presented with recipe of implementation of O