Posts

Showing posts with the label Browser

Webdriver/Selenium Difference between methods .isDisplayed() and .isEnabled()?

Image
Hi All, I have seen so many posts where people asked the differences between .isDisplayed() and .isEnabled() in Selenium/Webdriver automation and found mostly people are still confused. The methods .isDisplayed() and .isEnabled() have nothing in common.  Here I am trying to explain the read differences between .isDisplayed() and .isEnabled(). As name itself clearly says .isDisplayed() means is my object are visible or not on my webpage means Am I able to see my element through my eyes. Method   . isDisplayed()   : An element is considered   displayed   when it is perceptually visible to the human eye. The  element displayed  algorithm is a boolean state where true signifies that the element is displayed and false signifies that the element is not displayed. To compute the state on  element : ·          If the attribute  hidden  is set, return false. ...

XPath unable to find text with   or   using webdriver /

Hi, Some times we face issues to create XPath of  WebElement which have space in starting of it and then we check the element html source where we found &nbsp; or &nbsp is added before the element text while it display as space on UI. Normally we create the XPath to identify this element by adding space in the starting of it but his will not identify the element. There are another workaround to identify this element by contains text method. But if we have to identify the element with exact text having starting space or ending space  then we can use following way to do this. lets see this example <div class="myclass"> <label>AgendaShowCapacity &nbsp; </label> </div> OR <div class="myclass"> <label> &nbsp AgendaShowCapacity</label> </div> Following XPath will not work for this //label[text()='AgendaShowCapacity&nbsp;']  doesn't work Here we have to use follow...

Close All Browsers Except OLD One QTP VB

Hi All, Some times we required that Only OLD open Browser Window( Only for IE) will remain Open and rest of all should be closed during QTP scripting . Here is the Function which will close all the open Browsers except OLD Open browser (Work only for Internet Explorer using QTP) Public function fn_CloseAllBrowsersExceptOLD       rem create Browser description object          Set brwsr=Description.Create          brwsr(“micclass”).value=”Browser”          Set obj=Desktop.ChildObjects(brwsr)           browserCount= obj.count          Set obj=nothing          If  browserCount >1  Then          do             Browser(“CreationTime:=1″).Close             Set obj=Desktop.ChildObjects(brwsr)     ...