Hello Everyone,
I have a repository that has a dynamic value. I need to take the output from one of the steps that has the following code :
repo.ShellForm.Shell4.Code.PressKeys("Code"+System.DateTime.Now.ToString("MMddyyyy"));
O/P = CodeMMddyyyy,
This would create a new item in the list.
The next step I use should be selecting the repository item that would have a value "CodeMMddyyyy".
How can I code and create a repository Item that would be used for this step.
Thank you
Mona
User code created Repository item
Re: User code created Repository item
I would suggest a repository variable that you set right before you use the repo item.
If you post your XPath from the repo item you are using we can probably show you exactly what to change.
If you post your XPath from the repo item you are using we can probably show you exactly what to change.
Shortcuts usually aren't...
Re: User code created Repository item
Thank you for the reply.
The xpath that I use is:
/form[@controltypename='ShellForm']//tabpage[@title='Reporting Configuration' and @controltypename='TabPage']/?/?/container[@controltypename='SplitContainer']/container[2]/element/container[1]/tabpagelist/tabpage[1]/?/?/table[@controltypename='ReadOnlyDataGridView']/row[@accessiblename='Row 50']/cell[@text> 'Code']
The xpath that I use is:
/form[@controltypename='ShellForm']//tabpage[@title='Reporting Configuration' and @controltypename='TabPage']/?/?/container[@controltypename='SplitContainer']/container[2]/element/container[1]/tabpagelist/tabpage[1]/?/?/table[@controltypename='ReadOnlyDataGridView']/row[@accessiblename='Row 50']/cell[@text> 'Code']
Re: User code created Repository item
I would add a variable like so, to the xpath in the repo:
This will add a repository variable that will automatically be added to any recording module that you use this repo object in. It will be called "codeValue" in the recording module. (Always preface variables with '$' in XPath.)
Then, in your usercode do this:
Now you just need to add the mouse-click action to the repo element either in the usercode or in the action table after the call to this above code.
Code: Select all
/form[@controltypename='ShellForm']//tabpage[@title='Reporting Configuration' and @controltypename='TabPage']/?/?/container[@controltypename='SplitContainer']/container[2]/element/container[1]/tabpagelist/tabpage[1]/?/?/table[@controltypename='ReadOnlyDataGridView']/row[@accessiblename='Row 50']/cell[@text=$codeValue]
Then, in your usercode do this:
Code: Select all
codeValue = "Code"+System.DateTime.Now.ToString("MMddyyyy");
repo.ShellForm.Shell4.Code.PressKeys(codeValue);
Shortcuts usually aren't...
Re: User code created Repository item
Thank you so much!!
That helped.
That helped.