Share
View previous topicGo downView next topic
senthilm.aynara
Active particpant
Active particpant
Posts : 19
Join date : 2009-09-15

not working when i click span without anchor tag in selenium RC

on Thu Sep 17, 2009 5:59 pm
Hi all,
I am new to selenium. i want to automate my application. Here i have the following code

Code:

<ul>
<li id="720435377112" class="ag">
<span class="mb" title="Check" style="background-image: url(http://my_server//jpeg/SS);">
<img title="image" src="http://my_server//jpeg/SS" style="width: 30px; height: auto; visibility: visible;"/>
</span></li>
<li>......
</ul>
Here when i click image it goes to new screen with new layout. but not a new page using css. Here there is no anchor tag.
when record through selenium IDE i got script as like
selenium.click("//li[@id='720435377112']/span");
and i tried to execute in selenium RC - java client. it doesn't give any error. but click event is not performed in that image.
How can i solve this.

Thanks & Regards,
senthilm
avatar
Advisor
------------------------
------------------------
Posts : 383
Join date : 2009-07-30
Location : India
http://seleniumforum.forumotion.net

Re: not working when i click span without anchor tag in selenium

on Thu Sep 17, 2009 6:54 pm
hi,

Is this a list in which you are clicking? If yes, then try to use different command related to list.

if not, The id you are using is dynamic. try to use xpath generated from xpath or dom locator.

Lets try this and let me know will it work or not

bye
senthilm.aynara
Active particpant
Active particpant
Posts : 19
Join date : 2009-09-15

Re: not working when i click span without anchor tag in selenium

on Fri Sep 18, 2009 11:30 am
Thank u for the reply. Yes it is span inside list. can u tell me different command related to list.
i tried in different ways..
http://selenium.click("//*[@id='720435377112']");
http://selenium.click("//ul[@id='idoflist']/li[1]/span[1]");
http://selenium.click("//li[@id='720435377112']/span");
selenium.fireEvent("//*[@id='720435377112']","click");
But not working.

Is it not correct?

Regards,
senthilm
avatar
Advisor
------------------------
------------------------
Posts : 383
Join date : 2009-07-30
Location : India
http://seleniumforum.forumotion.net

Re: not working when i click span without anchor tag in selenium

on Fri Sep 18, 2009 12:14 pm
hi,

Try this command for list selection:

|select | Locator | label=File# | // for IDE
selenium.select(lable=File#); // in rc.

Following are the commands for list define in selenium references Are:

storeSomethingSelected(selectLocator,variableName)
Determines whether some option in a drop-down menu is selected.

storeSelectOptions(selectLocator,variableName)

Gets all option labels in the specified select drop-down.


storeSelectedValues(selectLocator,variableName)
Gets all option values (value attributes) for selected options in the specified select or multi-select element.

storeSelectedLabels(selectLocator,variableName)
Gets all option labels (visible text) for selected options in the specified select or multi-select element.

storeSelectedIndexes(selectLocator,variableName)
Gets all option indexes (option number, starting at 0) for selected options in the specified select or multi-select element.


For all commands check out this link:
http://release.seleniumhq.org/selenium-core/0.8.0/reference.html

best of luck.

bye
senthilm.aynara
Active particpant
Active particpant
Posts : 19
Join date : 2009-09-15

Re: not working when i click span without anchor tag in selenium

on Fri Sep 18, 2009 12:48 pm
FYI, List means not drop down. it is Unordered list (
Code:
<ul><li>--</li> </ul>
)

and in ur reply
selenium.select(lable=File#); // in rc.
here what is lable=File# in my case. I couldn't understand this.

Thanks
senthilm


Last edited by senthilm.aynara on Fri Sep 18, 2009 12:49 pm; edited 1 time in total (Reason for editing : for typing code)
avatar
Advisor
------------------------
------------------------
Posts : 383
Join date : 2009-07-30
Location : India
http://seleniumforum.forumotion.net

Re: not working when i click span without anchor tag in selenium

on Fri Sep 18, 2009 1:00 pm
hi,

whatever text option displaying which you are selected . If not text in coming, whatever value is coming in 'value ' option in IDE paced same as it's.

like: selenium.select("//[@id='720435377112']"); or
selenium.select("id='720435377112'");

Hope this will help you. best of luck.

Bye
Sponsored content

Re: not working when i click span without anchor tag in selenium

View previous topicBack to topView next topic
Permissions in this forum:
You cannot reply to topics in this forum