how to use checkpoints in webdriver

765 views
Skip to first unread message

Anubha gupta

unread,
Sep 17, 2012, 7:59:22 AM9/17/12
to webd...@googlegroups.com
Can anyone explain how to use checkpoints in webdriver

Krishnan Mahadevan

unread,
Sep 18, 2012, 5:03:35 AM9/18/12
to webd...@googlegroups.com
What checkpoints are you referring to ? Can you please help elaborate more ?

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"



On Mon, Sep 17, 2012 at 5:29 PM, Anubha gupta <anu.r...@gmail.com> wrote:
Can anyone explain how to use checkpoints in webdriver

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To post to this group, send email to webd...@googlegroups.com.
To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.

Peter Gale

unread,
Sep 18, 2012, 6:41:11 AM9/18/12
to webd...@googlegroups.com
What do mean by checkpoints?

It sounds like you are referring to something in you host programming language rather than the WEbDriver API.


Date: Mon, 17 Sep 2012 17:29:22 +0530
Subject: [webdriver] how to use checkpoints in webdriver
From: anu.r...@gmail.com
To: webd...@googlegroups.com


Can anyone explain how to use checkpoints in webdriver

pna...@gmail.com

unread,
Sep 18, 2012, 6:44:30 AM9/18/12
to webd...@googlegroups.com
If you are coming from QTP background, you do this using Asserts of the respective unit testing framework you use. Please look at Assert class of Junit or TestNg.
Sent from my BlackBerry® wireless device

From: Anubha gupta <anu.r...@gmail.com>
Date: Mon, 17 Sep 2012 17:29:22 +0530
Subject: [webdriver] how to use checkpoints in webdriver

Can anyone explain how to use checkpoints in webdriver

--

Kanik

unread,
Sep 18, 2012, 7:47:37 AM9/18/12
to webd...@googlegroups.com
Hi Pratika,

I got u....u r asking w.r.t QTP.
There is nothing like that. You have to create custom functions that can verify Standard Properties - For Started Checkpoints

Text Properties - Assert - Presence.

Write Function that execute SQL Query and retrieve Result Set - Compare this with WebTable - WebTable Checkpint.

Same for Image and Bitmap Checkpoint

I HAVE CREATED FUNCTIONS FOR BITMAP CHECKPOINT.


Thanks
Kanik

darrell

unread,
Sep 18, 2012, 10:23:58 AM9/18/12
to webd...@googlegroups.com
WebDriver is more simplistic than Quick Time Professional (QTP). QTP tries to handle a lot of stuff for you. WebDriver expects you to work with basic elements and build up a library of functionality.

People who like QTP are willing to pay for all the functionality, like checkpoints, built into the product. People who don't need all the extra functionality or like the sense of control they have working with basic elements want something which is free and you are really paying for the person programming with the WebDriver framework.

For example, QTP will check the number of anchors and images on a web page. In WebDriver I can use:

List<WebElement> actualAnchors = driver.findElements(By.tagName("a"));
List<WebElement> actualImages = driver.findElements(By.tagName("img"));
int actualTotal = actualAnchors.size() + actualImages.size();
int expectedTotal = 37;
assertEquals(expectedTotal, actualTotal);

If I remember my QTP correctly, this is the equivalent of inserting a page checkpoint. In this example I expect there to be a total of 37 images + anchors on the given page. I ask the driver to give me all the anchors, <A>, and images, <IMG>, on the page then I add up the total. If it does not equal the expected total the assertEquals will throw an exception and it will continue to the next test.

In other words, simulating the equivalent of QTP checkpoints can be rather trivial for someone strong in WebDriver. Additionally, I could write a 'checkpoint' function which not only checks the totals but checks to see if the attributes are all the same. In other words, because WebDriver gives me more control, I can define my methods so they do more than the built-in methods of QTP.

On the other hand, if I am not strong in WebDriver and a supported programming language, it would be easier for me to use the built-in method of QTP.

Bottom line, you'll have to write all our own checkpoint methods in WebDriver. This may be a blessing or a curse.

Darrell

Simon Stewart

unread,
Sep 18, 2012, 10:47:26 AM9/18/12
to webd...@googlegroups.com
This is one of the reasons I advocate pairing on your code with a
developer. That, and it gives them some insight into what you're
actually trying to do, which may lead to a more testable app.

Simon
> --
> You received this message because you are subscribed to the Google Groups
> "webdriver" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/webdriver/-/-iMo1qqsLXIJ.
Reply all
Reply to author
Forward
0 new messages