Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» FlexMonkium Download Not available under Gorillalogic site
Thu Dec 08, 2016 5:40 pm by bhanu.praveen

» Selenium Script issue
Tue Dec 06, 2016 9:48 pm by njain213

» Difference between QTP, Selenium and Silk test
Tue Dec 06, 2016 7:58 pm by jessicacyrus1

» Where does selenium script pick browser from
Tue Dec 06, 2016 1:52 pm by janbaskt

» Safari throws an HTTP ERROR: 404
Tue Dec 06, 2016 1:51 pm by janbaskt

» Access Denied Error in Selenium RC
Tue Dec 06, 2016 1:51 pm by janbaskt

» Automating Flex application through selenium webdriver
Fri Dec 02, 2016 2:06 pm by abhinay.krs

» Starting with Selenium, what is Selenium?
Mon Nov 28, 2016 4:00 pm by Foma

» Getting started with Selenium
Mon Nov 28, 2016 3:23 pm by Rebbelx

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Problems in locating elements in Selenium

View previous topic View next topic Go down

Problems in locating elements in Selenium

Post by vidya shree on Thu May 09, 2013 4:45 pm

Hi!! I m new to Selenium. i am using Selenium 2.0 (java).I am facing problms in locating the elements.

For example:

I tried to locate "Logout" in the mail by id,Xpath and CSS.But none of this located properly.

Even i checked using Firefinder to highlight that Element(Logout) by Xpath and CSS.But i cudnt find it.

Please help me to clear out the issue.

[ Does selenium has any Object Repository as in QTP ??..

Selenium looks difficult in locating objects when compare to QTP.Is it so?

Which is the best tool for Automation Testing??Question ]

Looking forward ur kindness.

Thanks,

Vidya.

vidya shree
Regular Participant
Regular Participant

Posts : 31
Join date : 2013-05-09

Back to top Go down

Re: Problems in locating elements in Selenium

Post by tarun3kumar on Thu May 09, 2013 5:23 pm

Selenium does not have object repo like QTP, but nothing stops you to build one. About Logout link, would you show us html of link and locator you used?

_________________
Thanks
Tarun K
Free Selenium Training

tarun3kumar
Master
Master

Posts : 186
Join date : 2012-02-14

http://seleniumtests.com

Back to top Go down

Re: Problems in locating elements in Selenium

Post by vidya shree on Thu May 09, 2013 5:48 pm

Thanks for ur response

Following is the HTML for t same.

"id="e-toptoolbar-pref" class="s-top-text" onclick="AAA.DSq.ELU(event, this.id, 'EPH');return false;" style="font-weight: bold;" href="#">Logout"

Note: I ve removed the anchor tag in the above code.

For tat i ve used xpath as "//*[@id="e-toptoolbar-pref"]" and "//html/body/div/div/div[6]/div/table/tbody/tr/td[7]/a"
and CSS as "html body.s-basicpanel div.s-stack div.s-basicpanel div.s-toppanel div#e-mainmenu-area.s-mainmenu-area table.s-top-text tbody tr td a#e-toptoolbar-pref.s-top-text"

Awaiting ur response

Thanks
Vidya

vidya shree
Regular Participant
Regular Participant

Posts : 31
Join date : 2013-05-09

Back to top Go down

Re: Problems in locating elements in Selenium

Post by vinayakjadhav1857 on Thu May 09, 2013 6:42 pm

will u show the whole html code or the relative div ?

vinayakjadhav1857
Active particpant
Active particpant

Posts : 19
Join date : 2013-04-22

Back to top Go down

Re: Problems in locating elements in Selenium

Post by vidya shree on Thu May 09, 2013 8:32 pm

Thanks for ur response vinayak

I am not able to attach my code here.
Any suggestions to display the code ??

Thanks,
Vidya.

vidya shree
Regular Participant
Regular Participant

Posts : 31
Join date : 2013-05-09

Back to top Go down

Re: Problems in locating elements in Selenium

Post by vinayakjadhav1857 on Fri May 10, 2013 11:23 am

ok.. just check in which frame ""e-toptoolbar-pref" " is located in your plain HTML code..switch to that frame..and then select the respective element..

driver.switchTo().frame("yourframename");

vinayakjadhav1857
Active particpant
Active particpant

Posts : 19
Join date : 2013-04-22

Back to top Go down

Re: Problems in locating elements in Selenium

Post by vidya shree on Fri May 10, 2013 12:29 pm

Thanks for ur response vinayak

Ya Its working now.
Now i am able to locate the logout link.
Here is my code:
driver.switchTo().frame(driver.findElement(By.name("s_MainFrame")));
WebElement logout = driver.findElement(By.xpath("//html/body/div/div/div[6]/div/table/tbody/tr/td[7]/a"));
logout.click();
driver.switchTo().defaultContent();

Thanks again.
Vidya.

vidya shree
Regular Participant
Regular Participant

Posts : 31
Join date : 2013-05-09

Back to top Go down

Re: Problems in locating elements in Selenium

Post by vinayakjadhav1857 on Fri May 10, 2013 1:01 pm

nice to hear..

vinayakjadhav1857
Active particpant
Active particpant

Posts : 19
Join date : 2013-04-22

Back to top Go down

Re: Problems in locating elements in Selenium

Post by Sponsored content Today at 3:52 pm


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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