Share
Go down
bull
Active particpant
Active particpant
Posts : 10
Join date : 2009-12-18

Identifying the element

on Fri Dec 18, 2009 9:41 pm
i am having difficulty recognizing elements, can you please tell me how i can use to click these elements

1)i have to hover on the Manage and click the try item,i am not getting a clue how i can do that
class="ricAppMenuHover"> Manage

this is the option in the drop down i have to click
try

2)this is all i have for a button,selenium is recoding this as
selenium.click("//button[@id='']");

but i want to use the value can any one tell me how i can do that
Log in
avatar
Advisor
------------------------
------------------------
Posts : 383
Join date : 2009-07-30
Location : India
http://seleniumforum.forumotion.net

Re: Identifying the element

on Mon Dec 21, 2009 2:00 pm
hi,

lets start with first point. You mentioned it's a drop down list. first you have to identify the locator either through selenium ide or xpather. then use this command:
selectAndWait|locator[@class='ricAppMenuHover']|label=Manage.

But if that is ajax control and can be done through mouse hover only, problem will solve. the mouse operations are very tricky in selenium.


2. For solving the button issue, try to use x-pather or firebug to get a locator of the button if not generated with IDE.

Hope this will help you. Best of luck.

Buy
bull
Active particpant
Active particpant
Posts : 10
Join date : 2009-12-18

it is an azax control

on Mon Dec 21, 2009 6:14 pm
Hi,
Thank you for the response
this is how it is ,it is an azax control.can you tell me how i can tell to click this link Private Empty Car Storage from the Drop down Menu item "Manage"

i tried this
selenium.mouseOver("locator[@class='ricAppMenuHover']|label=Manage.");
selenium.click("/ama/secure/manage/monthly");

but did not work,it is not identifying the Mange element
Manage

I tried detecting the button by the xpath but had no luck i got the xpath also by Id which changes as the wicket dynamically generates it every time.
this is the button i want to click

bull
Active particpant
Active particpant
Posts : 10
Join date : 2009-12-18

Re: Identifying the element

on Tue Dec 22, 2009 4:54 pm
the xpath is givng as
selenium.click("//*[@id='LOGINFORM']/div/div/div[2]/div/table/tbody/tr[3]/td[2]/span[1]/span/button")

but this i think is not advisible as if anything changes on the page the x path is broken.i am badly looking to use the value of the button
selenium.click("//button[@value=' Log in ']");
but i had no luck as it is not finding the element
avatar
Advisor
------------------------
------------------------
Posts : 383
Join date : 2009-07-30
Location : India
http://seleniumforum.forumotion.net

Re: Identifying the element

on Tue Dec 22, 2009 6:35 pm
hi,

You can identify the element on the basis of text also , if only that text will present on the page like

click| link=log in
click| name=log in
click| id=log in

You can also click on the basis of css. But it tricky to get path and difficult process than above one. But if you have an idea of css hierarchy, then you can do easily.

Hope this help you. best of luck.

Bye
bull
Active particpant
Active particpant
Posts : 10
Join date : 2009-12-18

Re: Identifying the element

on Tue Dec 22, 2009 6:46 pm
Hi,
thank you for your continuous support
you mean some thing like this
selenium.click("value=' Log in '");

com.thoughtworks.selenium.SeleniumException: ERROR: Unrecognised locator type: 'value'

all i know is the button that has the value as Log In,the button does not have a name.






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

Re: Identifying the element

on Tue Dec 22, 2009 8:12 pm
No, value is none property to identify the element like this. Install firebug add on in firefox. inspect element from firebug and see the property like id, name etc and provide that into it.

suppose you get id for that button is "sdsadsa_2323"

so use like click|id="sdsadsa_2323"

Use like this , then you are able to click on it.
bull
Active particpant
Active particpant
Posts : 10
Join date : 2009-12-18

Re: Identifying the element

on Tue Dec 22, 2009 8:24 pm
i already have firebug installed,the login does not have an id,the id is null.this is the element details

button id="" class=" ricButton2Convert ricButtonMedium ricButtonLoaded" type="submit" name="" title="" value=" Log in "> Log in
kmahata@gmail.com
Active particpant
Active particpant
Posts : 10
Join date : 2009-11-06

Re: Identifying the element

on Tue Dec 22, 2009 8:29 pm
Hi bull,

Is your first Question answered? if not try this:
selenium.mouseOver("locator[@class='ricAppMenuHover']|label=Manage.")
selenium.focus("/ama/secure/manage/monthly");
selenium.click("/ama/secure/manage/monthly");
bull
Active particpant
Active particpant
Posts : 10
Join date : 2009-12-18

Re: Identifying the element

on Tue Dec 22, 2009 8:48 pm
i am element not found,error

com.thoughtworks.selenium.SeleniumException: ERROR: Element locator[@class='ricAppMenuHover']|label=Manage not found
at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97)
at c
kmahata@gmail.com
Active particpant
Active particpant
Posts : 10
Join date : 2009-11-06

Re: Identifying the element

on Tue Dec 22, 2009 8:54 pm
Try css locator then :
css=.ricAppMenuHover
bull
Active particpant
Active particpant
Posts : 10
Join date : 2009-12-18

Re: Identifying the element

on Tue Dec 22, 2009 8:55 pm
can you please how i can use in java code
kmahata@gmail.com
Active particpant
Active particpant
Posts : 10
Join date : 2009-11-06

Re: Identifying the element

on Tue Dec 22, 2009 8:58 pm
selenium.mouseover("css=.ricAppMenuHover")

execute it first and see if its identifying the 'manage' element and a drop down is shown....
bull
Active particpant
Active particpant
Posts : 10
Join date : 2009-12-18

Re: Identifying the element

on Tue Dec 22, 2009 8:59 pm
can any one tell how to use a title to click the button?
selenium.click("//button[@title='Login']");
bull
Active particpant
Active particpant
Posts : 10
Join date : 2009-12-18

Re: Identifying the element

on Wed Dec 23, 2009 3:46 pm
got the solution,this is is what i used
selenium.click("xpath=//button[contains(text(), 'Log in')]");

any help with the clicking the drop down would help
Sponsored content

Re: Identifying the element

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