- bugsyg
- Posts : 6
Join date : 2010-03-08
How to select a text in iFrame and bold it?
Mon Mar 08, 2010 7:22 pm
Hi,
I have an iFrame box and I am able to type some value using typekeys function in Selenium IDE. Now I want to select the text that I have added and make it bold. Bold option is there in a tool box in the iFrame.
Example as below. Type Hello wold and want to highlight the same text and mark it as bold
typeKeys
//html/body/p
Hello world
Thanks!
I have an iFrame box and I am able to type some value using typekeys function in Selenium IDE. Now I want to select the text that I have added and make it bold. Bold option is there in a tool box in the iFrame.
Example as below. Type Hello wold and want to highlight the same text and mark it as bold
Thanks!
Re: How to select a text in iFrame and bold it?
Tue Mar 09, 2010 11:49 am
Hi,
Use this command .
selectFrame("Name/ID of the frame ");
type("//body"," how are you? this will print in next line");
selectWindow("null");
NOTE: use html syntax with text to bold or italic in type command. I try to add this in above code but it interpret the formatting syntax and applying in it. so you have to add it on your own, the command remain same.
Best of Luck.
Bye
Use this command .
selectFrame("Name/ID of the frame ");
type("//body"," how are you? this will print in next line");
selectWindow("null");
NOTE: use html syntax with text to bold or italic in type command. I try to add this in above code but it interpret the formatting syntax and applying in it. so you have to add it on your own, the command remain same.
Best of Luck.
Bye
- bugsyg
- Posts : 6
Join date : 2010-03-08
Re: How to select a text in iFrame and bold it?
Wed Mar 10, 2010 2:50 pm
Hey Thanks for the reply...
The editor tool have Bold and Italic buttons. What I want to do is to highlight the text and make selenium IDE to click on Bold button.
Is it possible? The text highlighting part?
Thanks!
The editor tool have Bold and Italic buttons. What I want to do is to highlight the text and make selenium IDE to click on Bold button.
Is it possible? The text highlighting part?
Thanks!
Re: How to select a text in iFrame and bold it?
Wed Mar 10, 2010 5:47 pm
No you can't click on bold button but you can make it by typing HTML code.
The reasons for that is you can accessible text area only not the formatting buttons present on editor.
The things you can do is type into it with formatting HTML text.
The reasons for that is you can accessible text area only not the formatting buttons present on editor.
The things you can do is type into it with formatting HTML text.
- bugsyg
- Posts : 6
Join date : 2010-03-08
Re: How to select a text in iFrame and bold it?
Wed Mar 10, 2010 5:52 pm
hmmm... that mean If i want to bold a text using selenium IDE in this editor [where i am typing now] with the steps type, select, bold it's not possible? if the answer is yes how i can check whether the B button in the editor tool bar is working?
Thanks!!
Thanks!!
Re: How to select a text in iFrame and bold it?
Fri Mar 12, 2010 6:10 pm
you have to do it manually only or you can can find other tool who support the testing of special editor.
You can just test that something is entering into it and flow is working fine.
You can just test that something is entering into it and flow is working fine.
- bugsyg
- Posts : 6
Join date : 2010-03-08
Re: How to select a text in iFrame and bold it?
Mon Mar 15, 2010 11:27 am
okay... thanks a lot!
- qasim
- Posts : 2
Join date : 2013-06-13
Re: How to select a text in iFrame and bold it?
Mon Jun 17, 2013 2:47 pm
could you please mention the way you are typing in an iframe...??
- mail2prassadAmateur
- Posts : 41
Join date : 2013-06-05
Re: How to select a text in iFrame and bold it?
Mon Jun 17, 2013 5:00 pm
You can not write text directly on to an Iframe, there might be other input element inside the Iframe that takes the text from user. Look at the Iframe source and find that text input element and try the code below.
JavascriptExecutor executor = (JavascriptExecutor)driver;
executor.executeScript("document.getElementById(ELEMENT_FOR_TEXT_IN_IFRAME).style.backgroundColor = '#FF33FF';"); -- highlights the text
executor.executeScript("document.getElementById(ELEMENT_FOR_TEXT_IN_IFRAME).style.fontWeight = 'bold';"); -- bolds the text.
If the Frame is a contentEditable Frame, then try
driver.switchTo(IFRAME_NAME);
JavascriptExecutor executor = (JavascriptExecutor)driver;
executor.executeScript("document.body.style.backgroundColor = '#FF33FF';"); -- highlights the text
executor.executeScript("document.body.style.fontWeight = 'bold';"); -- bolds the text.
JavascriptExecutor executor = (JavascriptExecutor)driver;
executor.executeScript("document.getElementById(ELEMENT_FOR_TEXT_IN_IFRAME).style.backgroundColor = '#FF33FF';"); -- highlights the text
executor.executeScript("document.getElementById(ELEMENT_FOR_TEXT_IN_IFRAME).style.fontWeight = 'bold';"); -- bolds the text.
If the Frame is a contentEditable Frame, then try
driver.switchTo(IFRAME_NAME);
JavascriptExecutor executor = (JavascriptExecutor)driver;
executor.executeScript("document.body.style.backgroundColor = '#FF33FF';"); -- highlights the text
executor.executeScript("document.body.style.fontWeight = 'bold';"); -- bolds the text.
- How to select click on text inside div by text
- how to select text from a disabled field?
- 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)
- Selenium Automatically clears the text entered in text box-Dynamic Web Table(dgrid)
- insert text in a text box of the console
Permissions in this forum:
You cannot reply to topics in this forum
|
|