Hi all,
I have been browsing the forum for a while and puzzling to fix my issue but so far I am struggling.
I want to automate a function we have on our website, but before that I want to ensure certain facilities that the website offers are turned on or off.
The snapshot is added as an example.
I made a testbuild that I had working on Friday but now it gives a build error
(The recording 'CheckboxCheck.rxrec' has build errors)
And when I altered it to a different checkbox in a new test I just couldnt get it to work at all. (but then the checkbox stated it was not in a .wrapper but in a .someDivTag)
Does anybody know anything that can help me out here?
{
public partial class TestCheckBoxes
{
/// <summary>
/// This method gets called right after the recording has been started.
/// It can be used to execute recording specific initialization code.
/// </summary>
private void Init()
{
}
public void Mouse_Validation(RepoItemInfo inputtagInfo)
{
//create the checkbox
Ranorex.InputTag cusChkbox1 = repo.MGnZorgverlenersportaal.Wrapper.MobileApp;
//if checkbox is unchecked, click on it, else double click
if (cusChkbox1.Checked=="True")
{
cusChkbox1.Click();
}
else {
cusChkbox1.DoubleClick();
}
}
CheckBox Issues
CheckBox Issues
You do not have the required permissions to view the files attached to this post.
Re: CheckBox Issues
Hi,
Could you please post a full xpath for given checkbox element, as stored in repo? The code you are using looks OK. But it's hard to tell what's wrong, without knowing the xpath. Also, it would be good to know Ranorex version. Are you using the latest one (8.3.3 or 9.0)?
Could you please post a full xpath for given checkbox element, as stored in repo? The code you are using looks OK. But it's hard to tell what's wrong, without knowing the xpath. Also, it would be good to know Ranorex version. Are you using the latest one (8.3.3 or 9.0)?
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: CheckBox Issues
It's Ranorex version 8.3.0
I am not familiar with Xpaths, but I found an introductory video on that on this website so I will look into that and hopefully be able to give an answer to that.
I am not familiar with Xpaths, but I found an introductory video on that on this website so I will look into that and hopefully be able to give an answer to that.
Re: CheckBox Issues
is this the xPath?
/dom[@caption='MGnZorgverlenersportaal']//div[#'app']/div/div[1]/div/div[2]/div/div[2]/div/div/div[2]/div[2]/?/?/div/label[1]/input[@title='mobileApp']
/dom[@caption='MGnZorgverlenersportaal']//div[#'app']/div/div[1]/div/div[2]/div/div[2]/div/div/div[2]/div[2]/?/?/div/label[1]/input[@title='mobileApp']
Re: CheckBox Issues
Hello MdeVolder,
The Caption attribute in your snapshot is "MGn Zorgverlenersportaal" and in your RanoreXPath it is "MGnZorgverlenersportaal". There is a space in your snapshot. If your RanoreXPath in the repository does not have the space, then the element won't be found.
Also, your code says if checkbox is checked, then click, else double-click. This is exactly the opposite of what you are writing in the comment of the code.
Does this help?
Regards,
McTurtle
The Caption attribute in your snapshot is "MGn Zorgverlenersportaal" and in your RanoreXPath it is "MGnZorgverlenersportaal". There is a space in your snapshot. If your RanoreXPath in the repository does not have the space, then the element won't be found.
Also, your code says if checkbox is checked, then click, else double-click. This is exactly the opposite of what you are writing in the comment of the code.
Does this help?
Regards,
McTurtle
Re: CheckBox Issues
Hi,
Aside to what McTurtle suggested, I would also suggest to simplify the xpath, to make it more stable. Generally speaking, xpaths with a lot of elements end especially elements indexes (which tends to change), are too fragile and easy to fail. Hence I would suggest to use something like this:
Aside to what McTurtle suggested, I would also suggest to simplify the xpath, to make it more stable. Generally speaking, xpaths with a lot of elements end especially elements indexes (which tends to change), are too fragile and easy to fail. Hence I would suggest to use something like this:
/dom[@caption='MGn Zorgverlenersportaal']/body//div[@class='container']//div[@class='main-content']//div[@class='page__body']//div/label[@class='checkbox-container']/input[@title='mobileApp']
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration