use Descriptive programming..
lets say if 'Priyanka' would be the web element..
----------
Set objName = Description.Create()
objName("innertext").value = "Priyanka"
' Add if you want some more
Browser().Page().WebElement(objName).Click
---------
hope it helps.. may be the logic
Kind Regards,
Boobhathi Raj
On Mon, Nov 2, 2009 at 3:14 PM, Priyanka <[email protected]> wrote:
>
> Hi Sridhar,
>
> Thanks for the reply!!
>
> Yes you’re right, I want to select the last row from the table. Let
> me try to explain more in detail:
>
> Condition:1 - I’ve asked QTP to generate “”Priyanka” as a new customer
> every time I run the script
>
> Condition:2 – Now, because there are couple of people working in the
> same module. Hence, whenever I’ll open my application and run the
> script to generate new customer “Priyanka”, it would not be added in
> the same row count everytime. It may be sometimes on 10th row and
> other time on 16th row.
>
> Condition:3 –I want QTP to click on “Priyanka” everytime and edit the
> same customer everytime.
>
> Solutions: There are 2 solution with best of my knowledge to handle
> this:
>
> 1. I ask QTP to search, select and click the value “Priyanka” – I do
> not know how is it possible?
> 2. I go by row count, as you mentioned – But I’m not able to run this.
> Getting the error “Input string was not in a correct format”.
> Wondering where in the script have we mentioned to click always on the
> last row.
>
> Hope my above points will provide you more details. It will be really
> great if you can put some more lights on it.
>
> Many Thanks in advance
>
> Priyanka
>
>
> On Nov 1, 3:19 am, b sridhar <[email protected]> wrote:
> > Hi Priyanka,
> >
> > As per my understanding you want to select the last row from a table.
> >
> > Here i am giving the code segment.If it works try this
> >
> > intRowCount=SwfWindow(““).SwfWindow(““).SwfTable(““).RowCount
> > intCounter=1
> >
> > For intCounter=1 To intRowCount
> > If intCounter=intRowCount
> > SwfWindow(““).SwfWindow(““).SwfTable(““).SelectRow
> > "intCounter----This is the last row number
> > Exit For
> > End If
> > Next
> >
> > Let me know ,If you want any further clarification.
> >
> > Thanks
> > Sridhar
> >
> > On 10/30/09, Priyanka <[email protected]> wrote:
> >
> >
> >
> > > I'm using QTP on window based application with.NET properties.
> >
> > > In my application whenever I add a "New customer name" it gets added
> > > at the end of the row.
> >
> > > Recording Mode: While recording I've generated the script to "Create
> > > new customer" and edit the same but QTP recording the whole script by
> > > row number.
> > > Below is the script for better understanding
> >
> > > SwfWindow("").SwfWindow("").SwfTable("").SelectRow "0"
> > > SwfWindow(““).SwfWindow(““).SwfTable(““).ExpandRow "0"
> > > SwfWindow(““).SwfWindow(““).SwfTable(““).ActivateRow "0;18"
> > > SwfWindow(““).SwfWindow(““).SwfTable(““).SelectRow "0;18"
> > > SwfWindow(““).SwfWindow(““).SwfTable(““).ExpandRow "0;18"
> > > SwfWindow(““).SwfWindow(““).SwfTable(““).ActivateRow "0;18;5"
> > > SwfWindow(““).SwfWindow(““).SwfTable(““).SelectRow "0;18;5"
> >
> > > Requirement for run mode:
> >
> > > I've set the data parameter to auto generate the new customer for each
> > > iteration. But my problem here is that after creating a new customer
> > > from data, QTP is always clicking on the same recorded row. Whereas I
> > > want QTP to click always on the last name of the row.
> >
> > > Can anyone help me to understand how can I set my script to click on
> > > the last value of the row. Few people have suggested me before to use
> > > regular expression but my requirement here is that QTP should not only
> > > recognized but it should also click and edit the last value in the
> > > row.
> >
> > > Please do not hesitate to ask again, if I am not very clear in my
> > > question .
> >
> > > Many thanks.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
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/MercuryQTP?hl=en
-~----------~----~----~----~------~----~------~--~---