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

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