Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» FlexMonkium Download Not available under Gorillalogic site
Thu Dec 08, 2016 5:40 pm by bhanu.praveen

» Selenium Script issue
Tue Dec 06, 2016 9:48 pm by njain213

» Difference between QTP, Selenium and Silk test
Tue Dec 06, 2016 7:58 pm by jessicacyrus1

» Where does selenium script pick browser from
Tue Dec 06, 2016 1:52 pm by janbaskt

» Safari throws an HTTP ERROR: 404
Tue Dec 06, 2016 1:51 pm by janbaskt

» Access Denied Error in Selenium RC
Tue Dec 06, 2016 1:51 pm by janbaskt

» Automating Flex application through selenium webdriver
Fri Dec 02, 2016 2:06 pm by abhinay.krs

» Starting with Selenium, what is Selenium?
Mon Nov 28, 2016 4:00 pm by Foma

» Getting started with Selenium
Mon Nov 28, 2016 3:23 pm by Rebbelx

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

text check

View previous topic View next topic Go down

text check

Post by zlos7ar on Fri Jan 20, 2012 8:12 pm

Is there a way to check the position of a specific text ?

zlos7ar
Amateur
Amateur

Posts : 41
Join date : 2012-01-13
Age : 28
Location : Germany

Back to top Go down

Re: text check

Post by faramka on Fri Jan 20, 2012 9:07 pm

If you know which element contains the text, you can use getElementPositionLeft() and getElementPositionTop().

faramka
Professional
Professional

Posts : 143
Join date : 2011-09-15
Location : Poland

Back to top Go down

Re: text check

Post by zlos7ar on Fri Jan 20, 2012 9:25 pm

Ok thanks I will try it now.
What I am trying to do is:
I have a list of ideas and i can sort them by "most recent" "most liked" and "last modified". And i need to test if those options work properly.
So what I was thinking is for example to post a new idea and then arrange ideas by "most recent" and check if that idea is on the top of the list.

If anyone have a better idea fell free to share it Smile

zlos7ar
Amateur
Amateur

Posts : 41
Join date : 2012-01-13
Age : 28
Location : Germany

Back to top Go down

Re: text check

Post by faramka on Fri Jan 20, 2012 9:40 pm

Is "idea is on the top of the list"equal to "idea is at the first place of the list"?

Can you check html source of the page?
If it looks like this:
(after arranging ideas by "most recent")
Code:
< u l id="ideas">
    <li>Recent Idea</li>
    <li>An Idea</li>
    <li>Other Idea</li>
</ u l>
you can simply get the text of first element li and check if it is equals to posted idea.
Command | getText
Target | //ul[@id='ideas']/li[1]


Last edited by faramka on Fri Jan 20, 2012 9:42 pm; edited 1 time in total

faramka
Professional
Professional

Posts : 143
Join date : 2011-09-15
Location : Poland

Back to top Go down

Re: text check

Post by zlos7ar on Fri Jan 20, 2012 9:49 pm

it looks like this
div latest idea close div

div previous idea close div

....

zlos7ar
Amateur
Amateur

Posts : 41
Join date : 2012-01-13
Age : 28
Location : Germany

Back to top Go down

Re: text check

Post by zlos7ar on Fri Jan 20, 2012 9:54 pm

Is "idea is on the top of the list"equal to "idea is at the first place of the list"?

The last idea in the database table should be the first one in the most recent view

zlos7ar
Amateur
Amateur

Posts : 41
Join date : 2012-01-13
Age : 28
Location : Germany

Back to top Go down

Re: text check

Post by zlos7ar on Fri Jan 20, 2012 10:04 pm

or maybe i have to login to mysql database, find the last idea, store its title in a variable and then check if the title is equal to the title on the first position in my ideas list ?

zlos7ar
Amateur
Amateur

Posts : 41
Join date : 2012-01-13
Age : 28
Location : Germany

Back to top Go down

Re: text check

Post by zlos7ar on Fri Jan 20, 2012 10:20 pm

I figured it out thanks for the help
my top idea always have this path:
//*[@id='content-container']/div[1]/div[5]/div[1]/div[3]/a
no matter which one is on the top of the list
my second always have this path no matter which one is on second place
//*[@id='content-container']/div[1]/div[5]/div[2]/div[3]/a
and so on so that makes it easy to check everything
thanks again have a nice weekend

zlos7ar
Amateur
Amateur

Posts : 41
Join date : 2012-01-13
Age : 28
Location : Germany

Back to top Go down

Re: text check

Post by zlos7ar on Fri Jan 20, 2012 10:29 pm

oh one more ting Very Happy im such a noob in selenium ide Wink
now im doing this:
1.I submit a new idea with the name "testing IdeaPool most recent"
2. command: storeText
target: //*[@id='content-container']/div[1]/div[5]/div[1]/div[3]/a
value: topidea
3. and then echo ${topidea} prints the idea on the top of my list
and now i need to compare topidea and "testing IdeaPool most recent"
how can i do that in selenium ide ? what command do i use ? or i have to make my own function for that ?

zlos7ar
Amateur
Amateur

Posts : 41
Join date : 2012-01-13
Age : 28
Location : Germany

Back to top Go down

Re: text check

Post by zlos7ar on Fri Jan 20, 2012 11:28 pm

I DID IT !!! Very Happy (happy) you can close the topic

first i store the title of the idea while i enter new idea
storeValue name=title lastidea
echo ${lastidea} --> get me the name of the last idea
then i go to most recent ideas and store the title of the idea thats on position 1
storeText //*[@id='content-container']/div[1]/div[5]/div[1]/div[3]/a topidea
${topidea} gives me the name of the top idea
then i do this
store javascript{var bool=(storedVars['lastidea']===storedVars['topidea']);bool;} bool
echo ${bool} gives me true if the names are the same and false if they are not Smile
thats it Smile

zlos7ar
Amateur
Amateur

Posts : 41
Join date : 2012-01-13
Age : 28
Location : Germany

Back to top Go down

Re: text check

Post by Sponsored content Today at 5:49 pm


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