Flash/Flex documentation/code samples
-
- Posts: 24
- Joined: Tue Apr 03, 2012 3:05 pm
Flash/Flex documentation/code samples
Hi,
New here, trying to do a proof of concept of Ranorex against our Flash/Flex applications. How do I spit out values of text fields? Eventually, I want to save these values to an XLS or CSV file.
This did not work:
FlexElement textTextInput = "/dom[@domain=REMOVEDFORPRIVACY]/body/flexobject/container[@id='view']/element/container/container/container/container[@type='Canvas']/container/container/container[2]/container[@id='_EmployeeSummary_DetailsTile1']/text[@id='valueBox']";
WinForms.MessageBox.Show(textTextInput["value"]);
Thanks,
Bob
New here, trying to do a proof of concept of Ranorex against our Flash/Flex applications. How do I spit out values of text fields? Eventually, I want to save these values to an XLS or CSV file.
This did not work:
FlexElement textTextInput = "/dom[@domain=REMOVEDFORPRIVACY]/body/flexobject/container[@id='view']/element/container/container/container/container[@type='Canvas']/container/container/container[2]/container[@id='_EmployeeSummary_DetailsTile1']/text[@id='valueBox']";
WinForms.MessageBox.Show(textTextInput["value"]);
Thanks,
Bob
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Flash/Flex documentation/code samples
Hi,
to access the text value of your text adapter you can use the TextValue property:
http://social.msdn.microsoft.com/Forums ... db45627f99
Regards,
Tobias
Ranorex Team
to access the text value of your text adapter you can use the TextValue property:
WinForms.MessageBox.Show(textTextInput.TextValue);
Therefore please have a look at e.g. following site:robert_butler wrote:Eventually, I want to save these values to an XLS or CSV file.
http://social.msdn.microsoft.com/Forums ... db45627f99
Regards,
Tobias
Ranorex Team
-
- Posts: 24
- Joined: Tue Apr 03, 2012 3:05 pm
Re: Flash/Flex documentation/code samples
I get the following error?
'Ranorex.FlexElement' does not contain a definition for 'TextValue' and no extension method 'TextValue' accepting a first argument of type 'Ranorex.FlexElement' could be found (are you missing a using directive or an assembly reference?) (CS1061)
'Ranorex.FlexElement' does not contain a definition for 'TextValue' and no extension method 'TextValue' accepting a first argument of type 'Ranorex.FlexElement' could be found (are you missing a using directive or an assembly reference?) (CS1061)
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Flash/Flex documentation/code samples
Hi,
sorry, I haven't seen that you use the FlexElement adapter.
Please try to use the Text adapter instead:
Tobias
Ranorex Team
sorry, I haven't seen that you use the FlexElement adapter.
Please try to use the Text adapter instead:
Text textTextInput = "/dom[@domain=REMOVEDFORPRIVACY]/body/flexobject/container[@id='view']/element/container/container/container/container[@type='Canvas']/container/container/container[2]/container[@id='_EmployeeSummary_DetailsTile1']/text[@id='valueBox']"; WinForms.MessageBox.Show(textTextInput.TextValue);Regards,
Tobias
Ranorex Team
-
- Posts: 24
- Joined: Tue Apr 03, 2012 3:05 pm
Re: Flash/Flex documentation/code samples
Thank you! That works.
Question, when do I use the FlexElement adapter in the coding? The element would be listed as a FlexElement type adapter in the repository?
Question, when do I use the FlexElement adapter in the coding? The element would be listed as a FlexElement type adapter in the repository?
-
- Posts: 24
- Joined: Tue Apr 03, 2012 3:05 pm
Re: Flash/Flex documentation/code samples
Another question:
If I am going to loop through many iterations (test cases) and want to spit out the data values for each test case to the same csv file, is there a way to store these values until the end, then write them all to the csv file?
Thanks!
If I am going to loop through many iterations (test cases) and want to spit out the data values for each test case to the same csv file, is there a way to store these values until the end, then write them all to the csv file?
Thanks!
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Flash/Flex documentation/code samples
Hi,
Flash/Flex Testing
For more details about Ranorex Adapters please have a look at following chapter of our user guide:
Ranorex UI Adapter
As shown in the link provided before.
Regards,
Tobias
Ranorex Team
With the FlexElement adapter you can set and get most common attributes of the controls as describes in following chapter of our user guide (see heading "How to read/set attributes and styles"):robert_butler wrote:Question, when do I use the FlexElement adapter in the coding?
Flash/Flex Testing
For more details about Ranorex Adapters please have a look at following chapter of our user guide:
Ranorex UI Adapter
The easiest way to fill a csv file with values over several iterations is to append line by line to the csv file.robert_butler wrote:If I am going to loop through many iterations (test cases) and want to spit out the data values for each test case to the same csv file, is there a way to store these values until the end, then write them all to the csv file?
As shown in the link provided before.
Regards,
Tobias
Ranorex Team
-
- Posts: 24
- Joined: Tue Apr 03, 2012 3:05 pm
Re: Flash/Flex documentation/code samples
Thanks, I used the following to create the csv file (this link was within your link above):
http://www.blackbeltcoder.com/Articles/ ... files-in-c
I did end up appending, but had to add the following to the code in the article above:
public CsvFileWriter(string filename, bool append)
: base(filename, append)
{
}
My next question is, how do I skip steps (modules or test cases) based on an input variable?
http://www.blackbeltcoder.com/Articles/ ... files-in-c
I did end up appending, but had to add the following to the code in the article above:
public CsvFileWriter(string filename, bool append)
: base(filename, append)
{
}
My next question is, how do I skip steps (modules or test cases) based on an input variable?
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Flash/Flex documentation/code samples
Hi,
you can start several modules from user code.
Doing so, you can conditional start modules based on variables.
The code might look something like following code snippet:
Using Variables with Code Modules
Regards,
Tobias
Ranorex Team
you can start several modules from user code.
Doing so, you can conditional start modules based on variables.
The code might look something like following code snippet:
if (myVar.Equals("True")) { Recording1.Start(); } else { Recording1.Start(); }To learn ho to add a variable to user code please have a lok at following chapter of our user guide:
Using Variables with Code Modules
Regards,
Tobias
Ranorex Team
-
- Posts: 24
- Joined: Tue Apr 03, 2012 3:05 pm
Re: Flash/Flex documentation/code samples
This not working as I expected. Let's assume I have 3 recordings. I add a code module with variable and code below:
if (myVar.Equals("True"))
{
Recording1.Start();
}
else
{
Recording2.Start();
}
I would expect if myVar equals "True" it would go to Recording1 then Recording2, etc. It is not. It performs Recording1 twice.
Then, if myVar does not equal "True" it does go to Recording2, but then it goes back to Recording1. I want to go to Recording2 then Recording3, etc.
Thanks for your help
if (myVar.Equals("True"))
{
Recording1.Start();
}
else
{
Recording2.Start();
}
I would expect if myVar equals "True" it would go to Recording1 then Recording2, etc. It is not. It performs Recording1 twice.
Then, if myVar does not equal "True" it does go to Recording2, but then it goes back to Recording1. I want to go to Recording2 then Recording3, etc.
Thanks for your help
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Flash/Flex documentation/code samples
Hi,
what does your test suite look like?
Do the recording modules also occur in your test suite and are the checked to be executed?
Please make suer, that the recording modules will not be executed by the test suite but only by the code module.
Regards,
Tobias
Ranorex Team
what does your test suite look like?
Do the recording modules also occur in your test suite and are the checked to be executed?
Please make suer, that the recording modules will not be executed by the test suite but only by the code module.
Regards,
Tobias
Ranorex Team
-
- Posts: 24
- Joined: Tue Apr 03, 2012 3:05 pm
Re: Flash/Flex documentation/code samples
ok, so group the "conditional" recordings into test case(s) then uncheck the test case and handle by the user code?
i will try that, thanks
i will try that, thanks
-
- Posts: 24
- Joined: Tue Apr 03, 2012 3:05 pm
Re: Flash/Flex documentation/code samples
so I added a new test case under my existing test case, added the conditional module to that new test case, and unchecked it. however, now the bound variable is no longer working, it is using the default value. it says it is bound.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Flash/Flex documentation/code samples
Hi,
No, what i meant is, that the recordings do not occur in your Test Suite.
The should be started from your code module.
Regards,
Tobias
Ranorex Team
No, what i meant is, that the recordings do not occur in your Test Suite.
The should be started from your code module.
Regards,
Tobias
Ranorex Team
-
- Posts: 24
- Joined: Tue Apr 03, 2012 3:05 pm
Re: Flash/Flex documentation/code samples
Ok, so if I remove the recording module executed by user code from the test suite, how do I let that recording module use a data variable from data source used in test suite? Can I change recording module to take a parameter?