SWTBot Recorder is not absolute [message #1660726] |
Mon, 09 March 2015 06:03  |
Eclipse User |
|
|
|
I am trying SWTBot in our own application. I am trying to use SWTBot Recorder to create my test cases first. But I am facing few issues.
I have two questions. Please check on the comments I mentioned in each one below.
1. I have a table view. It contains data which I imported from a csv file. The following is the code which SWTBot gave me.
bot.menu("File").menu("New...").click();
bot.tree().getTreeItem("AppName").select();
bot.tree().getTreeItem("AppName ").select();
bot.textWithLabel("IP Version:").setText("Sample");
bot.text(1).setText("App");
bot.text(2).setText("1");
bot.textWithLabel("*").setText("Hello");
bot.button("Finish").click();
bot.tree().getTreeItem("Sample").expand();
bot.tree().getTreeItem("Sample").getNode("App(1)").expand();
bot.tree().getTreeItem("Sample").getNode("App(1)").getNode("Hello").select();
bot.contextMenu("Open Application Metadata File").click();
// I choose the location of my .csv file which is also not recorded in this.
bot.text().setText("3.35"); //Edited data from the table No mention of which row and which column.
bot.text().setText("3.3");
bot.text().setText("Synthesiss");
Is there a way to mention which row and which column of the table I am dealing with now?
2. I have a SashForm with two Composite. Each Composite contain a grid of almost the same data and same button names. When I try to run SWTBot Recorder and try to click on the Grids, it is not saying which Grid which I am dealing with now. The following is the code which produced.
bot.menu("AppName").menu("Open Config").click();
bot.button("Load").click(); //clicked from Composite 1
bot.button("Load").click(); //clicked from Composite 2
bot.tree().getTreeItem("").select(); //clicked from Grid of Composite 1 Text not detected
bot.tree().getTreeItem("").select();//clicked from Grid of Composite 1 Text not detected
bot.menu("QConnect+").menu("Close Config").click();
Is it possible with SWTBot to find which Composite I am dealing with?
This SashForm exist inside a tab, just like "Package Explorer", for example. How does SWTBot identify which tab is it now dealing with.
Are the Test produced by SWTBot absolute?
Please let me know if there are any solution for these and where can I find it.
|
|
|
Re: SWTBot Recorder is not absolute [message #1690274 is a reply to message #1660726] |
Thu, 26 March 2015 05:46   |
Eclipse User |
|
|
|
I got a reply for this via email, which I sent to swtbot dev team. From mistria@______.com
Hi,
// I choose the location of my .csv file which is also not recorded in this.
Is there a way to mention which row and which column of the table I am dealing with now?
The recorder doesn't have rules to deal correctly with tables yet. Please open a bug to request it, with the expected output in that case, and consider contributing the necessary rule. (see http :// git.eclipse.org/c/swtbot/org.eclipse.swtbot.git/tree/org.eclipse.swtbot.generator/src/org/eclipse/swtbot/generator/framework/rules/simple/ExpandTreeItemRule.java as an example): https :// wiki.eclipse.org/SWTBot/Contributing
2. I have a SashForm with two Composite. Each Composite contain a grid of almost the same data and same button names. When I try to run SWTBot Recorder and try to click on the Grids, it is not saying which Grid which I am dealing with now. The following is the code which produced.
Is it possible with SWTBot to find which Composite I am dealing with?
This SashForm exist inside a tab, just like "Package Explorer", for example. How does SWTBot identify which tab is it now dealing with.
It may also be a limitation or a missing rule. What code would you expect the generator to create (relying on existing SWTBot API) ?
Are the Test produced by SWTBot absolute?
The state of your application when you start recording may affect the code generated. For example, initial selection and active views can make the recorder skip the rules about selection and activation. So those tests are not absolute but more relative to the state of your application when starting to record.
HTH
--
Mickael Istria
Eclipse developer at JBoss, by Red Hat
[Updated on: Thu, 26 March 2015 11:56] by Moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: SWTBot Recorder is not absolute [message #1780070 is a reply to message #1776771] |
Wed, 17 January 2018 01:00  |
Eclipse User |
|
|
|
Hi all,
This is to inform that latest snapshot SWTBot now supports following additional rules and fixes for some of the existing rules-
1. New rules for TableItem's Selection (single/multi), Check and Double-click
2. New rule for TreeItem's Check
3. New rule for CCombo setText
4. Fix for CCombo Selection
5. Fix for TreeItem Double-click
|
|
|
Powered by
FUDForum. Page generated in 0.12628 seconds