- zlos7arAmateur
- Posts : 41
Join date : 2012-01-13
Age : 36
Location : Germany
text check
Fri Jan 20, 2012 8:12 pm
Is there a way to check the position of a specific text ?
- faramkaProfessional
- Posts : 143
Join date : 2011-09-15
Location : Poland
Re: text check
Fri Jan 20, 2012 9:07 pm
If you know which element contains the text, you can use getElementPositionLeft() and getElementPositionTop().
- zlos7arAmateur
- Posts : 41
Join date : 2012-01-13
Age : 36
Location : Germany
Re: text check
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
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
- faramkaProfessional
- Posts : 143
Join date : 2011-09-15
Location : Poland
Re: text check
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")
Command | getText
Target | //ul[@id='ideas']/li[1]
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>
Command | getText
Target | //ul[@id='ideas']/li[1]
- zlos7arAmateur
- Posts : 41
Join date : 2012-01-13
Age : 36
Location : Germany
Re: text check
Fri Jan 20, 2012 9:49 pm
it looks like this
div latest idea close div
div previous idea close div
....
div latest idea close div
div previous idea close div
....
- zlos7arAmateur
- Posts : 41
Join date : 2012-01-13
Age : 36
Location : Germany
Re: text check
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
The last idea in the database table should be the first one in the most recent view
- zlos7arAmateur
- Posts : 41
Join date : 2012-01-13
Age : 36
Location : Germany
Re: text check
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 ?
- zlos7arAmateur
- Posts : 41
Join date : 2012-01-13
Age : 36
Location : Germany
Re: text check
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
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
- zlos7arAmateur
- Posts : 41
Join date : 2012-01-13
Age : 36
Location : Germany
Re: text check
Fri Jan 20, 2012 10:29 pm
oh one more ting im such a noob in selenium ide
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 ?
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 ?
- zlos7arAmateur
- Posts : 41
Join date : 2012-01-13
Age : 36
Location : Germany
Re: text check
Fri Jan 20, 2012 11:28 pm
I DID IT !!! (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
thats it
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
thats it
- webdriver + python, how to check for presence of text on page?
- How to check the whether the text present in the page or under particular area or not in Webdriver
- How to get the tittle of a object (not window), bcz title holds the full text but inner text holds only 25 char of text (in RC and Webdriver)
- insert text in a text box of the console
- Verify text present when the text appears in more location in the page
Permissions in this forum:
You cannot reply to topics in this forum
|
|