I'm trying to replace text in a header and it's not working.
Replacetext is working through the main body of the document.
When I look at the locals I can see this error: "'Novacode.DocX.Headers.get returned.first.Sections' threw an exception of type 'System.NullReferenceException'"
Any help would be greatly appreciated,
Thanks,
Lbob
It will help if i can see your code but i guees i can try to help you somehow.
This is how i replace [tag] by something, in a header :
using (DocX document = DocX.Create(#"docs\myDoc.docx"))
{
document.Headers.first.ReplaceText("[tag]", "something");
}
Hope this will help
Related
I have a question regarding the Haxe code. I try to use the quote as an input but it does not seem to work.
if (Input.getKeyboard().down("\'")) {
trace("TEST");
}
however when I use something like
if (Input.getKeyboard().down("\\")) {
trace("TEST");
}
When I press the \ button it works.
When I output the single quote as such:
var quote="\'";
trace(quote);
The output comes out correct as '
If anyone has insight as to why it does not work I would apreciate the help!!!
Thank you!
I have been looking for an XPath code to get the value of the attribute of an HTML element as part of my regression testing. Can anyone please help
the attribute value is dynamic changes for every next webelement
below is the HTML code
<figcaption id="recentVideosvideoname0" data-videono="xZA6FJ32Twe2GQYEuBHJnQ==" title="test for test" class="caption">test for test</figcaption>
i want attribute : data-videono
I have tried something like this
By.xpath(("//div[contains(#id,'recentVideos')]/div/a/figure/figcaption"));
Here is the Answer to your Question:
To retrieve the attribute data-videono you can consider to use the following line of code:
String my_attribute = driver.find_element_by_xpath("//figcaption[starts-with(#id, 'recentVideos') and #title='test for test']").getAttribute("data-videono");
Let me know if this Answers your Question.
Please follow the approach mentioned below:
driver.findElement(By.xpath("//div[contains(#id,'recentVideos')]/div/a/figure/figcaption")).getAttribute("data-videono");
You can get attribute value by using XPath itself.
XPath 1.0
"//div[contains(#id,'recentVideos')]/div/a/figure/figcaption/#data-videono"
Notice the #data-videono at the end of string, which will return attribute value (p.s. it seems like it is base64 encoded data)
I don't know if i got your question, but do you already tried:
String var = driver.frindElemnt(By.xpath("put your xpath in here")).getAttribute("data-videono");
Tried using
By.id("aaabICLL.AreaViewStatic.ServiceLink17"), By.className("urLnkFunction"),Xpath, linkText("Serviceman Basic Report")
And for these encountered this error:
NoSuchElementException.eclipse is unable to locate the "Serviceman Basic Report" hyperlink.
Serviceman Basic Report
You can use following xpath for your case:
driver.findElement(By.xpath("//*[contains(text(),'Serviceman Basic Report')]")).click();
Hope it will help you.
I'm new to Selenium and ScalaTest, but I'm having issues finding Selenium+ScalaTest's counterpart to .getText()
For example, when I use selenium-java, I can retrieve text "Cat" by:
driver.findElement(By.id("firstHeading")).getText()
from:
<h1 id="firstHeading" class="firstHeading" lang="en">Cat</h1>
However, I can't figure out how to do this with ScalaTest, and my googling skills have failed me. Any help would be greatly appreciated, thank you!
I've figured out one working solution:
id("firstHeading").element.text should be ("Cat")
This lets me extract the text from an element by the id "firstHeading". Please let me know if there is a better/more acceptable approach. Thanks!
I am using Moodle 2.3
I am trying to add help button to my self registration form in moodle. I am making changed in
/login/signup_form.php page.
I am using:
$mform->addHelpButton('country','country','moodle');
This creates a help icon on the page. But clicking on the icon it loads the help information on the same page. The pop up doesn't work. No JavaScript errors found in firebug.
Plz help
You need to on ajax/javascript setting from the admin.
Site administration > Appearance > AJAX and Javascript
You should also add an entry to lang/en/moodle.php
For example
In course/edit_form.php I added the following field
// Course Champion$mform->addElement('text', 'champion', 'Champion', get_string('champion'), 'size="256"');
// New field$mform->addHelpButton('champion','courseChampion');
// Field help$mform->setDefault('champion', 'Firstname Lastname');
Then in lang/en/moodle.php I added the help information for that field.
$string['courseChampion'] = 'Course Champion';
$string['courseChampion_help'] = 'Enter the firstname and lastname of the champion.';
In moodle.php under /root/lang/en, add the following string:
$string['country_help'] = 'Your text here';