Object Identifiers within a Table Structure

46 views
Skip to first unread message

AutoEngr

unread,
May 26, 2017, 10:43:51 AM5/26/17
to Selenium Users
Hello Everyone,
While building a script, I'm trying to click onto a button that is identified within a table structure. I'm currently using Selenium IDE to build my script. In "ButtonIssue - WebpageView" image, you'll see the row I'm talking about. The highlighted title is what I'm trying to "delete". I also highlighted the "Delete" button that I'm trying to capture. In "ButtonIssue - TableView" image, you'll see how I tried to capture it with the "click" command, however, it ONLY identifies the "row" I clicked. In the "ButtonIssue - SourceView" image, you'll see how it's being captured. The ISSUE is... The title of what I want to delete from the table can be located in "any" row.. However, the "click" only does the specific "location" the script captured which might not be aligned to the right "title" of what I want to delete. Is there a command I can use to select the "delete button" WITH the title I want to delete?? This has been an issue with trying to finalize this script. Please help if you can.
Thank you - AutoEngr
ButtonIssue - WebpageView.JPG
ButtonIssue - TableView.JPG
ButtonIssue - SourceCodeImage.JPG

AutoEngr

unread,
May 26, 2017, 10:47:14 AM5/26/17
to Selenium Users
Also.. If you could, please make your answer as "dummy-proof" as possible.. I'm not a developer - Much appreciated  :)

thi...@thoughtworks.com

unread,
May 26, 2017, 12:19:09 PM5/26/17
to Selenium Users
Hi,

You mean to say you need to dynamically identify and click on 'delete' button of a record with text 'testDraftAndByLine'? If this is what you need,you can do it by entering something like this "
//table[@id=‘DataTables_Tables_table_0’]/tbody/tr[text()='testDraftAndByLine’]/button[3]" in target.
What this does is it will go into table and select text with name which you have specified and then goes to its corresponding button[3] whihc is delete ...
Hope this resolves.

AutoEngr

unread,
May 26, 2017, 1:39:05 PM5/26/17
to Selenium Users
When I tried with with a different item "MLByLineTest", I received this error "[error] Invalid xpath [2]: //table[@id=‘DataTables_Tables_table_0’]/tbody/tr[text()='MLByLineTest’]/button[3]". Any other suggestions?
Thank you,
AutoEngr

AutoEngr

unread,
May 26, 2017, 3:01:40 PM5/26/17
to Selenium Users
Thanks again for your suggestion.. When I tried it, I received this error "[error] Element //table/tbody/tr[text()='MLByLineTest']/button[3] not found".... I even tried this "//table[@id=‘DataTables_Tables_table_0’]/tbody/tr[text()='MLByLineTest']/button[3]" thinking it needed this part "[@id='DataTables_Table_0']", but got the same error message.. Ugh... Any other suggestion?
As always.. Thanks for your help!
AutoEngr-


On Friday, May 26, 2017 at 12:19:09 PM UTC-4, thi...@thoughtworks.com wrote:

AutoEngr

unread,
May 26, 2017, 3:12:05 PM5/26/17
to Selenium Users
I've attached another image to show the details within "InspectElement".. It might help?
Thanks,
AutoEngr-

On Friday, May 26, 2017 at 12:19:09 PM UTC-4, thi...@thoughtworks.com wrote:
ButtonIssue - InspectElement.JPG

thi...@thoughtworks.com

unread,
May 29, 2017, 1:38:21 AM5/29/17
to Selenium Users
By lloking at the screenshot if i understand correct, the data-name attribute of delete object is always going to be your text name,then use "//button[@tilte='Delete Letter']&&[@data-name='MLByLineTest']/i"


On Friday, May 26, 2017 at 8:13:51 PM UTC+5:30, AutoEngr wrote:

Monika Singhal

unread,
May 29, 2017, 1:57:20 AM5/29/17
to Selenium Users
Hi,

The xpath mentioned above will definitely work. If you want to follow the same pattern which you were following earlier then you can use the xpath mentioned below:

 //table/tbody/tr[normalize-space()='MLByLineTest']/td/button[3] or  //table/tbody/tr[normalize-space()='MLByLineTest']//button[3] 

Thanks & Regards,
Monika

AutoEngr

unread,
May 30, 2017, 8:23:42 AM5/30/17
to Selenium Users
Hi Monika.. Thank you for your suggestions.. When I tried both, this is the error results I get.. This is a tricky/challenging one.. Any other suggestions??? Please look at the image below..
Thank you,
AutoEngr
DeleteButtonIssue.JPG

AutoEngr

unread,
May 30, 2017, 8:54:24 AM5/30/17
to Selenium Users
Hello Everyone.. Is there a way just to capture the "Delete" button within the same "row" as the title, and not worry if the title is correct? Is there a way just to capture the object within the same "row" without using the "title"?
Thanks,
AutoEngr-


On Friday, May 26, 2017 at 10:43:51 AM UTC-4, AutoEngr wrote:

AutoEngr

unread,
May 30, 2017, 9:14:24 AM5/30/17
to Selenium Users
Here's another image that could be helpful??


On Friday, May 26, 2017 at 10:43:51 AM UTC-4, AutoEngr wrote:
DeleteButtonInspectElement.JPG

Thivya Lakshimi Easwarasekaran

unread,
May 30, 2017, 11:03:53 AM5/30/17
to seleniu...@googlegroups.com
try this "//button[@tilte='Delete Letter'][@data-name='MLByLineTest']/i"

Thivyalakshimi Easwarasekaran
Quality Analyst
Emailthi...@thoughtworks.com
Telephone+91 9789805026
ThoughtWorks

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/SpKiVV9ZRoU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/00444c91-2507-485b-9c6e-8daed2c8d2fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

AutoEngr

unread,
May 30, 2017, 11:13:23 AM5/30/17
to Selenium Users
Thanks again for your suggestion.. Here's an image to show what the results are... I'm not giving up.. are you?? lol
Thanks,
AutoEngr-


On Friday, May 26, 2017 at 10:43:51 AM UTC-4, AutoEngr wrote:
DeleteButtonIssue4.JPG

Thivya Lakshimi Easwarasekaran

unread,
May 30, 2017, 11:37:18 AM5/30/17
to seleniu...@googlegroups.com
Well interesting!...can you show the dom doc for the entire row with sub components expanded?

--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/SpKiVV9ZRoU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages