Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
bugsyg
Posts : 6
Join date : 2010-03-08

How to select a text in iFrame and bold it? Empty 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!
Advisor
Advisor
------------------------
------------------------
Posts : 387
Join date : 2009-07-30
Location : India
https://seleniumforum.forumotion.net

How to select a text in iFrame and bold it? Empty 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
avatar
bugsyg
Posts : 6
Join date : 2010-03-08

How to select a text in iFrame and bold it? Empty 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!
Advisor
Advisor
------------------------
------------------------
Posts : 387
Join date : 2009-07-30
Location : India
https://seleniumforum.forumotion.net

How to select a text in iFrame and bold it? Empty 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.
avatar
bugsyg
Posts : 6
Join date : 2010-03-08

How to select a text in iFrame and bold it? Empty 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!!
Advisor
Advisor
------------------------
------------------------
Posts : 387
Join date : 2009-07-30
Location : India
https://seleniumforum.forumotion.net

How to select a text in iFrame and bold it? Empty 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.
avatar
bugsyg
Posts : 6
Join date : 2010-03-08

How to select a text in iFrame and bold it? Empty Re: How to select a text in iFrame and bold it?

Mon Mar 15, 2010 11:27 am
okay... thanks a lot!
avatar
qasim
Posts : 2
Join date : 2013-06-13

How to select a text in iFrame and bold it? Empty 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...??
avatar
mail2prassad
Amateur
Amateur
Posts : 41
Join date : 2013-06-05

How to select a text in iFrame and bold it? Empty 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.
Sponsored content

How to select a text in iFrame and bold it? Empty Re: How to select a text in iFrame and bold it?

Back to top
Permissions in this forum:
You cannot reply to topics in this forum