Is there any idea to use appium to send request to graph ql api

i had test case which is required to set data before start the test case so is there way to make it hard coded in code of appium before creating the test case because the test case will fail if these data are not present

You are looking for a Data Provider, which is dependent on the coding language you are using and the testing framework (such as TestNg). Here is a tutorial on Data Providers in TestNg:

And here is the TestNg google group where you can ask further questions:

Thanks for reply but i need to set the data by api request by java code before running the test

but in same place of test script

so i asked if any one face this because if the data are not set >> the test script will fail

no get the data from excel sheet

Just set that data in the Data Provider as an @BeforeTest. Yes, you can use data from a spreadsheet, but a Data Provider can hold any data object you’d like it to.

But if you don’t like the answer feel free to find a better one. This certainly isn’t an Appium question.

Thanks for your answer , i mean if i have access to api and can send request before test , i need only one example to use it as template

If you are using TestNg (I’ve just been using that as an example, no idea what your coding looks like), then you could set a variable or parameter to whatever value you’d like using @BeforeTest. Maybe DataProvider is more than you really need:

1 Like