Alternative ways to input text on field - appium

I need to test this login form on iOS Emulator, but when I try to insert text on element '//input[#name="email"]' the text is putted however when I select the element '//input[#name="password"]' the text from the first element disappear, the same happens when I press the '//div[#id="react-component-login-header']//button/div/span[1]" element.
I think the problem is related how the Text is inputted in form, since that using Selenium2Library (for Desktop) don't have this problem.
Any other way how I can insert text on the field? I don't have any problem in using other Libraries or creating Keywords on Python to auxiliary the tests (already did on other tests).
I already tried with:
Input Text
Input Value
Input Password (I know, but i needed to try something else)
*** Settings ***
Library Dialogs
Library AppiumLibrary
*** Variables ***
${defaultTimeout} 15s
*** Test Cases ***
TC001
[Setup] Configuration
Start Test
Wait Until Page Contains Element //*[#id='age-gate-yes'] ${defaultTimeout}
Click Element //a[#id='age-gate-yes']
Wait Until Page Contains Element //a[#href="/profile"] ${defaultTimeout}
Click Element //a[#href="/profile"]
Wait Until Page Contains Element //input[#name="email"] ${defaultTimeout}
Click Element //input[#name="email"]
Input Text //input[#name="email"] johndoe#john.doe
Click Element //input[#name="password"]
Input Text //input[#name="password"] JohnDoe123
Click Element //div[#id='react-component-login-header']//button/div/span[1]
Wait Until Page Does Not Contain Element //div[#id='react-component-login-header']//button/div/span[1] ${defaultTimeout}
[Teardown] End Test
I can see the text being written on field, but when the context of that element is lost, the text is too.

For Android I resolve the problem using the keyword "AppiumLibrary.Press Keycode"
Example, sending a "AppiumLibrary.Press Keycode 67" I managed to send a backspace
https://developer.android.com/reference/android/view/KeyEvent.html

Related

Robotframework: ValueError: Element locator 'locator(332,400)' did not match any elements

I am trying to setup a automaited test. I am useing RobotFramework and the AppiumLibrary
I am using click a point when tap a button, because I use Flutter on my apps.
When i try to input the text on:
http://serhatbolsu.github.io/robotframework-appiumlibrary/AppiumLibrary.html
said I must use locator, text
but when I try to use locator with my coordinate
click a point 332 400
sleep 2s
input text locator(332,400) testing
and then this notification appears
ValueError: Element locator 'locator(332,400)' did not match any elements.
I already googling and cannot find the answer, please help me, thankyou
Use a valid locator from its locator introduction
http://serhatbolsu.github.io/robotframework-appiumlibrary/AppiumLibrary.html#Introduction
i.e: input text id=my_element TextToInput

Standard print button is inoperative in custom Report

My customer has reported a problem that standard ''print'' button in Z-report which a developer wrote before is not working.
How can I enable the button?
MODULE user_command_0100 INPUT.
DATA: GS_STATUS TYPE SLIS_STATUS,
XS_STATUS LIKE GS_STATUS.
CASE sy-ucomm.
WHEN 'BACK' OR '%EX' OR 'RW'.
LEAVE TO SCREEN 0.
WHEN '&RNT'.
ENDCASE.
ENDMODULE.
Then button needs a usercommand assigned, which is then processed in pai. usually with a general form called get_ucomm (many developers call it similar). You also can issue /h in transaction field and then press the print-button. /h will trigger the debugger and You can inspect the report step by step.
That's all I can say without seeing the code. Hope this will help.
Which user command do you define in your GUI status?
If you have a standard list (what I expect when you write about a z-report), then you should define the command PRI to print the list:
If you define a screen (using the screen painter) or an ALV-Grid... then this solution will not help you.
If you don't know, what a GUI status is: Scan your source code for the command
SET PF-STATUS 'XXXX'.
Then double click on 'XXXX' and you should be directed to the status definition. There may by multiple status (and status with generic names).
I've seen your code and for the &RNT option there's no code to execute, so if the user wants to print the button will do nothing.
MODULE user_command_0100 INPUT.
DATA: GS_STATUS TYPE SLIS_STATUS,
XS_STATUS LIKE GS_STATUS.
CASE sy-ucomm.
WHEN 'BACK' OR '%EX' OR 'RW'.
LEAVE TO SCREEN 0.
WHEN '&RNT'.
" There's no code
ENDCASE.
ENDMODULE.
I've used the 'STANDARD' GUI Status from the function group 'KKBL' and '&RNT' is the code of the print button and that's why I think that is the print button you are refering in your program.
Can you post the GUI Status you are using please?

How to prevent message from disappearing in a message subfile?

