I do not have a good way of dealing with Checkboxes and Radio Buttions on Web Pages. An image capture makes it extremely difficult .
Are you using relative hot spots? We show you how to use them in the tutorial that comes with Eggplant. This is the best technique to use when dealing with checkboxes and radio buttons. If you are not familiar with it, I suggest you review the tutorial, but I’ll give you an overview here.
The basic technique is to capture an image of the label of the checkbox or radio button without including the control itself. But before you capture the image, hold down the command (apple) key and click on the radio button or checkbox. This will move the red crosshair (the hot spot) to the point that you clicked on (which should be outside the capture area). This allows Eggplant to look for just the label and then click on the control, regardless of whether it is currently selected or not. This works especially well for radio buttons, where clicking on the desired button works whether it is the current selection or not. With radio buttons it is not usually necessary to know what the current selection is, but rather only to make the selection that you want to test, and the rest takes care of itself.
Checkboxes can be a little trickier, since they are toggled when clicked on. We do provide functions in the Eggplant Examples forum that can be used to find an image near a location on the screen (generally defined by another image). This could be used to identify the checkbox label, then see if a selected checkbox is “near” it. Let us know if you need more assistance.
Thanks it did my work . As we do web Testing mostly we have a few questions . Would appreciate pointers towards the same
- If the SUT Screen is large how do I scroll down and have the same recorded ?
It looks like your message may have been cut off, but I can answer the one question that made it into your post.
One easy way of handling the scrolling of windows is to use the pagedown keys, for example:
repeat while not imageFound("submit button") TypeText PageDown end repeat
You might want to turn this into a script that would take any image name as an argument:
params imageToFind repeat while not imageFound(imageToFind) TypeText PageDown end repeat
If you named this script, “ScrollToImage”, you could then call it like this:
I hope this helps.
sorry I missed the others :
2) I want to get a part of the web Page suppose a System Generated Number and compare it against a regular expression . Is there a reliable way of doing the same ?
Really appreciate your prompt answers . I think your product is doing great and we will use it more widely in our Organisation’s Automation Process . BTW we have 4 licenses from you already.
You can also use the relative hotspot technique here to select some text adjacent to a label. So you might capture an image of a “Serial Number” label, for example, with the hot spot to the right of the image. Double-clicking this image would then select the number to right of the label. You can then copy that selection to the clipboard of the SUT and bring it into Eggplant as text. That process would look like this:
DoubleClick "Serial Number Field" TypeCommand "c" -- use the Mac copy shortcut put the RemoteClipboard into serialNumberString
From there you can do some comparisons on the string. While SenseTalk doesn’t have true regular expressions, you could do something like this:
if the number of characters in serialNumberString is less than 11 or serialNumberString does not start with "abc" then LogError "Invalid serial number" end if
If you need help working out how to perform a particular string comparision, let us know and we’ll try to come up with an algorithm for you.