Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Click object
#1
Not Solved
I am going through a collection of objects until I find the one I want. Each has a button that I can click to view the object. But for some reason, when I get to my object and say click the button. It is not clicking the button on the row of my object it is clicking the first one.

What can a do to make it click mine? I even get the abs_x and abs_y and it doesn't click it. Is there something I can do like simply Click xcoord,ycoord without doing Browser().Page().WebElement().Click xcoord,ycord because this is not working.

Thanks - Charles
Reply
#2
Not Solved
Hi Charls,
Use a counter variable and while going through your collection of objects increment it with 1 for every object till you reach your desired object. Now use the value stored in the counter variable as the index of the button.
Hope this helps.
Reply
#3
Not Solved
I have stored the value of the row as 'currentrow'. Can I just say
Code:
For  i = 0 To CurrentRow
    If ElementsCollected(i) = CurrentRow

Is this how I would do that?
Reply
#4
Not Solved
If the currentrow has the rowno of your object, then just create an object for button, give its index property the value <currentrow>.
Reply
#5
Not Solved
Okay - I figured it out. Thank you so much. I actually just did this :

Code:
If  ElementsCollected(CurrentRow).GetROProperty("innerhtml") = Del Then
                                   ElementsCollected(CurrentRow).Click

If the button here on this row is Delete - Click it.
Now on to the second issue. The Column on the page that holds all of the Delete buttons sometimes includes a blank instead of Delete. So, If my record is the 5th one and there is a blank on the 4th record. So X,X,X, ,X,X. It collects the Deletes, and says I see 5. The Row I want to Delete is 5, but since it is blank, it will go to the 5th 'X' which is really the 6th row.

Is there a way I can set up two object descriptions :

Like this:
Code:
Set oDesc = Description.Create()
                  oDesc("micclass").Value = "WebElement"
                  oDesc("class").Value = "x-grid3-cell-inner x-grid3-col-5"
                  oDesc("innerhtml").Value = "[<SPAN].*"

                'Set nDesc =Description.Create()
                 ' nDesc("micclass").Value = "WebElement"
               '   nDesc("class").Value = "x-grid3-cell-inner x-grid3-col-5"
                 ' nDesc("outerhtml").Value = "[<DIV].*"


And then set the total elements collected to include both? Like grab all Delete buttons and all Blanks. In this way, it will stop at the 5th row, try to Delete it and realize it can't and skip out with a message instead of deleting the wrong record.

So something like this - would it work:
Code:
Set ElementsCollected = Browser("Suppliers and Invoices").Page("Suppliers and Invoices").WebTable("Supplier Payments").ChildObjects(oDesc,nDesc)


How do I get both in the same collection?

Thanks - Charles
Reply
#6
Not Solved
Try
PHP Code:
If ElementsCollected(CurrentRow).GetROProperty("innerhtml") = "Delete" Then
   ElementsCollected
(CurrentRow).Click
ElseIf ElementsCollected(CurrentRow).GetROProperty("innerhtml") = "" Then
   ElementsCollected
(CurrentRow).Click
End 
If 
Reply
#7
Not Solved
Thank you sir. That works perfectly but rather than look for blanks and Delete, I created an object that counted all rows in that column.
Reply
#8
Not Solved
Urgent help needed.

Can I click on an object, just by positioning the cursor on top of it ?

The issue is that I'm trying this on an application which has a drop down menu, which cannot be accessed by a keyboard
Reply
#9
Not Solved
Hello,

Please try the below code:

Code:
Browser().Page().Weblist().FireEvent "onmouseover"

If it doesnt solve ur problem then please elaborate ur problem.

Regards,
Parminder
Reply
#10
Not Solved
I'm not working on a web page, but a local application.
and the issue is that I cannot identify or grab the object, or access it by keyboard. it only responds to a mouse over and click.

So I don't think FireEvent will work.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Exclamation UFT doesn't recognize object in SAP at first, but recognize it after i click debug CedricMab 3 6,778 02-06-2017, 07:09 PM
Last Post: nguyen4685
  Click on Object rajeshdizzy 0 2,028 07-10-2009, 03:10 PM
Last Post: rajeshdizzy

Forum Jump:


Users browsing this thread: 1 Guest(s)