Share
Go down
seli
Posts : 7
Join date : 2012-05-11

How to get selected an item from table by using select command of IDE

on Fri May 11, 2012 2:47 pm
Hi all,
I have to select an item from table by using select(selectLocator, optionLocator).......... of Selenium IDE.
I have no id for selectLocator, so I can not specify selectLocator, please help me.
I am stuck on this issue since a few days.
avatar
rohit13
Master
Master
Posts : 180
Join date : 2012-03-29
Age : 31
Location : INDIA
http://radical-qa.blogspot.in/

Re: How to get selected an item from table by using select command of IDE

on Fri May 11, 2012 3:36 pm
can you please share HTML of particular area.????So it will help us to solve your problem..

_________________
Radical QA
http://radical-qa.blogspot.in/
seli
Posts : 7
Join date : 2012-05-11

Re: How to get selected an item from table by using select command of IDE

on Fri May 11, 2012 4:27 pm
O.K.
Let us imagine we typed "junit" in google. I want selenium select first match i.e. first row of box with suggestions.
I give you this explanation only without any HTML of particular area, because I am a new member do not allow me to send it. It give me the following message:
"New members are not allowed to
post external links or emails for 7 days.
"
anbarasi
Amateur
Amateur
Posts : 49
Join date : 2012-04-30
Age : 30
Location : chennai

Re: How to get selected an item from table by using select command of IDE

on Mon May 14, 2012 4:27 pm
hi .. i faced a problem in my application like if i enter a text it should show th e matching customers in drop down that was using jquery so i tried with focus and type key command on that and it worked , im not sure that my reply may help u
vikas.gandhi
Posts : 5
Join date : 2012-03-20

Re: How to get selected an item from table by using select command of IDE

on Mon May 14, 2012 4:32 pm
Hi Seli,

I will be good if you can share HTML of particular area. It would help to solve you actual problem.

For your above mentioned google problem. You can solve it like this -

selenium.type("lst-ib", "junit");
selenium.wait(3000);

selenium.click("xpath=/html/body/table/tbody/tr/td[2]/table/tbody/tr[1]/td/div/table/tbody/tr/td");

It will select first row.

Thanks,

Vikas Gandhi
seli
Posts : 7
Join date : 2012-05-11

Re: How to get selected an item from table by using select command of IDE

on Tue May 29, 2012 6:31 pm
vikas.gandhi wrote:Hi Seli,

I will be good if you can share HTML of particular area. It would help to solve you actual problem.

For your above mentioned google problem. You can solve it like this -

selenium.type("lst-ib", "junit");
selenium.wait(3000);

selenium.click("xpath=/html/body/table/tbody/tr/td[2]/table/tbody/tr[1]/td/div/table/tbody/tr/td");

It will select first row.

Thanks,

Vikas Gandhi


Hi,
sorry for may delay.
It is a part form the HTML:

Code:


[table style="width: 100%;" class="gssb_m" cellpadding="0" cellspacing="0"][tr class=""][td class="gssb_a gbqfsf" dir="ltr" style="text-align: left;"]
[table style="width: 100%;" cellpadding="0" cellspacing="0"][tr][td style="width: 100%;"]
            [color=red]junit[/color]
        [/td][td]

[url=http://seleniumforum.forumotion.net/#ifl]Чувствам се късметлия »
[/url]
[/td][/tr][/table]
[/td][/tr][tr class=""][td class="gssb_a gbqfsf" dir="ltr" style="text-align: left;"]






[table style="width: 100%;" cellpadding="0" cellspacing="0"][tr][td style="width: 100%;"]junit[b] tutorial
[/b]

[/td][td]
[url=http://seleniumforum.forumotion.net/#ifl]Чувствам се късметлия »
[/url]
[/td][/tr][/table]
[/td][/tr][tr class=""][td class="gssb_a gbqfsf" dir="ltr" style="text-align: left;"]


[table style="width: 100%;" cellpadding="0" cellspacing="0"][tr][td style="width: 100%;"]
junit[b] test[/b]
[/td][td][url=http://seleniumforum.forumotion.net/#ifl]Чувствам се късметлия »[/url][/td][/tr][/table][/td][/tr][tr class=""][td class="gssb_a gbqfsf" dir="ltr" style="text-align: left;"]



[table style="width: 100%;" cellpadding="0" cellspacing="0"][tr][td style="width: 100%;"]junit[b] eclipse[/b][/td][td]
[url=http://seleniumforum.forumotion.net/#ifl]Чувствам се късметлия »[/url][/td][/tr][/table][/td][/tr][/table]




Excuse me for bed formatting. I want to select the first occurrence of word "JUnit"
jhonykishore
Posts : 1
Join date : 2012-09-12

Re: How to get selected an item from table by using select command of IDE

on Wed Sep 12, 2012 12:35 am
Hi Guys,

I'm very new to Selenium. I got a quick question.

I'm trying to get the text from a cell of a table using the getTable method. But i don't know how to find the name of the Table?
I know the coordinates of the cell (0_2) but how do i find out the name of the table to use this method.

Here's the Automation ID of the Entire table:
chain=automationName:WDataGrid_6$1573_6$16776/automationName:WDataGrid_WDataGrid_6$1573_6$16776

This is the Syntax of the getTable method:
getTable

public java.lang.String getTable(java.lang.String tableCellAddress)
Description copied from interface: Selenium
Gets the text from a cell of a table. The cellAddress syntax tableLocator.row.column, where row and column start at 0.
Specified by:
getTable in interface Selenium
Parameters:
tableCellAddress - a cell address, e.g. "foo.1.4"
Returns:
the text from the specified cell

please help.

Thank you
Sponsored content

Re: How to get selected an item from table by using select command of IDE

Back to top
Permissions in this forum:
You cannot reply to topics in this forum