Need suggestions on locating elements

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view

Need suggestions on locating elements

Hi Team,

I have few doubts while locating the elements using selenium.

1.       Two drop down boxes having the same locating structure:

In my application I have two drop down boxes. I need to select on list value in drop down one as well as two. But the locating structures for these two drop boxes are same. When I try to locate the value in second drop down it is trying to locate the first element. So not able to locate the second drop down list value.They don’t have select tag. And XPath locator is not allowed.

Please let me know is there any way to locate the second drop down box data value.


2.       Unable to locate the tool tip data(Similar to 1st question):

There are two tool tips with same locating structure. When I try to mouse hover on the first image we need to wait for some time to get the text of tool tip. Is there any way other than thread.sleep()? I tried with explicit wait, but unable to sync with that?

And also unable to locate the second tool tip as both having the same locating structure.


3.       Content Validation:

There is one paragraph with <br> lines. I need to compare the expected string with actual content. How can we separate the string line with <br> tag. Usually we have /n instead in strings.

4.       Is there any way to validate the image?

We need to check whether the image is displayed in the pager or not and need to validate whether the image is expected one or not.

Please help me and give your inputs to improve my skills in Core java (Any good websites) and selenium.


Thanks in advance,

Reply | Threaded
Open this post in threaded view

Re: Need suggestions on locating elements

Hello Daniel,

This is wrong place to ask generic Webdriver questions.
Please post your Webdriver questions here -