QTP Flex Testing Problem
I am trying to test a Flex Application with QTP. I have a Flex compiled application running at the severside.
In my scenario I have a Map (dynamically generated) with has some Nodes. Problem - First: QTP Doesn't recognize it, Second: It doesn't record any action( as per my knowledge If QTP doesn't recognize any Object it takes it as "WinObject" and record action on it, but Here QTP records nothing.
Along with that After Clicking that Node(element) a Flex Canvas Opens up, which also has many Controls like Menu bar Dropdown list, Button etc. but nothing is being recorded or recognized by QTP, except the main Canvas (parent Object).
Any advice is highly appreciated.
I too have an issue with the QTP Flex Add-in and the FlexDataGrid...
Apparently the comumnNames property was not implemented for the add-in or isn't working. When I use the GetRoProperty method in conjuction with the comunNames property it always is an empty string.
What's up with that?
Also, you cannot use the GetCellData method either.
Any ideas on a work-around?
Similar Messages
-
QTP Flex automated test limited replays
I have been writing QTP automated test for our company's flex
application. My computer has Flex Builder 3 trial version installed
and I get the message "License not present. With the trial verison
only limited replays are allowed." (for the ones with sharp eyes, I
didn't miss type a word of the message, it comes with that typo.)
from time to time.
And today I got the serial number from my boss. I enter the
serial and everything worked, but I am still getting that "License
not present" message when I was running my test. I tried to
uninstall Flex Builder 3 and the QTP Flex plugin and reinstall them
again, but it didn't help.
Anyone has a clue on how to solve this problem?
Thanks.If you are using static compilation with automation libraries
you need to recompile your application to get rid of the message. -
Running "Flex test drive" - Got error while attempting to connect to data service
Hi,
I'm a Flex / Flash builder beginner. I downloaded the 60 days evaluation, and started to run the "Flex test drive" :
http://www.adobe.com/devnet/flex/testdrive.html
My configuration :
XP SP3 PRO french edition
Tomcat 6.0
My local Eclipse :eclipse-jee-helios-SR2-win32 (but also got the issue on the Flash Builder Eclipse, which version is 3.4.0 (Generation ID M20090211-1700)
Flash Builder 4 with Eclipse plug-in
All on same PC
The Test Drive proposes examples in three technologies : Cold Fusion, PHP and Java. I'm doing the Java examples.
Installation of Flash Builder, as well as step 1 of the Test Drive (Build the user interface) went fine. I could run the project, which at the end of step 1 correctly displayed the UI in my browser.
Only one problem, I don't know if it is relevant for the rest of this post : I first got an error, saying that ports 8080, 8005 and 8009, requested by Tomcat, where used. After a short Google search, I fixed it by changing these ports to 8081, 8006, and 8010, in the Tomcat 6.0\conf\server.xml file.
The Test drive second step is "Connect to data". I found some discrepancies between the Test Drive doc, and what is displayed in Flash Builder. The Test Drive says :
"Use the Data menu and the Service Wizard to create a service for your application server. For ColdFusion and Java, specify the service file you put on your application server earlier (see Figure 9 for a PHP example). For Java, select the No password required check box, select the employeeService destination, and change the service package to services.employeeservice."
--> But there is no "No password required check box".
Also, when running the "Connect to data/service..." wizard, it was not at first completely clear what to choose. The proposed choices were :
BlazeDS
ColdFusion
HTTP
LCDS
PHP
Web Service
XML
Since all others choices, when tried, declared to be unconsistent with my project's server type, I finally selected "Web Service".
In the next wizard's form, according to the Test Drive indications, I specified the URI of my EmployeeService class : C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\testdrive\WEB-INF\classes\services\EmployeeService.class
That defined correctly the other fields.
But when pressing the "Next >" button, Flash Builder issued the following error message :
English translation : Unable to extract operations and entities from specified WSDL. Reason : an error occured while instrospecting the service.
And the full error text is :
An error occured while instrospecting the service. WSDLException: faultCode=PARSER_ERROR: Problem parsing 'file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%206.0/webapps/testdrive/W EB-INF/classes/services/EmployeeService.class'.: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 2-byte UTF-8 sequence.
It is usually relatively easy to find fixes through Google searches, but this time, it didn't work. So here I am, expecting a bunch of wise answers from all the nice Flex / FB gurus that I'm sure haunt this forum .
Thanks and best regards.
Marc.For those who would have the same problem, here is how I could eventually fix it.
Since the Flex Test Drive is sometimes out of sync with flash builder 4, I recreated a project using other help pages on Adobe site :
Entry point :
http://help.adobe.com/en_US/Flex/4.0/AccessingData/WSbde04e3d3e6474c4-668f02f4120d422cf08- 7ffd.html
As suggested, I used the New Project wizard to create a new project, with :
Application server type : J2EE
Check the radio button "Use remote object access service : BlazeDS"
Then, as indicated in following pages (section "Accessing BlazeDS")... :
file:///C:/Mes%20documents%20C/Commun/Developpement/Documentation/HT-Tracks/AccessingData/ help.adobe.com/en_US/Flex/4.0/AccessingData/WSbde04e3d3e6474c4-668f02f4120d422cf08-7ffe.ht ml#WSbde04e3d3e6474c4-19a3f0e0122be55e1b7-8000
...I selected the "Data / Connect to Data/Services..." menu option, which started the Data/service connection wizard.
There, I selected a BlazeDS (and not Web Services) service type, and everything went fine.
Suggestion to adobe staff : maybe it would be useful to update the Flex Test Drive to reflect Flash Builder 4 ?
Very nice product anyway, so far, congratulations...
Rgds
Marc. -
Flex/PHP problem lastResult does not work correctly
hi flex community,
I am trying to develope a small login but I am still new to flex. It's based a little bit on the tutorial "Flex Test Drive: Build an application in an hour". I have a mysql database where the username and the password are stored in.
My Flex file looks like this:
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:loginservice="services.loginservice.*"
currentState="Login"
width.Login="719" height.Login="606"
width.Main="975" height.Main="700" xmlns:valueObjects="valueObjects.*">
<fx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.FlexEvent;
protected function buttonLogin_clickHandler(event:MouseEvent):void
loginResult.token = loginService.login(username.text, password.text);
trace(vOLogin.username);
trace(vOLogin.password);
trace(vOLogin.valid)
/*if (vOLogin.valid == true) {
currentState = "Main";
]]>
</fx:Script>
<s:states>
<s:State name="Login"/>
<s:State name="Main"/>
</s:states>
<fx:Declarations>
<valueObjects:VOLogin id="vOLogin" />
<s:CallResponder id="loginResult" result="vOLogin = loginResult.lastResult[0] as VOLogin"/>
<loginservice:LoginService id="loginService"
fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"
showBusyCursor="true"/>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:TextInput id="username" includeIn="Login" x="118" y="37" width="107"/>
<s:TextInput id="password" includeIn="Login" x="118" y="88" width="107" displayAsPassword="true"/>
<s:Label includeIn="Login" x="20" y="38" width="84" height="22" text="Benutzername:"
textAlign="right" verticalAlign="middle"/>
<s:Label includeIn="Login" x="20" y="88" width="84" height="22" text="Passwort:"
textAlign="right" verticalAlign="middle"/>
<s:Button id="buttonLogin" includeIn="Login" x="22" y="143" width="195" label="Login"
click="buttonLogin_clickHandler(event)"/>
</s:WindowedApplication>
and my 2 php Files look like this:
VOLogin.php
<?php
class VOLogin {
public $id;
public $valid;
public $msg;
public $username;
public $password;
public $versionnumber;
?>
And this is my LoginService.php file:
<?php
require_once('VOLogin.php');
require_once('config.php');
//$foo = new LoginService();
//var_dump($foo->login("heinz", "heinz"));
class LoginService {
* Retrieve all the records from the table
* @return an array of VOBenutzer
* @param string $username
* @param string $password
public function login($username, $password) {
$mysql = mysql_connect(DATABASE_SERVER, DATABASE_USERNAME, DATABASE_PASSWORD);
mysql_select_db(DATABASE_NAME);
$SQL = "select * from flex where username='".$username."' and password='".$password."'";
$r = mysql_query($SQL);
if(mysql_num_rows($r) == 1) {
$row = mysql_fetch_object($r);
$tmp = new StdClass();
$tmp->id = $row->id;
$tmp->valid = true;
$tmp->msg = "Login Ok";
$tmp->username = $row->username;
$tmp->password = $row->password;
$tmp->versionnumber = $row->versionnumber;
$output[] = $tmp;
}else {
$tmp = new StdClass();
$tmp->id = 0;
$tmp->valid = false;
$tmp->msg = "Benutzername oder Passwort falsch";
$tmp->username = $username;
$tmp->password= $password;
$tmp->versionnumber = 0;
$output[] = $tmp;
return $output;
?>
My actual problem is that I have to press 2 times on the button to get the correct trace information. With the help of the search function I found this thread:
http://forums.adobe.com/thread/259280
I am not sure if I have the same problem. If yes where should I put the eventhandler? I would be very happy for every useful answer.
Greetings
flexx0rHere is a good article on how the % key works.
It is working as designed. It just isn't what you are expecting. It just isn't designed for Engineers.
http://blogs.msdn.com/b/oldnewthing/archive/2008/01/10/7047497.aspx -
Recently, my Iphone shuts down at 50%+ bettery. My local Apple Store told me that the bettery was tested problem and needs to be repaired or changed. Since the phone is still under a year warranty, I was suggested to return it to the US Apple Store for help. Please let me know if I can send it to any store in the US or the store where I bought. Also, I don't find the email receipt. Will it be a problem for repair? Your quick response will be very appreciated. Thank you.
One more question. Can it be down without the receipt? If yes, I will send the phone to US immediately before warranty expired. Thank you.
-
Printing a graphic with a gradient mask in Flex 3-problem
Hello, I am fairly new to flex development. I am puting together a little program that allows the user to upload a picture add a vignette mask in order to achieve a soft edge, and have a problem I cannot find an answer anywhere, maybe someone could help me please.
I want to print a the user photo with a gradient mask or vignette from flex. I managed to show the image correctly on screeen with the gradient mask using this class but the output to paper is a rectangle without the soft mask.
//package to add the mask for display
package com.dm.graphics
import flash.display.Graphics;
import mx.containers.Canvas;
import flash.display.GradientType;
public class FrameBorderSoft extends Canvas
override protected function updateDisplayList(w:Number, h:Number):void
super.updateDisplayList(w,h);
var g:Graphics = this.graphics;
g.clear();
g.beginGradientFill(GradientType.RADIAL, [0x000000, 0x000000, 0x000000, 0x000000],
[1,1,0.8,0],
[1,128,195,255],
horizontalGradientMatrix(0,0,w,h) );
g.drawRect(0,0,w,h);
g.endFill();
It works beautifully until I try to print the graphic. The image prints but without the gradient edges (soft) instead it is just a sharp edge rectangle.
Does anyone know how to do this?
Here is my print function:
private function doPrint():void {
// Create an instance of the FlexPrintJob class.
var myPrintJob:FlexPrintJob = new FlexPrintJob();
// Start the print job.
if (myPrintJob.start() != true) return;
// Add the object to print. Do not scale it.
if (tabnavigator1.selectedChild == img1) {
//switchcolor is a variable to detect if the user changed the background to white or clear.
switchcolor = 100;
//printCF is the card front container with the photo masked
myPrintJob.addObject(printCF, FlexPrintJobScaleType.NONE);
myPrintJob.printAsBitmap = false;
} else if (tabnavigator1.selectedChild == img1b) {
switchcolor = 100;
myPrintJob.addObject(printCB, FlexPrintJobScaleType.NONE);
I hope this helps to visualize,
I would greatly appreciate any assistance or advise.Hello, back on my issue, i tested a little bit more the message dispaching.
I read the lazyLoadPolicy class and noticed that it always has to have a ModuleId property in the message to work, that's why the broadcast message didn't work to awake the module with the lazy loading policy.
So i added copy of my module:
<cairngorm:ParsleyModuleDescriptor objectId="test"
url="TestModule.swf"
applicationDomain="{ClassInfo.currentDomain}"
/>
<cairngorm:ParsleyModuleDescriptor objectId="testbis"
url="TestModuleBis.swf"
applicationDomain="{ClassInfo.currentDomain}"
/>
Set them both with a basicLoadPolicy, and tries to dispatch a message to only one of them using the ModuleId metatag. I then noticed that both modules received the message and not only the one i expected.
I then changed the ModuleMessageInterceptor configuration to dispatch to only one kind of module:
<cairngorm:ModuleMessageInterceptor type="{ OpenViewMessage }" moduleRef="test"/>
and this worked as expected. Only the first module catched the message. I am obiously messing with the ModuleId metatag but i cannot see what's wrong...
I compiled with
-keep-as3-metadata+=ModuleId
but this hasn't changed anything... -
Flex Mobile: Problems with MultiDPI SplashScreen
Hi guys,
The property applicationDPI in my application is 160, and I created three bitmaps to 160, 240 and 320 DPI to be used in the SplashScreen.
I created this class . see : http://www.adobe.com/devnet/flex/articles/mobile-skinning-part2.html#articlecontentAdobe_n umberedheader_5
package preloaders
import mx.core.DPIClassification;
import mx.core.mx_internal;
use namespace mx_internal;
public class MultiDPISplashScreen extends CustomSplash
[Embed(source="assets/mobile160/splash_160.png")]
private var SplashImage160:Class;
[Embed(source="assets/mobile240/splash_240.png")]
private var SplashImage240:Class;
[Embed(source="assets/mobile320/splash_320.png")]
private var SplashImage320:Class;
public function MultiDPISplashScreen()
super();
override mx_internal function getImageClass(dpi:Number, aspectRatio:String):Class
if (dpi == DPIClassification.DPI_160)
return SplashImage160;
else if (dpi == DPIClassification.DPI_240)
return SplashImage240;
else if (dpi == DPIClassification.DPI_320)
return SplashImage320;
return null;
Ih the main app:
<s:TabbedViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
applicationDPI="160"
preloader="preloaders.MultiDPISplashScreen"
splashScreenMinimumDisplayTime="2000">
The problem is that Flex does not take the correct bitmap if i run my app at 240DPI or at 320DPI (as does the class MultiDPIBitmapSource)and my splash screen is scaled and grainy! :-(
Can anyone help me?
Thnks a lot!
FrancescoHi Francesco,
Setting the application dpi shouldn't affect the splash screen (you can verify by testing when you don't set the app dpi or by debugging the function). The dpi that gets passed in to the imageClass should always be the runtime dpi.
I see that in your MultiDPISplashScreen class extends CustomSplash instead of the SplashScreen. Maybe that could be the issues, where does CustomSplash come from?
Edit:
The issue seems to be that in the SplashScreen class we don't undo the automatic dpi scale factor when the scaleMode="none" (the default). When this is combined with different images per dpi, this will cause the observed behavior. Setting scaleMode to any other value should fix the issue.
If you need to have the image centered and not scaled, then you may follow the work-around posted by Uggers at the end of the thread (bottom of the page) at http://www.adobe.com/devnet/flex/articles/mobile-skinning-part2.html#articlecontentAdobe_n umberedheader_5
Thanks,
-Evtim -
Has anyone got the QTP "Siebel Test Optimizer/Express API" workng?
Hi,
We are trying to demo the "test optimizer" (earlier called "test express") capability of synchronizing the siebel repository with the QTP object repository.
We have tried installing the EAR files given by Oracle on both JBoss and Weblogic servers but keep getting an error "database name lookup failed" when trying to connect QTP to Siebel via the test optimizer wizard.
Siebel version is 8.0
Please let us know if anyone has managed to get this working and detailed steps / any error encountered and their resolution!
Regards,
HemantHi,
I know it's a little too late to reply to this thread but wanted to know if you were able to figure out the problem. If not, please reply back and I think I will be able to help you out.
Regards,
Rahul -
Hello Experts,
I have a Problem with my Flex Application. I want to send data as a String from a Flex Combobox to a Webservice. But the String has before and after the value inverted comma's (").
How can I replace this inverted comma with a blank?
Here the Code how I get the Data from the ComboBox:
comboBox.dataProvider = auswahl;
str = ObjectUtil.toString(cb.selectedLabel.toUpperCase());
Thanks for your answers in advance!!!to remove the inverted comma from the string use action script replace method.
public function fixstring():void
var str:String ;
var str1:String ;
str = "\"test\"" ;
var pattern:RegExp = /\"/gi;
str1 = str.replace(pattern,"");
Alert.show(str1);
for more on this read this online help
http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000076.html -
Hi All,
We had a problem while testing mapping in Altova Map Force.Here question is while testing our mapping in IR's interface mapping we got the message "Error while loading XSLT ".Target result is notgetting displayed.
Any ideas.....
Regards,
Surya.After importing XSL in imported archives, double click it and check whether u can open it or not. Make sure that the namespace ur XSL uses is same as the namespac under which it is imported. Make sure file loaded is XSL and not XSLT. Then try running end-to-end scenario and check the result.
Regards,
Prateek -
Hi All. I have a very weird problem here, as I can't get the Apple Hardware Test to start on my late 2008, 2.66 MBP15 inch model# MC026LL/A (released early 2009 as a quiet upgrade from 2.53). Here's the story:
I opened up my machine as usual one morning, and the optical drive made a very weird noise I never heard before. So I decided to run the Apple Hardware Test (AHT) to see if anything was amiss. Well, I inserted the second install disk, held down the "d" key, and restarted the machine. It began to boot into the hardware test, but just after the AHT screen appears the computer just shut down. This happens every time I try to run the AHT.
I went to an Apple Store while I was on holiday in Brisbane (they don't have one here in Adelaide), and the genius said it was likely a bad optical drive. Well, I returned to Adelaide last week and had the local Apple Authorized store replace the optical drive. Tried to run AHT once again, and the same problem persists. So the original problem wasn't with the optical drive.
I thought maybe I accidentally used the startup disks for my wife's late 2008 15inch, 2.4, MBP (the one actually released in late 2008). I've looked around for the other sets of disks and can't find them. So here's what I'm asking help for: can someone who owns a 15inch MBP 2.66 15-inch (released in early 2009, model# MC026LL/A ) please tell me what the part # is for their set of install disks? It is written on the plastic sleeves of the install disks. And, could this person please tell which version of AHT is written on the disk itself? The set I have (which I think might be my wife's) has AHT version 3A158.
Might this be the problem, or should my computer still be able to run the hardware test using my wife's disks? I know they are both technically late-2008 15inch unibody MBPs, but I think my 2.66 (again, quietly updated and released in early 2009) might require a different AHT version, which would explain my inability to run the test. If not, what might be causing my computer to not run the AHT? I tried reinstalling OS X to no avail.
Thanks for all of your help!I think I share your skepticism--if your Mac was shipped with the later version of the OS, you should not have been able to do a clean install with discs of an earlier version. It looks like some machines originally shipped with OS X v. 10.5.5 and others with OS X v. 10.5.6. I don't remember just when 10.5.6 came out.
Your two machines are likely very similar in build, and maybe similar enough for the OS to install. It may be that the AHT is specifically designed for the hardware in each machine, and that would be a bit different.
As someone else said in another thread, there ought to be a tutorial on how to keep track of the original install discs since they are always getting lost. Maybe a secure note in the keychain or something like that.
Out of curiosity, does the AHT work on your wife's machine? If not, there could be a problem with the install disc itself, and if so, you might be able to get a free replacement under warranty.
Good luck! -
Can't edit audio tracks anymore FLEX EDIT PROBLEM
Due to year long problems with my Mac, Apple replaced it with a brand new one but it came with the updated Garageband '11 with Flex Time. I currently have a podcast and am over a month behind and because I can't figure out this new audio/flex time edit thing. It appears that I am not the only one on disccussion forums and YouTuve but I need HELP!
PROBLEM: I can't edit tracks. Flex Time turns on and analyzes over and over and over and over. I can't edit or cut things out. It wants to stretch them out! HELP!
FLEX TIME is terrible.jaysenpluto wrote:
Flex Time turns on and analyzes over and over and over and over. I can't edit or cut things out.
http://www.bulletsandbones.com/GB/GBFAQ.html#noflex
(Let the page FULLY load. The link to your answer is at the top of your screen) -
Zend Amf & Flex 3, problem when many records returned
I have a project with a start dateField (calendar) and an end dateField (calendar). The user chooses a start date and an end date and the database pulls latitude and longitude coordinates for events that occurred between those dates. If the user chooses dates that produce fewer than roughly 11,200 records, it works perfectly. If the user chooses dates that produce more than that, it produces the following error message:
faultCode:Client.Error.DeliveryInDoubt
faultString:'Channel disconnected'
faultDetail:'Channel disconnected before an acknowledgement was received'
The server is my local machine (localhost). I'm running:
MAMP (which has Apache 2.0.59)
Flex 3
I tried editing the my.cnf (mySQL options file) and increased the max_allowed_packet to 32M, but that didn't work.
It's a strange problem as the same code works when a relatively small amount of data is returned, but doesn't work when more data is pulled. Could it be some sort of memory or packet limit or a time-out that is called?
If anyone has any suggestions, please let me know.
-LaxmidiRichard Bates of flexandair.com figured it out. In my php.ini file, I had the memory limit set at 8M. After, changing it to 32M, it worked. Thank you, Richard!
-Laxmidi -
Where can I find the path to the Flex SDK? Last time I embeded metadata, Flash CS5 automatically found it for me. This time its not working. I get this message in the output window:
You have used a feature that requires the Flex SDK:
"Embed" metadata
Please set the Flex SDK path if necessary and add it to the library path for this file. The Flex SDK folder contains the bin, frameworks, lib and other folders.
Thanks for your help
ShiimI did that. I found an SDK that was in the FlashDevelop folder, but the SDK that comes with Flash CS5 is missing or hidden. I did an unhide files in the control panel. but the folder is still not there. Also my program works if I click Test Project, but it will not work with ctrl+enter. Something keeps getting messed up, but I'm not familiar enough with the Flash IDE to fix it. I've re-installed 3 times.
Thanks
Shiim -
ADF - MyFaces, HttpUnit testing problem with Javascript.
Dear all
Does anybody know how to test ADF Faces. Any tool would be of interest to me although Opensource and Free Software is prefered?
My task is to write a set of unit tests to test an Oracle ADF and Apache MyFaces application. I have attempted to use both Cactus and HttpUnit. However I am struggling with a simple test case which should simulate a login.
The problem I have is that ADF Faces produces the following dynamic javascript file (I am guessing it is dynamic because I can not find this in either adf-faces-impl-10_1_3_0_4.jar or adf-faces-api-10_1_3_0_4.jar which are the two jars am implementing in my project.):
Common10_1_3_0_4.js
Which when parsed by js.jar (Rhino javascript engine) I get the following error:
com.meterware.httpunit.ScriptException: Event 'submitForm('maincontent:loginForm',1, {source:'maincontent:submit'});return false;' failed: org.mozilla.javascript.EcmaError: TypeError: Cannot call method "split" of undefined at
com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.handleScriptException (JavaScript.java:202)
(This file Common10_1_3_0_4.js is over 5000 lines long and so I do not want to post it as this posting is already quite long).
Downloading the file directly after it has been built and modifying it and fixing the error by ensuring the split function is called on a strongly typed String variable, then commenting out from the web.xml below I tried the HttpUnit test again.
<servlet>
<servlet-name>resources</servlet-name>
<servlet-class>oracle.adf.view.faces.webapp.ResourceServlet</servlet-class>
</servlet>
<!-- servlet-mapping>
<servlet-name>resources</servlet-name>
<url-pattern>/adf/*</url-pattern>
</servlet-mapping -->
This time I get no error, but the original login page simply gets served again.
login.jsp (which is called as login.jsf)
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib uri="http://xmlns.oracle.com/adf/faces/html" prefix="afh"%>
<%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af"%>
<!-- Content -->
<af:objectSeparator />
<af:panelBox text="#{msg['login.info.loginHeader']}" width="100%" background="transparent">
<af:form id="loginForm">
<af:objectSpacer height="10px" />
<af:panelGroup layout="vertical">
<af:panelForm labelWidth="5%">
<!--User Name-->
<af:panelLabelAndMessage for="username">
<af:inputText label="User Name:"
id="username"
columns="25"
required="yes"
secret="false"
value="#{userBean.userName}"
shortDesc="#{msg['global.user.userName']}" />
</af:panelLabelAndMessage>
<af:panelLabelAndMessage for="password">
<af:inputText label="Password:"
id="password"
columns="25"
required="yes"
secret="true"
value="#{userBean.password}"
shortDesc="#{msg['global.user.password']}" />
</af:panelLabelAndMessage>
<af:objectSpacer height="10px" />
<!--Login Button-->
<af:commandButton id="submit"
textAndAccessKey="#{msg['global.button.login']}"
action="#{userBean.login}" />
</af:panelForm>
</af:panelGroup>
</af:form>
</af:panelBox>
TestCase LoginTest.java:
package com.siemens.pse.wmstesting;
import java.io.IOException;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import com.meterware.httpunit.GetMethodWebRequest;
import com.meterware.httpunit.WebConversation;
import com.meterware.httpunit.WebForm;
import com.meterware.httpunit.WebLink;
import com.meterware.httpunit.WebRequest;
import com.meterware.httpunit.WebResponse;
public class LoginTest extends TestCase {
* The URL of the Login page for all login tests
public static final String URL = new String( "http://localhost/WMS/pages/login.jsf" );
public static void main( String args[] ) {
junit.textui.TestRunner.run( suite() );
public static TestSuite suite() {
return new TestSuite( LoginTest.class );
public LoginTest( String s ) {
super( s );
public void testGetLogin() throws Exception {
response = new WebConversation( ).getResponse( request );
// Test the result
assertContains( response, "Login Management" );
public void testLoginSuccess() throws Exception {
response = new WebConversation( ).getResponse( request );
WebForm form = response.getFormWithID( "maincontent:loginForm" );
assertNotNull( "No form found with ID 'maincontent:loginForm'", form );
form.setParameter( "maincontent:username", "admin" );
form.setParameter( "maincontent:password", "pass" );
WebLink submit = response.getLinkWithID("maincontent:submit");
response = submit.click();
System.out.println( response.getText());
// Test the result
assertContains( response, "Welcome to the Temperature Measurement System" );
* Convenience function that asserts that a substring can be found in
* the returned HTTP response body.
* @param theResponse the response from the server side.
* @param s the substring to look for
public void assertContains( WebResponse response, String s ) {
String target = new String("");
try {
target = response.getText(); }
catch (IOException e) {
e.printStackTrace(); }
if ( target.indexOf( s ) < 0 ) {
// Error showing which string was NOT found
fail( "Response did not contain the substring: [" + s + "]" );
private WebRequest request = new GetMethodWebRequest( LoginTest.URL );
private WebResponse response;
}Dear All
Well I found the solution to my testing requirements. HtmlUnit is able to deal with the dynamic Javascript that is generated by the ADF Faces application. The strange part is that HtmlUnit uses the Rhino Javascript engine just as HttpUnit and Cactus, however these two could not deal with the javascript whereas HtmlUnit could.
I include a snippet of a test case that I wrote that now works.
public void testLoginSuccess() throws Exception {
final WebClient webClient = new WebClient( BrowserVersion.INTERNET_EXPLORER_6_0 );
final URL url = new URL("http://localhost/WMS/pages/login.jsf");
final HtmlPage page = (HtmlPage)webClient.getPage(url);
// Get the form that we are dealing with and within that form,
// find the submit button and the field that we want to change.
final HtmlForm form = page.getFormByName("maincontent:loginForm");
final HtmlTextInput usernameField = (HtmlTextInput) form.getInputByName("maincontent:username");
final HtmlPasswordInput passwordField = (HtmlPasswordInput) form.getInputByName("maincontent assword");
final ClickableElement button = (ClickableElement) form.getHtmlElementById("maincontent:submit");
// Change the value of the text field
usernameField.setValueAttribute("admin");
passwordField.setValueAttribute("pass");
// Get the submitted form
final HtmlPage welcomePage = (HtmlPage) button.click();
assertEquals( "Temperature Measurement System", welcomePage.getTitleText() );
}
Maybe you are looking for
-
Multi-Currency Customer Receivables Aging Query
Hello Everyone, SAP B1 2005 SP 01 PL 42 We cannot produce customer statements for multi-currency accounts (CND & USD) through the Customer Receivables Aging report. The report converts all FC to LC which is not useful to the customer. The statement
-
[SOLVED] Arch won't boot after I created a separate /var parition
Arch won't boot after I created a separate /var parition on an existing installation.And let me confess: it was maybe stupid trying to do it on an existing install. I edited the fstab correctly, copied the files using rsync preserving permissions. Th
-
Open Hub Services, Format of files
Hi everybody Does anybody knows how to create a CSV file in ascii format using an open hub in a process chain ? On my system which is a unicode it seems to be as if I could only produce unicode file when I use the process chain. Thank you for your he
-
Unusual characters in database
If an XSQL query returns certain characters, the resulting XML is invalid (note the character below is hex 1F): <?xml version="1.0" encoding="UTF-8" ?> <xsql:query connection="cons" xmlns:xsql="urn:oracle-xsql"> <![CDATA[ SELECT '' AS "BAD", '&' AS "
-
Hi Friends, I was trying to do sample application provided by J2EE "http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html" I was stuck at one point. I was doing Java Servlet Technology example, in that book store example example it was told to fi