Page 1 of 1

Create if else sceneario to meet the precondiotions of test

Posted: Fri Sep 08, 2017 9:12 am
by MartinKubal
Hi,
I am really newbie, working with ranorex 1 month.
I need to make Setup area for few test cases for our mobile app in order to meet the preconditions. It is quite simple, we have in app checkbox Remember me (for login credentials), but its not a real checkbox, it is image which change, when you tap on it. The ID will be same.

Xpath for this element is ...img[#'cb'] and only parametr, tha is changing is SRC (could be .......unchecked.png and ........checked.png). And I need to create condition when I open the app, check wether is "checked" or not and then perform the test or touch on the element to change it to "unchecked" and vice versa.

I know I have to do it in user code, but I have almost any experience with programming, so I would appreciate your help please. I've tried write code in C# accordingly to some tutorials but it wasn't working.

1 sceneario:
Open app
Check /img[#'cb']
IF unchecked continue with tests
ELSE touch the element /img[#'cb'] to make it unchecked
Validate if it is really unchecked and then continue with test

2 sceneario:
Open app
Check /img[#'cb']
IF checked continue with tests
ELSE touch the element /img[#'cb'] to make it checked
Validate if it is really checked and then continue with test

Thank you for your help.

Re: Create if else sceneario to meet the precondiotions of test

Posted: Mon Sep 18, 2017 9:02 am
by MartinKubal
Never mind, I did found solution allready.