Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Geting issues in identifying the elsements in webdriver
Fri Feb 17, 2017 4:41 pm by janbaskt

» WebDriver - why not to use a singlton for it?
Fri Feb 17, 2017 4:40 pm by janbaskt

» WebDriver session when using testng annotation to invoke driver instance
Fri Feb 17, 2017 4:39 pm by janbaskt

» Selenium fails to launch Chrome
Fri Feb 17, 2017 4:39 pm by janbaskt

» why do i get this error
Fri Feb 17, 2017 4:38 pm by janbaskt

» Selenium Tutorial
Thu Feb 16, 2017 5:21 pm by Rahul

» When to use Selenium IDE, RC and WebDriver
Mon Feb 13, 2017 2:35 pm by azharuddin

» How to integrate selenium with ZAPI-Zephyr
Sat Feb 11, 2017 2:25 am by gseera002c

» Selenium Webdriver
Sat Feb 04, 2017 6:47 pm by soumyamishrav@gmail.com

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


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