Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» 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

» How to work on pages with AJAX in selenium?
Mon Sep 18, 2017 6:08 pm by azharuddin

» pause test until user press a key like F2
Wed Aug 09, 2017 11:10 pm by djnforce

» Selecting the input for auto populating element
Sat Jul 29, 2017 7:53 pm by kdabbara

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Find and click a span element value

View previous topic View next topic Go down

Find and click a span element value

Post by Darknet on Mon Apr 11, 2016 4:32 am

How can ich find a Value of a span element and click.



Code:
<a >
<span class="right-tab">
<span class="left-tab">LiveTv</span>
</span>
</a>

How can i say LiveTV click.
Normally i use these Code:

login = mytv.findElement(By.id("loginButton"));
But there i cant say "find Element by LiveTV"

Darknet

Posts : 1
Join date : 2016-04-11

Back to top Go down

Re: Find and click a span element value

Post by kishor.meher@outlook.com on Mon Apr 11, 2016 8:39 pm

try following, it must fix your problem.

login = mytv.findElement(By.xpath("//span[text()='Live TV']"));

kishor.meher@outlook.com

Posts : 2
Join date : 2016-04-11

Back to top Go down

Re: Find and click a span element value

Post by murthi on Thu Apr 14, 2016 8:23 pm

You can use the following way,

1. driver.findElement(By.LinkText("LiveTV")).click();
2. List lstWE=driver.findElement(By.className("left-tab"));
    for(WebElement ele:lstWE){
            if(ele.getText().equals("LiveTV")
                ele.click();
                break;
         }
    }

3. As mentioned in the previous post.

murthi
Active particpant
Active particpant

Posts : 11
Join date : 2016-04-14
Location : Bangalore

Back to top Go down

Re: Find and click a span element value

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