Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 2

How to validate the screen using the robot framework?

Please suggest the solution for validating the screen using multiple conditions with If-else statement in robot framework and suggest the syntax for FOR loop and If-else statement.

Main agenda is to check whether infotainment system is navigating from one screen to another screen based on the input.

Example: click - "connectivity", the next frame should be features of it(validate this navigation)

 

Sample code:

 

:FOR ${index} IN 0 1
${obj1}= ui.Get Object resourceId=techmahindra.flex.com.flex_ohc:id/txt_home_connectivity text=Connectivity
${icon1}= Get Info Of Object ${obj1} text
Log To Console The present screen is ${icon1}
${obj2}= ui.Get Object resourceId=techmahindra.flex.com.flex_ohc:id/txt_home_entertainment text=Entertainment
${icon2}= Get Info Of Object ${obj2} text
Log To Console The present screen is ${icon2}
${obj3}= ui.Get Object resourceId=techmahindra.flex.com.flex_ohc:id/txt_home_safety text=Safety
${icon3}= Get Info Of Object ${obj3} text
Log To Console The present screen is ${icon3}
${obj4}= ui.Get Object resourceId=techmahindra.flex.com.flex_ohc:id/txt_home_settings text=Settings
${icon4}= Get Info Of Object ${obj4} text
Log To Console The present screen is ${icon4}
Run Keyword If '${icon1}' == 'Connectivity' or '${icon2}' == 'Entertainment' or '${icon4}' == 'Settings' or '${icon3}' == 'Safety' Click At Coordinates 137 319

1 Reply
Community Manager
Message 2 of 2

Re: How to validate the screen using the robot framework?

Hi @srikanthpailla,

This post was moved to a different board that fits your topic of discussion a bit better. This means you’ll get better engagement on your post, and it keeps our Community organized so users can more easily find information.

As you’ll notice, your Topic is now in the Project Development Help and Advice board. No action is needed on your part; you can continue the conversation as normal here.

 


Cheers!