Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Run automated selenium test scripts from JIRA ondemand
Fri Dec 08, 2017 12:40 pm by azharuddin

» New! Appium Desktop
Sat Nov 25, 2017 3:51 pm by azharuddin

» Selenium WebDriver Integration
Tue Nov 21, 2017 1:06 pm by azharuddin

» how to connect DB in selenium webriver
Fri Oct 06, 2017 4:09 pm by anbarasi

» How find any text in browser screen and click on it?
Thu Oct 05, 2017 2:02 pm by sandeepkommineni

» Selenium Webdriver
Tue Oct 03, 2017 1:35 pm by PiyushBiswas

» GRID setup tutorial.
Wed Sep 27, 2017 4:29 pm by johnyapp

» Drag & Drop Between Windows Using Selenium Driver
Wed Sep 27, 2017 2:10 pm by 26rondel

» Check if window is closed / verify input
Sat Sep 23, 2017 10:21 pm by brainstir

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 ?
avatar
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");
avatar
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..
avatar
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


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