- senthilm.aynaraActive particpant
- Posts : 19
Join date : 2009-09-15
not working when i click span without anchor tag in selenium RC
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
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
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>
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
Re: not working when i click span without anchor tag in selenium
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
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.aynaraActive particpant
- Posts : 19
Join date : 2009-09-15
Re: not working when i click span without anchor tag in selenium
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
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
Re: not working when i click span without anchor tag in selenium
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
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.aynaraActive particpant
- Posts : 19
Join date : 2009-09-15
Re: not working when i click span without anchor tag in selenium
Fri Sep 18, 2009 12:48 pm
FYI, List means not drop down. it is Unordered list (
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
- 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
Re: not working when i click span without anchor tag in selenium
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
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
Permissions in this forum:
You cannot reply to topics in this forum