//*contains[text(),"text"]

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

//*contains[text(),"text"]

Muaaz
This post was updated on .
Guys i am using a above mention expression to select a text in my UI , my problem is i need to select a text with a space eg: WRONG SOFTWARE

without any spacing above expression is working so fine , what should be the solution for this ,


also i need to select a text similarly  eg: report(s)


pls help me ,  


Thank you ,
Reply | Threaded
Open this post in threaded view
|

Re: //*contains[text(),"text"]

softwaretestingforum
Administrator
Do you encounter any error when you use -

//*[contains(text(), 'WRONG SOFTWARE')]
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: //*contains[text(),"text"]

Muaaz
Yes tarun ,

when i cross check with SELENIUM IDE , i didnt output a error , but when i running on through Remote , it couldnt select ,

Reply | Threaded
Open this post in threaded view
|

Re: //*contains[text(),"text"]

softwaretestingforum
Administrator
Could you paste more of your code and small snippet of corresponding html?
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: //*contains[text(),"text"]

Muaaz
<div class="x-combo-list-item">Wrong Software</div>

Hi Tarun ,

I found that in my system there is another text is visible as Wrong Software , what i trying to select from a message box drop down item (HTML ELEMENT) ,

when i trying to find through selenium IDE , it detects the back Wrong Software text , and it is not detecting the message box drop down item ,

How do i accomplish this

 
Reply | Threaded
Open this post in threaded view
|

Re: //*contains[text(),"text"]

softwaretestingforum
Administrator
I suppose this is the html of element which Selenium IDE identifies -

<div class="x-combo-list-item">Wrong Software</div>

Could you also post html of select element ? It should begin with select tag.
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: //*contains[text(),"text"]

Muaaz
v id="ext-gen142" class="x-combo-list-inner" style="width: 282px; margin-bottom: 8px; height: 247px;">
<div class="x-combo-list-item x-combo-selected">--Select--</div>
<div class="x-combo-list-item">Lost</div>
<div class="x-combo-list-item">Not Repaired</div>
<div class="x-combo-list-item">Not Refurbished</div>
<div class="x-combo-list-item">Wrong Software</div>
<div class="x-combo-list-item">Missing In Shipment</div>
<div class="x-combo-list-item">Other</div>
</div>


i THINK IF SAME TEXT APPEARS IN THE SAME PAGE IT CANT RECOGNIZE WHAT I WANT , may have some additional expression to //*contains[text(),"text"] , similarly we put eg: //html/tbody/tr/td/div/div[1]
Reply | Threaded
Open this post in threaded view
|

Re: //*contains[text(),"text"]

softwaretestingforum
Administrator
Did you try to use class name - x-combo-list-item, along with text?
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: //*contains[text(),"text"]

Muaaz
Nope , tarun , wht it should be alike ,
Reply | Threaded
Open this post in threaded view
|

Re: //*contains[text(),"text"]

softwaretestingforum
Administrator
Try this xpath -

//div[@class='x-combo-list-item'][contains(text(), 'Wrong Software')]
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: //*contains[text(),"text"]

Muaaz
No luck , tarun
Reply | Threaded
Open this post in threaded view
|

Re: //*contains[text(),"text"]

softwaretestingforum
Administrator
Did you encounter any error? What was the outcome?
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: //*contains[text(),"text"]

Muaaz
It cant detect the relevant text as per IDE ,
Reply | Threaded
Open this post in threaded view
|

Re: //*contains[text(),"text"]

softwaretestingforum
Administrator
It would benefit if you could add snap shot of Selenium IDE and your application, indicating the element you expect to be highlighted but the element which is highlighted in reality.

I assume that combination of class name and text name are not constant and may have to add more attribute to identify it uniquely. But we could help you better only when you provide more information.
~ seleniumtests.com