Jump to content

How to Click on IE Button? If Button have No tiitle and Same Id.


Recommended Posts

I want to click on IE Button using Index number, Because it have same id, and i am not able to click on using text becuase text is change every time.

My Source code is :

<table class="table table-hover table-bordered">

<tr title="" id="btnselect" onclick="functionSubmit(Random,1,'Random','Random','Random');" data-original-title="Please Select One" data-toggle="tooltip" data-placement="bottom">

<tr title="" id="btnselect" onclick="functionSubmit(Random,2,'Random','Random','Random');" data-original-title="Please Select One" data-toggle="tooltip" data-placement="bottom">

<tr title="" id="btnselect" onclick="functionSubmit(Random,3,'Random','Random','Random');" data-original-title="Please Select One" data-toggle="tooltip" data-placement="bottom">

<tr title="" id="btnselect" onclick="functionSubmit(Random,4,'Random','Random','Random');" data-original-title="Please Select One" data-toggle="tooltip" data-placement="bottom">

I want to click on third 'btnselect'.

Link to comment
Share on other sites

  • 2 weeks later...
On 5/6/2018 at 7:54 PM, rootx said:

One way .... use _IETagnameGetCollection with tr tag, than put a counter inside a loop for next, and read the exact values, in your array is $btnselect [2].
 

@rootx How can i use this? Please post example

Link to comment
Share on other sites

How can i click on third button if button have same id?

 

<table class="table table-hover table">

<tr title="" id="btnselection" onclick="functionSubmit(Random,1,'Random','Random','Random')

<tr title="" id="btnselection" onclick="functionSubmit(Random,2,'Random','Random','Random')

<tr title="" id="btnselection" onclick="functionSubmit(Random,3,'Random','Random','Random') ;i want to click on this button

<tr title="" id="btnselection" onclick="functionSubmit(Random,4,'Random','Random','Random')
Link to comment
Share on other sites

Technically they shouldn't have the same ID, but that's fine. How do you know which one to click on while looking at the page?  if you're really just going based on index, you can use IETagNameGetCollection() to return a collection of elements with that tag and then step through them until you find the one you're looking for.

Link to comment
Share on other sites

6 hours ago, seandisanti said:

Technically they shouldn't have the same ID, but that's fine. How do you know which one to click on while looking at the page?  if you're really just going based on index, you can use IETagNameGetCollection() to return a collection of elements with that tag and then step through them until you find the one you're looking for.

@seandisanti

i want to click on third row of my table

Link to comment
Share on other sites

@iamtech You have been referred to _IETagNameGetCollection multiple times, yet you haven't shown any effort on your part to solve the problem. You can't expect us to write your code for you. Please make an effort to solve this on your own. There are plenty of examples of using _IETagNameGetCollection (both in the help file and on this forum).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...