Hi There,
I have completed few steps in QTP-Flex development. I am facing some
unexpected behavior of the QTP-Flex Plugin.For example when I record
the application for logging into application, I get following Script
on QTP Editor, which is runable also.
Browser("Browser").FlexApplication("App").FlexForm("mainPanelForm").FlexTextArea("usernameText").SelectText
0,0
Browser("Browser").FlexApplication("App").FlexForm("mainPanelForm").FlexTextArea("usernameText").Input
"chas"
Browser("Browser").FlexApplication("App").FlexForm("mainPanelForm").FlexTextArea("usernameText").ChangeFocus
Browser("Browser").FlexApplication("App").FlexForm("mainPanelForm").FlexTextArea("passwordText").Input
"chas"
Browser("Browser").FlexApplication("App").FlexForm("mainPanelForm").FlexTextArea("passwordText").ChangeFocus
Browser("Browser").FlexApplication("App").FlexForm("mainPanelForm").FlexButton("Login").Click
We are writing scripts like as given below
FxLogin- is a QTP Action
Option Explicit
Browser("Browser").Sync
With oTEFlexHelpers
Dim application, flexForm , actionName
actionName = "FxLogin"
Set application =
Browser("Browser").FlexApplication("App")
Set flexForm = application.FlexForm("mainPanelForm")
Dim fxTextAreaUserName , fxTextAreaPassword , fxButtonLogin
Set fxTextAreaUserName =
flexForm.FlexTextArea("usernameText")
Set fxTextAreaPassword =
flexForm.FlexTextArea("passwordText")
Set fxButtonLogin = flexForm.FlexButton("Login")
With oTEHelpers
Dim userName, password,loginTitle , osTitle
userName
= .getDataFromXMLFile(Parameter("inputFile"),Parameter("userType"),"UserName")
password
= .getDataFromXMLFile(Parameter("inputFile"),Parameter("userType"),"Password")
End With
Call .setValue (fxTextAreaUserName , "chas" , actionName ,
"fxTextAreaUserName")
Call .setValue (fxTextAreaPassword , "chas" , actionName ,
"fxTextAreaUserName")
'Call fxButtonLogin.Click()
Call .click (fxButtonLogin , actionName , "FxButtonLogin")
End With
And
TEFlexHelpers.vbs – is a common Function library file contains most of
the functions used in above script like
Click function as given below
Public Sub click (ByRef fxField , actionName , fieldName)
If(fxField.Exist) Then
fxField.SetFocus
MsgBox fxField.GetROProperty("mouseEnabled")
fxField.Click
Else
Call oReporterManager.ReportTestFail ("Fail",
actionName,
fieldName, "Field Not Found", fieldName + " could not be found on the
page")
End If
End Sub
Now the problem is If I execute the above written action along with
the click function given above. I received the Error on line
‘fxField.Click’(shown in bold), the statement of Error line is as
given below.
Unable to find automation method 'click' for class 'name: FlexButton
superClassName: FlexObject
event2descriptor: (Object)#0
flash.events.FocusEvent|keyFocusChange =
(mx.automation.qtp::QTPEventDescriptor)#1
eventClassName = "flash.events.FocusEvent"
eventType = "keyFocusChange"
name = "ChangeFocus"
flash.events.KeyboardEvent|keyPress =
(mx.automation.qtp::QTPEventDescriptor)#2
eventClassName = "flash.events.KeyboardEvent"
eventType = "keyPress"
name = "Type"
flash.events.Mouse
Here I have couple of problems, first why this Error come when all
other properties of FlexButton Object are intact(I have checked them
on the fly in debug mode.). Second is why Script runs fine in recorded
version of code.
Third What do I do to recover from this problem. There is an only 1
blog I have found about such problem which speaks about other work
around for this problem but not specifying reason for this problem.
Also the resolution mentioned in this blog uses x and y coordinate of
the component, which we cannot use for Alert popup boxes of Flex
environment.
My Observation is this problem is occurring due to change in state of
the FlexButton Object while it has been passed to function as
parameter. And VBScript environment is not giving caster for Object
types(caster are available for primitive types only.)
If you know any one knowing the answer to this problem please let me
know, because button is simple component of the Flex environment, we
still have many components to even verify in Business ops application.
I have tried to get Support from Adobe but, it seems they charge some
money for that or may they required to have license copy of software
for providing Support.
Please help.
Thanks,
Sandeep Mule
Senior Software Professional, Financial Solutions Unit
Banking & Insurance
TietoEnator Software Technologies Pvt. Ltd.
Indian Software Centre
Tel + 91 20 6640 2233 / 44
Mobile +91 9967 969493
Fax + 91 20 6640 2255
Email: [EMAIL PROTECTED]
8th Floor, D Building, Weikfield IT Citi Info Park,
Nagar Road, Pune - 411014, India
www.tietoenator.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---