-1

This is my code. The username and password variable gets value from excel file. if i execute the code, opens a new browser for each every row ( in excel ). I'am searching for a command or else for open browse one time, at the beginning

WebUI.openBrowser('')

WebUI.navigateToUrl('https://link.com')

WebUI.setText(findTestObject(' Log In/input_), username)

WebUI.setText(findTestObject(' Log In/input_), password)

WebUI.click(findTestObject(' Log In/button_Login'))

WebUI.delay(5)

WebUI.click(findTestObject('Page_Home/a_LOGOUT'))
  • This cannot be all of your code. I am sure there is a for loop missing. How would you get all the excel rows otherwise? Please share more of the code. – Mate Mrše Feb 05 '20 at 08:13
  • Its the all code, the katalon automatically get all rows, and loop this code block. and the studio read "openBrowser" in every loop – madmaxzu Feb 06 '20 at 09:38

2 Answers2

0

I don't really know if it is the problem, but you have some wrong single quotes, try changing your code for this:

WebUI.navigateToUrl('https://link.com')

WebUI.setText(findTestObject(' Log In/input_'), username)

WebUI.setText(findTestObject(' Log In/input_'), password)

WebUI.click(findTestObject(' Log In/button_Login'))

WebUI.delay(5)

WebUI.click(findTestObject('Page_Home/a_LOGOUT'))
0

To open the browser only one time you should make a Test suit and put the "Open browser" test case at first position and after that put the second test case of multiple user log-in. This will open the browser only one time and Login user as per given Excel data.

In the below image, I show that I make 3 test case in one test suit and username and password is variable:

The below image

Taazar
  • 1,545
  • 18
  • 27
Bhargav
  • 1
  • 3