I have a RPG program A and a CL program B. A accepts some user input from display file and use it as the entry parameter of B. b processes the entry parameter, and if there is an error the message will be received and resent by B so that it will be displayed on the bottom of the display file using message subfile. This message displaying mechanism works but not completely, as the message sent could only be glanced in a very short period of time, then it disappeared from the display file. What would be the cause of this problem? How to stop the message from disappearing?
Here is the sample code inside program B:
DCLF FILE(ECSWIFP1)
MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(ERROR))
OVRDBF FILE(ECSWIFP1) TOFILE(ECSWIFP1) SHARE(*YES)
OPNQRYF FILE(ECSWIFP1) QRYSLT(&QRYSTR)
RCVF
CLOF FILE(ECSWIFP1)
DLTOVR FILE(ECSWIFP1)
RTVDTAARA DTAARA(&E4LIBN/&E4OBJN) RTNVAR(&DTARVAL)
GOTO CMDLBL(END)
ERROR:
CLOF FILE(ECSWIFP1)
MONMSG MSGID(CPF4520)
DLTOVR FILE(ECSWIFP1)
MONMSG MSGID(CPF9841)
MSG:
RCVMSG MSGTYPE(*ANY) MSGDTA(&MSGDTA) MSGID(&MSGID)
IF COMD(%SST(&MSGID 1 3)) *NE 'CPF') THEN(GOTO CMDLBL(MSG))
SNDPGMMSG MSGID(&MSGID) MSGF(QCPFMSG) MSGDTA(&MSGDTA) MSGTYPE(*STATUS) TOPGMQ(*EXT)
END:
ENDPGM
And here is part of the display file DDS for displaying message:
A R MSG SFL
A SFLMSGRCD(24)
A S0MSGK SFLMSGKEY
A S0PGMQ SFLPGMQ
A R MSGCTL SFLCTL(MSG)
A OVERLAY
A SFLDSP
A SFLINZ
A SFLSIZ(0005)
A SFLPAG(0001)
A S0PGMQ SFLPGMQ
Suppose there is no matching record based on the query string, then RCVF causes CPF0864 to be sent out, and this message can be displayed on the screen without problem.
But if a record is found and the field values are used in the RTVDTAARA command, and the failure of this command (e.g. data area not found) will causes the problem I described above, which is that the received message can only be glimpsed in a short period of time and then disappears. Why this happens?
The typical sequence is
write msgctl
write bottom
exfmt main
Make sure that any record format displayed after the message subfile has OVERLAY specified. Without OVERLAY, 'bottom' will erase the message subfile and 'main' will erase 'bottom'.
Application Display Programming is an old but useful reference.
EDIT After seeing the CL and DDS.
I believe the issue is due to SNDPGMMSG MSGTYPE(*STATUS). Status messages are special, and do not normally go into a subfile message queue. The Messages section in the Infocenter has more information on the different message types.
In CL PGMB, change the SNDPGMMSG to MSGTYPE(*DIAG) TOPGMQ(*PRV). This will throw the exception message to the caller (to PGMA) as a diagnostic message. Double check that you have OVERLAY in the DDS where you need it - my example above that would be bottom and main.
This sequence worked and display the message of message-subfile on the screen
The typical sequence is
write msgctl
write bottom
exfmt main
Make sure that any record format displayed after the message subfile has OVERLAY specified. Without OVERLAY, 'bottom' will erase the message subfile and 'main' will erase 'bottom'.
c

How to display message at the bottom of a display file in CL program?

Suppose a display file has been declared in a CL program. It accepts some user input and conducts some validations to it. If it fails the validation a message would be displayed on the bottom of the display file. Is it possible to achieve this in CL? I have tried SNDPGMMSG with MSGTYPE(*DIAG), but the message is displayed only after the program has been terminated, and not on the display file during the execution.
The message to be sent is retrieved from message file so using field to display message is not applicable.
Normally we use message subfile to achive what you required above.
It can be done in display file for both CL and RPG
For CL example, you could read here http://www.mcpressonline.com/cl/the-cl-corner-letting-the-user-know-what-s-right-and-wrong.html.
You could search for "cl program message subfile" for other examples
Define a 75 character field in your display file DDS. Call it MESSAGE. In your CL do something like:
if (&option *ge '35') do
CHGVAR &MESSAGE 'Invalid option chosen'
goto getOption
enddo

RTE validation not happening

https://gist.github.com/773349
RTE field validation is not happening if I traverse from RTE to RTE. Please find the attached git.
Steps to reproduce
Case 1
Focus into RTE1, type Hello
Tab out to text input (Node Selector)
Validation works
Case 2
Focus into RTE1, type Hello
Tab out to RTE2
Validation doesn't work
I tried with nightly build and was able to reproduce the above error and case 1 is failing too. An other difference that I noticed is "xxforms-value-change-with-focus-change" event is not fired when moved from RTE to RTE.
This is fixed as of 2011-01-24, and this fix will be included in the Orbeon Forms 3.9 release. Also see: [ #315639 ] RTE: values are not sent to the server when the RTE looses the focus.

Resources