Hi Team,
I am facing issue while providing current system date to a cell field of a table.
path tracked by ranorex of the field
table[@name='sgImplants']/?/?/cell[@name='sgImplants' and @columnindex='2']
trying to provide the date with below code
autopsyRepo.Barhusmeddelande.SgImplants.Element.SetAttributeValue("Text", System.DateTime.Now.ToShortDateString());
But it is not working , Please suggest the solution.
How to put Sysdate to a cell field
Re: How to put Sysdate to a cell field
Hi,
Could you please upload a Ranorex snapshot (NOT screenshot) of the element in question? Without seeing, at very least, Ranorex snapshot, it's impossible to tell what's wrong. Also, have you tried KeySequence instead of SetValue action? SetValue action may not invoke assigned mouse/keyboard events of given table/cell, so it should be used with caution.
Could you please upload a Ranorex snapshot (NOT screenshot) of the element in question? Without seeing, at very least, Ranorex snapshot, it's impossible to tell what's wrong. Also, have you tried KeySequence instead of SetValue action? SetValue action may not invoke assigned mouse/keyboard events of given table/cell, so it should be used with caution.
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: How to put Sysdate to a cell field
Hi ,
PFA the snapshot. Also tried keysequence but for date value its not working.
PFA the snapshot. Also tried keysequence but for date value its not working.
You do not have the required permissions to view the files attached to this post.
Re: How to put Sysdate to a cell field
Hi,
Thanks for the snapshot.
At first, it seems you are using Ranorex 9.0, which is somewhat buggy. So I would recommend to update it with most recent 9.1.1. I don't think this will fix your problem, but you know, one never knows?
At next, what do you mean that keysequence does not work with date value? So it does work with simple string? And what exactly happens, if you use SetValue?
BTW, have you tried to click in given cell (to set focus), before entering text?
And one more thing. The cell seems to be identified as Header cell! Are you sure it's possible to enter text in such cell? Have you tried to enter the text manually?
Thanks for the snapshot.
At first, it seems you are using Ranorex 9.0, which is somewhat buggy. So I would recommend to update it with most recent 9.1.1. I don't think this will fix your problem, but you know, one never knows?
At next, what do you mean that keysequence does not work with date value? So it does work with simple string? And what exactly happens, if you use SetValue?
BTW, have you tried to click in given cell (to set focus), before entering text?
And one more thing. The cell seems to be identified as Header cell! Are you sure it's possible to enter text in such cell? Have you tried to enter the text manually?
You do not have the required permissions to view the files attached to this post.
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: How to put Sysdate to a cell field
Hi,
I am trying to say here is its a cell field , so when I am setAttributeValue after providing click it says cell is readonly , But I am able to put value manually.
Another question how do you set sysdate is any field ? Since this is not text box and its a cell I am facing such issue.
I am trying to say here is its a cell field , so when I am setAttributeValue after providing click it says cell is readonly , But I am able to put value manually.
Another question how do you set sysdate is any field ? Since this is not text box and its a cell I am facing such issue.
Re: How to put Sysdate to a cell field
Hi,
Could you please try
If this does not work, would it be possible for you to upload another screenshot of the application where the date is filled in the cell so that we get a better look at the element.
BR
Manish
Could you please try
Code: Select all
autopsyRepo.Barhusmeddelande.SgImplants.Element.Text = System.DateTime.Now.ToShortDateString().ToString();
If this does not work, would it be possible for you to upload another screenshot of the application where the date is filled in the cell so that we get a better look at the element.
BR
Manish
Re: How to put Sysdate to a cell field
Hi Manish,
I tried your solution but getting below error
'Element' does not contain a definition for 'Text' and no extension method 'Text' accepting a first argument of type 'Element' could be found (are you missing a using directive or an assembly reference?)
Also PFA screenShot of the application
I tried your solution but getting below error
'Element' does not contain a definition for 'Text' and no extension method 'Text' accepting a first argument of type 'Element' could be found (are you missing a using directive or an assembly reference?)
Also PFA screenShot of the application
You do not have the required permissions to view the files attached to this post.
Re: How to put Sysdate to a cell field
Hi,
Please try the below snippet
This should work and set the date in the datum field.
In the previous post, I mean if it would be possible for you to upload another snapshot of the the application with the date field filled with a valid value. Sorry for the confusion.
Please try the below snippet
Code: Select all
autopsyRepo.Barhusmeddelande.SgImplants.Text = System.DateTime.Now.ToShortDateString().ToString()
In the previous post, I mean if it would be possible for you to upload another snapshot of the the application with the date field filled with a valid value. Sorry for the confusion.
Re: How to put Sysdate to a cell field
Hi Manish,
I tried new solution which gave me below error
Property or indexer 'Cell.Text' cannot be assigned to -- it is read only (CS0200) -
PFA snapshot of cell field with filled value.
I tried new solution which gave me below error
Property or indexer 'Cell.Text' cannot be assigned to -- it is read only (CS0200) -
PFA snapshot of cell field with filled value.
You do not have the required permissions to view the files attached to this post.
Re: How to put Sysdate to a cell field
HI,
The only fields that I can see that correspond to the date values are Text and Name and there is no field that identifies the cell to be read only.
I have a few questions. Does the cell become active only after you click on it? Is the value filled by you manually or is it filled automatically by pressing some button on your application?
In any case, could you try clicking on the cell first to make it active and then try setting the value for date and see if it works
Manish
The only fields that I can see that correspond to the date values are Text and Name and there is no field that identifies the cell to be read only.
I have a few questions. Does the cell become active only after you click on it? Is the value filled by you manually or is it filled automatically by pressing some button on your application?
In any case, could you try clicking on the cell first to make it active and then try setting the value for date and see if it works
Code: Select all
autopsyRepo.Barhusmeddelande.SgImplants.Click(Location.Center);
autopsyRepo.Barhusmeddelande.SgImplants.Text = System.DateTime.Now.ToShortDateString().ToString();
Re: How to put Sysdate to a cell field
Hi Manish,
I tried your solution ,after provide click on the cell , but it did not work
Property or indexer 'Cell.Text' cannot be assigned to -- it is read only (CS0200) -
I manually provided the value in the cell not automatically by application.
Ranorex spy also detects as enabled as true for cell
I tried your solution ,after provide click on the cell , but it did not work
Property or indexer 'Cell.Text' cannot be assigned to -- it is read only (CS0200) -
I manually provided the value in the cell not automatically by application.
Ranorex spy also detects as enabled as true for cell
Re: How to put Sysdate to a cell field
Have you tried a simple key-sequence action (coded version below)?
Code: Select all
autopsyRepo.Barhusmeddelande.SgImplants.PressKeys(System.DateTime.Now.ToShortDateString());
Re: How to put Sysdate to a cell field
Hi ,
Thanks for your help,
Below cod worked
autopsyRepo.Barhusmeddelande.SgImplants1.PressKeys(System.DateTime.Now.ToShortDateString());
Thanks for your help,
Below cod worked
autopsyRepo.Barhusmeddelande.SgImplants1.PressKeys(System.DateTime.Now.ToShortDateString());