Skip to Content
0

Special checkbox set to X in personas

May 16, 2017 at 03:15 PM

150

avatar image

Hello,

I need to set a checkbox to X in a table inside an order (material view).

I use the command modifiyCell but the value must be a string.

so currently when I pass X, it put X at the right of the box0

I try different cases (true, null,...) and couldn't set the value to On.

Thanks,

Emmanuel.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Sebastian Steinhauer
Jun 16, 2017 at 02:47 PM
0

Thomas solution would work.
However the script recorder does not currently record a nice call for this case but used our fallback recording - something like this:

session.findById("wnd[0]/usr/tblSAPM_GUITEST_PORTABLETABLECONTROL/chkITAB-COL8[7,3]").executeWebRequest("post", "action", "7", null, null);

However - if you know that you are interacting with a checkbox you can simply trigger the corresponding checkbox method on the return value from session.findById

session.findById("wnd[0]/usr/tblSAPM_GUITEST_PORTABLETABLECONTROL/chkITAB-COL8[7,1]").select();

Pretty cool, right?

Cheers,
--
Sebastian Steinhauer, SAP Design
SAP Screen Personas
Product Owner

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks Sebastian, it works fine for the select on a check box:

But what would be the short method to de-select a checkbox?

I try the .select or .unselect but non works?

session.findById("wnd[0]/usr/tblSAPM_GUITEST_PORTABLETABLECONTROL/chkITAB-COL8[7,1]").unselect();

Thanks,

Emmanuel.

0
Thomas Mangler May 17, 2017 at 05:47 AM
0

In such cases you can try to "record" the action. I guess you need an "executewebrequest" to do this action.

"Start Recording" > set the checkbox manual > klick another button e.g. save > "stop recording"

(the checkbox recording works only in combination with other actions)

Best regards

Thomas

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hello,

It works ok if you know the specific line to change:

session.findById("wnd[0]/usr/tblSAPLCOMKTCTRL_5120/chkRESBD-SCHGT[17,0]").executeWebRequest("post", "action", "7", null, null);

But if you want to pass the line number as a paraneter for example in a loop, the record don't work as you cannot replace the 17 by i

for (i=0;i<session.findById("wnd[0]/usr/tblSAPLCOMKTCTRL_5120").maxRows;i++){
session.findById("wnd[0]/usr/tblSAPLCOMKTCTRL_5120/chkRESBD-SCHGT[i,0]").executeWebRequest("post", "action", "7", null, null);
}<br>

--> doesn't work.

this case neither:

for (i=0;i<session.findById("wnd[0]/usr/tblSAPLCOMKTCTRL_5120").maxRows;i++){
session.findById("wnd[0]/usr/tblSAPLCOMKTCTRL_5120/chkRESBD-SCHGT["i",0]").executeWebRequest("post", "action", "7", null, null);
} <br>

--> doesn't work.

with the modifyCell instruction I can pass the line number as a parameter.

But how to pass the instruction to flag the cell?

0

for your loop please note that the ID in findById is treated as a string. So you would need to update the string value accordingly:

for (i=0; i<4; i++){
session.findById("wnd[0]/usr/tblSAPM_GUITEST_PORTABLETABLECONTROL/chkITAB-COL8[7,"+i+"]").select();
}

Cheers,
--
Sebastian Steinhauer, SAP Design
SAP Screen Personas
Product Owner

1